Cesium for Unity 1.15.2
Loading...
Searching...
No Matches
CesiumPropertyTable.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5namespace CesiumForUnity
6{
28
35 {
41 {
42 get; internal set;
43 }
44
49 public string name
50 {
51 get; internal set;
52 }
53
58 public Int64 count
59 {
60 get; internal set;
61 }
62
66 public Dictionary<String, CesiumPropertyTableProperty> properties
67 {
68 get; internal set;
69 }
70
71 internal CesiumPropertyTable()
72 {
73 this.status = CesiumPropertyTableStatus.ErrorInvalidPropertyTable;
74 this.count = 0;
75 }
76
86 public Dictionary<String, CesiumMetadataValue> GetMetadataValuesForFeature(Int64 featureId)
87 {
88 Dictionary<String, CesiumMetadataValue> result = new Dictionary<String, CesiumMetadataValue>();
89 GetMetadataValuesForFeature(result, featureId);
90 return result;
91 }
92
108 public void GetMetadataValuesForFeature(Dictionary<String, CesiumMetadataValue> values, Int64 featureId)
109 {
110 values.Clear();
111
112 foreach (KeyValuePair<String, CesiumPropertyTableProperty> property in this.properties)
113 {
114 values.Add(property.Key, property.Value.GetValue(featureId));
115 }
116 }
117
118 internal void DisposeProperties()
119 {
120 foreach (KeyValuePair<String, CesiumPropertyTableProperty> property in this.properties)
121 {
122 property.Value.Dispose();
123 }
124 }
125 }
126}
Represents a glTF property table in the EXT_structural_metadata extension.
Dictionary< String, CesiumPropertyTableProperty > properties
The properties of the property table, mapped by property id.
void GetMetadataValuesForFeature(Dictionary< String, CesiumMetadataValue > values, Int64 featureId)
Gets all of the property values for a given feature, mapped by property name.
string name
The name of the property table.
Int64 count
The number of values each property in the table is expected to have.
Dictionary< String, CesiumMetadataValue > GetMetadataValuesForFeature(Int64 featureId)
Gets all of the property values for a given feature, mapped by property name.
CesiumPropertyTableStatus status
The status of the property table.
@ Valid
The feature ID attribute is valid.
CesiumPropertyTableStatus
Reports the status of a CesiumPropertyTable.
@ ErrorInvalidPropertyTable
The property table instance was not initialized from an actual glTF property table.
@ ErrorInvalidPropertyTableClass
The property table's class could be found in the schema of the metadata extension.