Cesium for Unity 1.15.2
Loading...
Searching...
No Matches
CesiumMetadataValue.cs
Go to the documentation of this file.
1using System;
2using Unity.Mathematics;
3using Reinterop;
4using System.Collections.Generic;
5namespace CesiumForUnity
6{
11 [ReinteropNativeImplementation("CesiumForUnityNative::CesiumMetadataValueImpl", "CesiumMetadataValueImpl.h", staticOnly: true)]
12 public partial class CesiumMetadataValue
13 {
22 internal System.Object objectValue { get; set; }
23
24 #region Getters
25
32 {
33 get
34 {
35 return CesiumMetadataValueType.GetValueType(this.objectValue);
36 }
37 }
38
49 public bool isEmpty
50 {
51 get { return this.objectValue == null; }
52 }
53 #endregion
54
55 #region Constructors
56 public CesiumMetadataValue() : this(null)
57 { }
58
59 public CesiumMetadataValue(System.Object value)
60 {
61 // Convert intN to CesiumIntVecN, uintN to CesiumUintVecN, intNxN to CesiumIntMatNxN,
62 // and uintNxN to CesiumUintMatNxN. This avoids having to manage conversions for
63 // multiple representations of vector values.
64 switch (value)
65 {
66 case int2 asInt2:
67 this.objectValue = new CesiumIntVec2(asInt2.x, asInt2.y);
68 break;
69 case int3 asInt3:
70 this.objectValue = new CesiumIntVec3(asInt3.x, asInt3.y, asInt3.z);
71 break;
72 case int4 asInt4:
73 this.objectValue = new CesiumIntVec4(asInt4.x, asInt4.y, asInt4.z, asInt4.w);
74 break;
75 case uint2 asUint2:
76 this.objectValue = new CesiumUintVec2(asUint2.x, asUint2.y);
77 break;
78 case uint3 asUint3:
79 this.objectValue = new CesiumUintVec3(asUint3.x, asUint3.y, asUint3.z);
80 break;
81 case uint4 asUint4:
82 this.objectValue = new CesiumUintVec4(asUint4.x, asUint4.y, asUint4.z, asUint4.w);
83 break;
84 case int2x2 asInt2x2:
85 this.objectValue = new CesiumIntMat2x2(asInt2x2.c0, asInt2x2.c1);
86 break;
87 case int3x3 asInt3x3:
88 this.objectValue = new CesiumIntMat3x3(asInt3x3.c0, asInt3x3.c1, asInt3x3.c2);
89 break;
90 case int4x4 asInt4x4:
91 this.objectValue = new CesiumIntMat4x4(asInt4x4.c0, asInt4x4.c1, asInt4x4.c2, asInt4x4.c3);
92 break;
93 case uint2x2 asUint2x2:
94 this.objectValue = new CesiumUintMat2x2(asUint2x2.c0, asUint2x2.c1);
95 break;
96 case uint3x3 asUint3x3:
97 this.objectValue = new CesiumUintMat3x3(asUint3x3.c0, asUint3x3.c1, asUint3x3.c2);
98 break;
99 case uint4x4 asUint4x4:
100 this.objectValue = new CesiumUintMat4x4(asUint4x4.c0, asUint4x4.c1, asUint4x4.c2, asUint4x4.c3);
101 break;
102 default:
103 this.objectValue = value;
104 break;
105 }
106 }
107
108 #endregion
109
110 #region Public Methods
132 public Boolean GetBoolean(Boolean defaultValue = false)
133 {
134 if (this.isEmpty || this.valueType.isArray)
135 {
136 return defaultValue;
137 }
138
139 return ConvertToBoolean(this, defaultValue);
140 }
141
166 public SByte GetSByte(SByte defaultValue = 0)
167 {
168 if (this.isEmpty || this.valueType.isArray)
169 {
170 return defaultValue;
171 }
172
173 return ConvertToSByte(this, defaultValue);
174 }
175
200 public Byte GetByte(Byte defaultValue = 0)
201 {
202 if (this.isEmpty || this.valueType.isArray)
203 {
204 return defaultValue;
205 }
206
207 return ConvertToByte(this, defaultValue);
208 }
209
234 public Int16 GetInt16(Int16 defaultValue = 0)
235 {
236 if (this.isEmpty || this.valueType.isArray)
237 {
238 return defaultValue;
239 }
240
241 return ConvertToInt16(this, defaultValue);
242 }
243
269 public UInt16 GetUInt16(UInt16 defaultValue = 0)
270 {
271 if (this.isEmpty || this.valueType.isArray)
272 {
273 return defaultValue;
274 }
275
276 return ConvertToUInt16(this, defaultValue);
277 }
278
305 public Int32 GetInt32(Int32 defaultValue = 0)
306 {
307 if (this.isEmpty || this.valueType.isArray)
308 {
309 return defaultValue;
310 }
311
312 return ConvertToInt32(this, defaultValue);
313 }
314
339 public UInt32 GetUInt32(UInt32 defaultValue = 0)
340 {
341 if (this.isEmpty || this.valueType.isArray)
342 {
343 return defaultValue;
344 }
345
346 return ConvertToUInt32(this, defaultValue);
347 }
348
375 public Int64 GetInt64(Int64 defaultValue = 0)
376 {
377 if (this.isEmpty || this.valueType.isArray)
378 {
379 return defaultValue;
380 }
381
382 return ConvertToInt64(this, defaultValue);
383 }
384
409 public UInt64 GetUInt64(UInt64 defaultValue = 0)
410 {
411 if (this.isEmpty || this.valueType.isArray)
412 {
413 return defaultValue;
414 }
415
416 return ConvertToUInt64(this, defaultValue);
417 }
418
444 public float GetFloat(float defaultValue = 0)
445 {
446 if (this.isEmpty || this.valueType.isArray)
447 {
448 return defaultValue;
449 }
450
451 return ConvertToFloat(this, defaultValue);
452 }
453
478 public double GetDouble(double defaultValue = 0)
479 {
480 if (this.isEmpty || this.valueType.isArray)
481 {
482 return defaultValue;
483 }
484
485 return ConvertToDouble(this, defaultValue);
486 }
487
513 public int2 GetInt2(int2 defaultValue)
514 {
515 if (this.isEmpty || this.valueType.isArray)
516 {
517 return defaultValue;
518 }
519
520 return ConvertToInt2(this, defaultValue);
521 }
522
548 public uint2 GetUInt2(uint2 defaultValue)
549 {
550 if (this.isEmpty || this.valueType.isArray)
551 {
552 return defaultValue;
553 }
554
555 return ConvertToUInt2(this, defaultValue);
556 }
557
584 public float2 GetFloat2(float2 defaultValue)
585 {
586 if (this.isEmpty || this.valueType.isArray)
587 {
588 return defaultValue;
589 }
590
591 return ConvertToFloat2(this, defaultValue);
592 }
593
616 public double2 GetDouble2(double2 defaultValue)
617 {
618 if (this.isEmpty || this.valueType.isArray)
619 {
620 return defaultValue;
621 }
622
623 return ConvertToDouble2(this, defaultValue);
624 }
625
654 public int3 GetInt3(int3 defaultValue)
655 {
656 if (this.isEmpty || this.valueType.isArray)
657 {
658 return defaultValue;
659 }
660
661 return ConvertToInt3(this, defaultValue);
662 }
663
692 public uint3 GetUInt3(uint3 defaultValue)
693 {
694 if (this.isEmpty || this.valueType.isArray)
695 {
696 return defaultValue;
697 }
698
699 return ConvertToUInt3(this, defaultValue);
700 }
701
731 public float3 GetFloat3(float3 defaultValue)
732 {
733 if (this.isEmpty || this.valueType.isArray)
734 {
735 return defaultValue;
736 }
737
738 return ConvertToFloat3(this, defaultValue);
739 }
740
766 public double3 GetDouble3(double3 defaultValue)
767 {
768 if (this.isEmpty || this.valueType.isArray)
769 {
770 return defaultValue;
771 }
772
773 return ConvertToDouble3(this, defaultValue);
774 }
775
804 public int4 GetInt4(int4 defaultValue)
805 {
806 if (this.isEmpty || this.valueType.isArray)
807 {
808 return defaultValue;
809 }
810
811 return ConvertToInt4(this, defaultValue);
812 }
813
842 public uint4 GetUInt4(uint4 defaultValue)
843 {
844 if (this.isEmpty || this.valueType.isArray)
845 {
846 return defaultValue;
847 }
848
849 return ConvertToUInt4(this, defaultValue);
850 }
851
879 public float4 GetFloat4(float4 defaultValue)
880 {
881 if (this.isEmpty || this.valueType.isArray)
882 {
883 return defaultValue;
884 }
885
886 return ConvertToFloat4(this, defaultValue);
887 }
888
914 public double4 GetDouble4(double4 defaultValue)
915 {
916 if (this.isEmpty || this.valueType.isArray)
917 {
918 return defaultValue;
919 }
920
921 return ConvertToDouble4(this, defaultValue);
922 }
923
950 public int2x2 GetInt2x2(int2x2 defaultValue)
951 {
952 if (this.isEmpty || this.valueType.isArray)
953 {
954 return defaultValue;
955 }
956
957 return ConvertToInt2x2(this, defaultValue);
958 }
959
986 public uint2x2 GetUInt2x2(uint2x2 defaultValue)
987 {
988 if (this.isEmpty || this.valueType.isArray)
989 {
990 return defaultValue;
991 }
992
993 return ConvertToUInt2x2(this, defaultValue);
994 }
995
1022 public float2x2 GetFloat2x2(float2x2 defaultValue)
1023 {
1024 if (this.isEmpty || this.valueType.isArray)
1025 {
1026 return defaultValue;
1027 }
1028
1029 return ConvertToFloat2x2(this, defaultValue);
1030 }
1031
1055 public double2x2 GetDouble2x2(double2x2 defaultValue)
1056 {
1057 if (this.isEmpty || this.valueType.isArray)
1058 {
1059 return defaultValue;
1060 }
1061
1062 return ConvertToDouble2x2(this, defaultValue);
1063 }
1064
1095 public int3x3 GetInt3x3(int3x3 defaultValue)
1096 {
1097 if (this.isEmpty || this.valueType.isArray)
1098 {
1099 return defaultValue;
1100 }
1101
1102 return ConvertToInt3x3(this, defaultValue);
1103 }
1104
1135 public uint3x3 GetUInt3x3(uint3x3 defaultValue)
1136 {
1137 if (this.isEmpty || this.valueType.isArray)
1138 {
1139 return defaultValue;
1140 }
1141
1142 return ConvertToUInt3x3(this, defaultValue);
1143 }
1144
1175 public float3x3 GetFloat3x3(float3x3 defaultValue)
1176 {
1177 if (this.isEmpty || this.valueType.isArray)
1178 {
1179 return defaultValue;
1180 }
1181
1182 return ConvertToFloat3x3(this, defaultValue);
1183 }
1184
1212 public double3x3 GetDouble3x3(double3x3 defaultValue)
1213 {
1214 if (this.isEmpty || this.valueType.isArray)
1215 {
1216 return defaultValue;
1217 }
1218
1219 return ConvertToDouble3x3(this, defaultValue);
1220 }
1221
1249 public int4x4 GetInt4x4(int4x4 defaultValue)
1250 {
1251 if (this.isEmpty || this.valueType.isArray)
1252 {
1253 return defaultValue;
1254 }
1255
1256 return ConvertToInt4x4(this, defaultValue);
1257 }
1258
1284 public uint4x4 GetUInt4x4(uint4x4 defaultValue)
1285 {
1286 if (this.isEmpty || this.valueType.isArray)
1287 {
1288 return defaultValue;
1289 }
1290
1291 return ConvertToUInt4x4(this, defaultValue);
1292 }
1293
1319 public float4x4 GetFloat4x4(float4x4 defaultValue)
1320 {
1321 if (this.isEmpty || this.valueType.isArray)
1322 {
1323 return defaultValue;
1324 }
1325
1326 return ConvertToFloat4x4(this, defaultValue);
1327 }
1328
1353 public double4x4 GetDouble4x4(double4x4 defaultValue)
1354 {
1355 if (this.isEmpty || this.valueType.isArray)
1356 {
1357 return defaultValue;
1358 }
1359
1360 return ConvertToDouble4x4(this, defaultValue);
1361 }
1362
1377 public String GetString(String defaultValue = "")
1378 {
1379 if (this.isEmpty || this.valueType.isArray)
1380 {
1381 return defaultValue;
1382 }
1383
1384 return ConvertToString(this, defaultValue);
1385 }
1386
1393 {
1394 if (valueType.isArray)
1395 {
1396 return this.objectValue as CesiumPropertyArray;
1397 }
1398
1399 return new CesiumPropertyArray();
1400 }
1401
1413 public static Dictionary<String, String> GetValuesAsStrings(Dictionary<String, CesiumMetadataValue> values)
1414 {
1415 Dictionary<String, String> result = new Dictionary<String, String>(values.Count);
1416 foreach (KeyValuePair<String, CesiumMetadataValue> pair in values)
1417 {
1418 result.Add(pair.Key, pair.Value.GetString());
1419 }
1420
1421 return result;
1422 }
1423 #endregion
1424
1425 #region Internal casts for Reinterop
1426 internal static bool? GetObjectAsBoolean(System.Object inObject)
1427 {
1428 return inObject as bool?;
1429 }
1430 internal static SByte? GetObjectAsSByte(System.Object inObject)
1431 {
1432 return inObject as SByte?;
1433 }
1434 internal static Byte? GetObjectAsByte(System.Object inObject)
1435 {
1436 return inObject as Byte?;
1437 }
1438 internal static Int16? GetObjectAsInt16(System.Object inObject)
1439 {
1440 return inObject as Int16?;
1441 }
1442 internal static UInt16? GetObjectAsUInt16(System.Object inObject)
1443 {
1444 return inObject as UInt16?;
1445 }
1446 internal static Int32? GetObjectAsInt32(System.Object inObject)
1447 {
1448 return inObject as Int32?;
1449 }
1450 internal static UInt32? GetObjectAsUInt32(System.Object inObject)
1451 {
1452 return inObject as UInt32?;
1453 }
1454 internal static Int64? GetObjectAsInt64(System.Object inObject)
1455 {
1456 return inObject as Int64?;
1457 }
1458 internal static UInt64? GetObjectAsUInt64(System.Object inObject)
1459 {
1460 return inObject as UInt64?;
1461 }
1462 internal static float? GetObjectAsFloat(System.Object inObject)
1463 {
1464 return inObject as float?;
1465 }
1466 internal static double? GetObjectAsDouble(System.Object inObject)
1467 {
1468 return inObject as double?;
1469 }
1470 internal static CesiumIntVec2? GetObjectAsCesiumIntVec2(System.Object inObject)
1471 {
1472 return inObject as CesiumIntVec2?;
1473 }
1474 internal static CesiumIntVec3? GetObjectAsCesiumIntVec3(System.Object inObject)
1475 {
1476 return inObject as CesiumIntVec3?;
1477 }
1478 internal static CesiumIntVec4? GetObjectAsCesiumIntVec4(System.Object inObject)
1479 {
1480 return inObject as CesiumIntVec4?;
1481 }
1482 internal static CesiumUintVec2? GetObjectAsCesiumUintVec2(System.Object inObject)
1483 {
1484 return inObject as CesiumUintVec2?;
1485 }
1486 internal static CesiumUintVec3? GetObjectAsCesiumUintVec3(System.Object inObject)
1487 {
1488 return inObject as CesiumUintVec3?;
1489 }
1490 internal static CesiumUintVec4? GetObjectAsCesiumUintVec4(System.Object inObject)
1491 {
1492 return inObject as CesiumUintVec4?;
1493 }
1494 internal static float2? GetObjectAsFloat2(System.Object inObject)
1495 {
1496 return inObject as float2?;
1497 }
1498 internal static float3? GetObjectAsFloat3(System.Object inObject)
1499 {
1500 return inObject as float3?;
1501 }
1502 internal static float4? GetObjectAsFloat4(System.Object inObject)
1503 {
1504 return inObject as float4?;
1505 }
1506 internal static double2? GetObjectAsDouble2(System.Object inObject)
1507 {
1508 return inObject as double2?;
1509 }
1510 internal static double3? GetObjectAsDouble3(System.Object inObject)
1511 {
1512 return inObject as double3?;
1513 }
1514 internal static double4? GetObjectAsDouble4(System.Object inObject)
1515 {
1516 return inObject as double4?;
1517 }
1518 internal static CesiumIntMat2x2? GetObjectAsCesiumIntMat2x2(System.Object inObject)
1519 {
1520 return inObject as CesiumIntMat2x2?;
1521 }
1522 internal static CesiumIntMat3x3? GetObjectAsCesiumIntMat3x3(System.Object inObject)
1523 {
1524 return inObject as CesiumIntMat3x3?;
1525 }
1526 internal static CesiumIntMat4x4? GetObjectAsCesiumIntMat4x4(System.Object inObject)
1527 {
1528 return inObject as CesiumIntMat4x4?;
1529 }
1530 internal static CesiumUintMat2x2? GetObjectAsCesiumUintMat2x2(System.Object inObject)
1531 {
1532 return inObject as CesiumUintMat2x2?;
1533 }
1534 internal static CesiumUintMat3x3? GetObjectAsCesiumUintMat3x3(System.Object inObject)
1535 {
1536 return inObject as CesiumUintMat3x3?;
1537 }
1538 internal static CesiumUintMat4x4? GetObjectAsCesiumUintMat4x4(System.Object inObject)
1539 {
1540 return inObject as CesiumUintMat4x4?;
1541 }
1542 internal static float2x2? GetObjectAsFloat2x2(System.Object inObject)
1543 {
1544 return inObject as float2x2?;
1545 }
1546 internal static float3x3? GetObjectAsFloat3x3(System.Object inObject)
1547 {
1548 return inObject as float3x3?;
1549 }
1550 internal static float4x4? GetObjectAsFloat4x4(System.Object inObject)
1551 {
1552 return inObject as float4x4?;
1553 }
1554 internal static double2x2? GetObjectAsDouble2x2(System.Object inObject)
1555 {
1556 return inObject as double2x2?;
1557 }
1558 internal static double3x3? GetObjectAsDouble3x3(System.Object inObject)
1559 {
1560 return inObject as double3x3?;
1561 }
1562 internal static double4x4? GetObjectAsDouble4x4(System.Object inObject)
1563 {
1564 return inObject as double4x4?;
1565 }
1566 internal static String GetObjectAsString(System.Object inObject)
1567 {
1568 return inObject as String;
1569 }
1570
1571 #endregion
1572
1573 #region Internal setters for Reinterop
1574 internal void SetObjectValue(bool input)
1575 {
1576 this.objectValue = input;
1577 }
1578 internal void SetObjectValue(SByte input)
1579 {
1580 this.objectValue = input;
1581 }
1582 internal void SetObjectValue(Byte input)
1583 {
1584 this.objectValue = input;
1585 }
1586 internal void SetObjectValue(Int16 input)
1587 {
1588 this.objectValue = input;
1589 }
1590 internal void SetObjectValue(UInt16 input)
1591 {
1592 this.objectValue = input;
1593 }
1594 internal void SetObjectValue(Int32 input)
1595 {
1596 this.objectValue = input;
1597 }
1598 internal void SetObjectValue(UInt32 input)
1599 {
1600 this.objectValue = input;
1601 }
1602 internal void SetObjectValue(Int64 input)
1603 {
1604 this.objectValue = input;
1605 }
1606 internal void SetObjectValue(UInt64 input)
1607 {
1608 this.objectValue = input;
1609 }
1610 internal void SetObjectValue(float input)
1611 {
1612 this.objectValue = input;
1613 }
1614 internal void SetObjectValue(double input)
1615 {
1616 this.objectValue = input;
1617 }
1618 internal void SetObjectValue(CesiumIntVec2 input)
1619 {
1620 this.objectValue = input;
1621 }
1622 internal void SetObjectValue(CesiumIntVec3 input)
1623 {
1624 this.objectValue = input;
1625 }
1626 internal void SetObjectValue(CesiumIntVec4 input)
1627 {
1628 this.objectValue = input;
1629 }
1630 internal void SetObjectValue(CesiumUintVec2 input)
1631 {
1632 this.objectValue = input;
1633 }
1634 internal void SetObjectValue(CesiumUintVec3 input)
1635 {
1636 this.objectValue = input;
1637 }
1638 internal void SetObjectValue(CesiumUintVec4 input)
1639 {
1640 this.objectValue = input;
1641 }
1642 internal void SetObjectValue(float2 input)
1643 {
1644 this.objectValue = input;
1645 }
1646 internal void SetObjectValue(float3 input)
1647 {
1648 this.objectValue = input;
1649 }
1650 internal void SetObjectValue(float4 input)
1651 {
1652 this.objectValue = input;
1653 }
1654 internal void SetObjectValue(double2 input)
1655 {
1656 this.objectValue = input;
1657 }
1658 internal void SetObjectValue(double3 input)
1659 {
1660 this.objectValue = input;
1661 }
1662 internal void SetObjectValue(double4 input)
1663 {
1664 this.objectValue = input;
1665 }
1666 internal void SetObjectValue(CesiumIntMat2x2 input)
1667 {
1668 this.objectValue = input;
1669 }
1670 internal void SetObjectValue(CesiumIntMat3x3 input)
1671 {
1672 this.objectValue = input;
1673 }
1674 internal void SetObjectValue(CesiumIntMat4x4 input)
1675 {
1676 this.objectValue = input;
1677 }
1678 internal void SetObjectValue(CesiumUintMat2x2 input)
1679 {
1680 this.objectValue = input;
1681 }
1682 internal void SetObjectValue(CesiumUintMat3x3 input)
1683 {
1684 this.objectValue = input;
1685 }
1686 internal void SetObjectValue(CesiumUintMat4x4 input)
1687 {
1688 this.objectValue = input;
1689 }
1690 internal void SetObjectValue(float2x2 input)
1691 {
1692 this.objectValue = input;
1693 }
1694 internal void SetObjectValue(float3x3 input)
1695 {
1696 this.objectValue = input;
1697 }
1698 internal void SetObjectValue(float4x4 input)
1699 {
1700 this.objectValue = input;
1701 }
1702 internal void SetObjectValue(double2x2 input)
1703 {
1704 this.objectValue = input;
1705 }
1706 internal void SetObjectValue(double3x3 input)
1707 {
1708 this.objectValue = input;
1709 }
1710 internal void SetObjectValue(double4x4 input)
1711 {
1712 this.objectValue = input;
1713 }
1714 internal void SetObjectValue(String input)
1715 {
1716 this.objectValue = input;
1717 }
1718 internal void SetObjectValue(CesiumPropertyArray input)
1719 {
1720 this.objectValue = input;
1721 }
1722 #endregion
1723
1724 #region Internal static partial methods
1725 internal static partial bool ConvertToBoolean(CesiumMetadataValue value, bool defaultValue);
1726 internal static partial SByte ConvertToSByte(CesiumMetadataValue value, SByte defaultValue);
1727 internal static partial Byte ConvertToByte(CesiumMetadataValue value, Byte defaultValue);
1728 internal static partial Int16 ConvertToInt16(CesiumMetadataValue value, Int16 defaultValue);
1729 internal static partial UInt16 ConvertToUInt16(CesiumMetadataValue value, UInt16 defaultValue);
1730 internal static partial Int32 ConvertToInt32(CesiumMetadataValue value, Int32 defaultValue);
1731 internal static partial UInt32 ConvertToUInt32(CesiumMetadataValue value, UInt32 defaultValue);
1732 internal static partial Int64 ConvertToInt64(CesiumMetadataValue value, Int64 defaultValue);
1733 internal static partial UInt64 ConvertToUInt64(CesiumMetadataValue value, UInt64 defaultValue);
1734 internal static partial float ConvertToFloat(CesiumMetadataValue value, float defaultValue);
1735 internal static partial double ConvertToDouble(CesiumMetadataValue value, double defaultValue);
1736 internal static partial int2 ConvertToInt2(CesiumMetadataValue value, int2 defaultValue);
1737 internal static partial uint2 ConvertToUInt2(CesiumMetadataValue value, uint2 defaultValue);
1738 internal static partial float2 ConvertToFloat2(CesiumMetadataValue value, float2 defaultValue);
1739 internal static partial double2 ConvertToDouble2(CesiumMetadataValue value, double2 defaultValue);
1740 internal static partial int3 ConvertToInt3(CesiumMetadataValue value, int3 defaultValue);
1741 internal static partial uint3 ConvertToUInt3(CesiumMetadataValue value, uint3 defaultValue);
1742 internal static partial float3 ConvertToFloat3(CesiumMetadataValue value, float3 defaultValue);
1743 internal static partial double3 ConvertToDouble3(CesiumMetadataValue value, double3 defaultValue);
1744 internal static partial int4 ConvertToInt4(CesiumMetadataValue value, int4 defaultValue);
1745 internal static partial uint4 ConvertToUInt4(CesiumMetadataValue value, uint4 defaultValue);
1746 internal static partial float4 ConvertToFloat4(CesiumMetadataValue value, float4 defaultValue);
1747 internal static partial double4 ConvertToDouble4(CesiumMetadataValue value, double4 defaultValue);
1748 internal static partial int2x2 ConvertToInt2x2(CesiumMetadataValue value, int2x2 defaultValue);
1749 internal static partial uint2x2 ConvertToUInt2x2(CesiumMetadataValue value, uint2x2 defaultValue);
1750 internal static partial float2x2 ConvertToFloat2x2(CesiumMetadataValue value, float2x2 defaultValue);
1751 internal static partial double2x2 ConvertToDouble2x2(CesiumMetadataValue value, double2x2 defaultValue);
1752 internal static partial int3x3 ConvertToInt3x3(CesiumMetadataValue value, int3x3 defaultValue);
1753 internal static partial uint3x3 ConvertToUInt3x3(CesiumMetadataValue value, uint3x3 defaultValue);
1754 internal static partial float3x3 ConvertToFloat3x3(CesiumMetadataValue value, float3x3 defaultValue);
1755 internal static partial double3x3 ConvertToDouble3x3(CesiumMetadataValue value, double3x3 defaultValue);
1756 internal static partial int4x4 ConvertToInt4x4(CesiumMetadataValue value, int4x4 defaultValue);
1757 internal static partial uint4x4 ConvertToUInt4x4(CesiumMetadataValue value, uint4x4 defaultValue);
1758 internal static partial float4x4 ConvertToFloat4x4(CesiumMetadataValue value, float4x4 defaultValue);
1759 internal static partial double4x4 ConvertToDouble4x4(CesiumMetadataValue value, double4x4 defaultValue);
1760 internal static partial String ConvertToString(CesiumMetadataValue value, String defaultValue);
1761
1762 #endregion
1763 }
1764}
Represents a value from a property in glTF metadata.
double3x3 GetDouble3x3(double3x3 defaultValue)
Attempts to retrieve the value as a double3x3.
double GetDouble(double defaultValue=0)
Attempts to retrieve the value as a double-precision floating-point number.
SByte GetSByte(SByte defaultValue=0)
Attempts to retrieve the value as a signed 8-bit integer.
UInt32 GetUInt32(UInt32 defaultValue=0)
Attempts to retrieve the value as a unsigned 32-bit integer.
int3x3 GetInt3x3(int3x3 defaultValue)
Attempts to retrieve the value as a int3x3.
Int32 GetInt32(Int32 defaultValue=0)
Attempts to retrieve the value as a signed 32-bit integer.
Boolean GetBoolean(Boolean defaultValue=false)
Attempts to retrieve the value as a boolean.
float4x4 GetFloat4x4(float4x4 defaultValue)
Attempts to retrieve the value as a float4x4.
int4x4 GetInt4x4(int4x4 defaultValue)
Attempts to retrieve the value as a int4x4.
float3x3 GetFloat3x3(float3x3 defaultValue)
Attempts to retrieve the value as a float3x3.
uint2 GetUInt2(uint2 defaultValue)
Attempts to retrieve the value as a uint2.
bool isEmpty
Whether the value is empty, i.e., whether it does not actually represent any data.
double2x2 GetDouble2x2(double2x2 defaultValue)
Attempts to retrieve the value as a double2x2.
float2 GetFloat2(float2 defaultValue)
Attempts to retrieve the value as a float2.
int4 GetInt4(int4 defaultValue)
Attempts to retrieve the value as an int4.
double2 GetDouble2(double2 defaultValue)
Attempts to retrieve the value as a double2.
float3 GetFloat3(float3 defaultValue)
Attempts to retrieve the value as a float3.
uint2x2 GetUInt2x2(uint2x2 defaultValue)
Attempts to retrieve the value as a uint2x2.
CesiumPropertyArray GetArray()
Attempts to retrieve the value as a CesiumPropertyArray.
Int16 GetInt16(Int16 defaultValue=0)
Attempts to retrieve the value as a signed 16-bit integer.
int2x2 GetInt2x2(int2x2 defaultValue)
Attempts to retrieve the value as a int2x2.
uint3 GetUInt3(uint3 defaultValue)
Attempts to retrieve the value as an uint3.
CesiumMetadataValueType valueType
The type of the metadata value as defined in the EXT_structural_metadata extension.
UInt16 GetUInt16(UInt16 defaultValue=0)
Attempts to retrieve the value as a unsigned 16-bit integer.
UInt64 GetUInt64(UInt64 defaultValue=0)
Attempts to retrieve the value as a unsigned 64-bit integer.
double4 GetDouble4(double4 defaultValue)
Attempts to retrieve the value as a double4.
static Dictionary< String, String > GetValuesAsStrings(Dictionary< String, CesiumMetadataValue > values)
Gets the given dictionary of CesiumMetadataValues as a new dictionary of strings, mapped by name.
int3 GetInt3(int3 defaultValue)
Attempts to retrieve the value as an int3.
Int64 GetInt64(Int64 defaultValue=0)
Attempts to retrieve the value as a signed 64-bit integer.
double4x4 GetDouble4x4(double4x4 defaultValue)
Attempts to retrieve the value as a double4x4.
float2x2 GetFloat2x2(float2x2 defaultValue)
Attempts to retrieve the value as a float2x2.
uint3x3 GetUInt3x3(uint3x3 defaultValue)
Attempts to retrieve the value as a uint3x3.
double3 GetDouble3(double3 defaultValue)
Attempts to retrieve the value as a double3.
String GetString(String defaultValue="")
Attempts to retrieve the value as a String.
Byte GetByte(Byte defaultValue=0)
Attempts to retrieve the value as an unsigned 8-bit integer.
float4 GetFloat4(float4 defaultValue)
Attempts to retrieve the value as a float4.
int2 GetInt2(int2 defaultValue)
Attempts to retrieve the value as an int2.
float GetFloat(float defaultValue=0)
Attempts to retrieve the value as a single-precision floating-point number.
uint4x4 GetUInt4x4(uint4x4 defaultValue)
Attempts to retrieve the value as a uint4x4.
uint4 GetUInt4(uint4 defaultValue)
Attempts to retrieve the value as a uint4.
Represents an array value from a property in glTF metadata.
Represents the value type of a metadata value or property, akin to the property types in EXT_structur...
bool isArray
Whether or not this represents an array containing elements of the specified types.
static CesiumMetadataValueType GetValueType(System.Object inObject)