cesium-native  0.41.0
PropertyTablePropertyView.h
1 #pragma once
2 
3 #include "CesiumGltf/PropertyArrayView.h"
4 #include "CesiumGltf/PropertyTransformations.h"
5 #include "CesiumGltf/PropertyTypeTraits.h"
6 #include "CesiumGltf/PropertyView.h"
7 
8 #include <CesiumUtility/Assert.h>
9 
10 #include <gsl/span>
11 
12 #include <cstddef>
13 #include <cstdint>
14 #include <string_view>
15 #include <type_traits>
16 
17 namespace CesiumGltf {
28 public:
33  static const PropertyViewStatusType ErrorInvalidPropertyTable = 14;
34 
38  static const PropertyViewStatusType ErrorInvalidValueBufferView = 15;
39 
44  static const PropertyViewStatusType ErrorInvalidArrayOffsetBufferView = 16;
45 
50  static const PropertyViewStatusType ErrorInvalidStringOffsetBufferView = 17;
51 
56  static const PropertyViewStatusType ErrorInvalidValueBuffer = 18;
57 
62  static const PropertyViewStatusType ErrorInvalidArrayOffsetBuffer = 19;
63 
68  static const PropertyViewStatusType ErrorInvalidStringOffsetBuffer = 20;
69 
74  static const PropertyViewStatusType ErrorBufferViewOutOfBounds = 21;
75 
80  static const PropertyViewStatusType
82 
87  static const PropertyViewStatusType
89 
94  static const PropertyViewStatusType ErrorArrayCountAndOffsetBufferCoexist =
95  24;
96 
101  static const PropertyViewStatusType ErrorArrayCountAndOffsetBufferDontExist =
102  25;
103 
107  static const PropertyViewStatusType ErrorInvalidArrayOffsetType = 26;
108 
112  static const PropertyViewStatusType ErrorInvalidStringOffsetType = 27;
113 
118  static const PropertyViewStatusType ErrorArrayOffsetsNotSorted = 28;
119 
124  static const PropertyViewStatusType ErrorStringOffsetsNotSorted = 29;
125 
129  static const PropertyViewStatusType ErrorArrayOffsetOutOfBounds = 30;
130 
134  static const PropertyViewStatusType ErrorStringOffsetOutOfBounds = 31;
135 };
136 
137 int64_t getOffsetTypeSize(PropertyComponentType offsetType) noexcept;
138 
143 template <typename ElementType, bool Normalized = false>
145 
160 template <typename ElementType>
161 class PropertyTablePropertyView<ElementType, false>
162  : public PropertyView<ElementType, false> {
163 public:
168  : PropertyView<ElementType, false>(),
169  _values{},
170  _size{0},
171  _arrayOffsets{},
172  _arrayOffsetType{PropertyComponentType::None},
173  _arrayOffsetTypeSize{0},
174  _stringOffsets{},
175  _stringOffsetType{PropertyComponentType::None},
176  _stringOffsetTypeSize{0} {}
177 
183  PropertyTablePropertyView(PropertyViewStatusType status)
184  : PropertyView<ElementType, false>(status),
185  _values{},
186  _size{0},
187  _arrayOffsets{},
188  _arrayOffsetType{PropertyComponentType::None},
189  _arrayOffsetTypeSize{0},
190  _stringOffsets{},
191  _stringOffsetType{PropertyComponentType::None},
192  _stringOffsetTypeSize{0} {
193  CESIUM_ASSERT(
194  this->_status != PropertyTablePropertyViewStatus::Valid &&
195  "An empty property view should not be constructed with a valid status");
196  }
197 
207  PropertyTablePropertyView(const ClassProperty& classProperty, int64_t size)
208  : PropertyView<ElementType, false>(classProperty),
209  _values{},
210  _size{0},
211  _arrayOffsets{},
212  _arrayOffsetType{PropertyComponentType::None},
213  _arrayOffsetTypeSize{0},
214  _stringOffsets{},
215  _stringOffsetType{PropertyComponentType::None},
216  _stringOffsetTypeSize{0} {
217  if (this->_status != PropertyTablePropertyViewStatus::Valid) {
218  // Don't override the status / size if something is wrong with the class
219  // property's definition.
220  return;
221  }
222 
223  if (!classProperty.defaultProperty) {
224  // This constructor should only be called if the class property *has* a
225  // default value. But in the case that it does not, this property view
226  // becomes invalid.
228  return;
229  }
230 
232  this->_size = size;
233  }
234 
245  const PropertyTableProperty& property,
246  const ClassProperty& classProperty,
247  int64_t size,
248  gsl::span<const std::byte> values) noexcept
249  : PropertyView<ElementType>(classProperty, property),
250  _values{values},
251  _size{
252  this->_status == PropertyTablePropertyViewStatus::Valid ? size : 0},
253  _arrayOffsets{},
254  _arrayOffsetType{PropertyComponentType::None},
255  _arrayOffsetTypeSize{0},
256  _stringOffsets{},
257  _stringOffsetType{PropertyComponentType::None},
258  _stringOffsetTypeSize{0} {}
259 
273  const PropertyTableProperty& property,
274  const ClassProperty& classProperty,
275  int64_t size,
276  gsl::span<const std::byte> values,
277  gsl::span<const std::byte> arrayOffsets,
278  gsl::span<const std::byte> stringOffsets,
279  PropertyComponentType arrayOffsetType,
280  PropertyComponentType stringOffsetType) noexcept
281  : PropertyView<ElementType>(classProperty, property),
282  _values{values},
283  _size{
284  this->_status == PropertyTablePropertyViewStatus::Valid ? size : 0},
285  _arrayOffsets{arrayOffsets},
286  _arrayOffsetType{arrayOffsetType},
287  _arrayOffsetTypeSize{getOffsetTypeSize(arrayOffsetType)},
288  _stringOffsets{stringOffsets},
289  _stringOffsetType{stringOffsetType},
290  _stringOffsetTypeSize{getOffsetTypeSize(stringOffsetType)} {}
291 
307  std::optional<PropertyValueViewToCopy<ElementType>>
308  get(int64_t index) const noexcept {
309  if (this->_status ==
311  CESIUM_ASSERT(index >= 0 && "index must be non-negative");
312  CESIUM_ASSERT(index < size() && "index must be less than size");
313 
314  return propertyValueViewToCopy(this->defaultValue());
315  }
316 
317  ElementType value = getRaw(index);
318 
319  if (value == this->noData()) {
320  return propertyValueViewToCopy(this->defaultValue());
321  } else if constexpr (IsMetadataNumeric<ElementType>::value) {
322  return transformValue(value, this->offset(), this->scale());
323  } else if constexpr (IsMetadataNumericArray<ElementType>::value) {
324  return transformArray(value, this->offset(), this->scale());
325  } else {
326  return value;
327  }
328  }
329 
340  ElementType getRaw(int64_t index) const noexcept {
341  CESIUM_ASSERT(
342  this->_status == PropertyTablePropertyViewStatus::Valid &&
343  "Check the status() first to make sure view is valid");
344  CESIUM_ASSERT(
345  size() > 0 &&
346  "Check the size() of the view to make sure it's not empty");
347  CESIUM_ASSERT(index >= 0 && "index must be non-negative");
348  CESIUM_ASSERT(index < size() && "index must be less than size");
349 
351  return getNumericValue(index);
352  }
353 
355  return getBooleanValue(index);
356  }
357 
358  if constexpr (IsMetadataString<ElementType>::value) {
359  return getStringValue(index);
360  }
361 
363  return getNumericArrayValues<
364  typename MetadataArrayType<ElementType>::type>(index);
365  }
366 
368  return getBooleanArrayValues(index);
369  }
370 
372  return getStringArrayValues(index);
373  }
374  }
375 
383  int64_t size() const noexcept { return _size; }
384 
385 private:
386  ElementType getNumericValue(int64_t index) const noexcept {
387  return reinterpret_cast<const ElementType*>(_values.data())[index];
388  }
389 
390  bool getBooleanValue(int64_t index) const noexcept {
391  const int64_t byteIndex = index / 8;
392  const int64_t bitIndex = index % 8;
393  const int bitValue = static_cast<int>(_values[byteIndex] >> bitIndex) & 1;
394  return bitValue == 1;
395  }
396 
397  std::string_view getStringValue(int64_t index) const noexcept {
398  const size_t currentOffset =
399  getOffsetFromOffsetsBuffer(index, _stringOffsets, _stringOffsetType);
400  const size_t nextOffset = getOffsetFromOffsetsBuffer(
401  index + 1,
402  _stringOffsets,
403  _stringOffsetType);
404  return std::string_view(
405  reinterpret_cast<const char*>(_values.data() + currentOffset),
406  nextOffset - currentOffset);
407  }
408 
409  template <typename T>
410  PropertyArrayView<T> getNumericArrayValues(int64_t index) const noexcept {
411  size_t count = static_cast<size_t>(this->arrayCount());
412  // Handle fixed-length arrays
413  if (count > 0) {
414  size_t arraySize = count * sizeof(T);
415  const gsl::span<const std::byte> values(
416  _values.data() + index * arraySize,
417  arraySize);
418  return PropertyArrayView<T>{values};
419  }
420 
421  // Handle variable-length arrays. The offsets are interpreted as array
422  // indices, not byte offsets, so they must be multiplied by sizeof(T)
423  const size_t currentOffset =
424  getOffsetFromOffsetsBuffer(index, _arrayOffsets, _arrayOffsetType) *
425  sizeof(T);
426  const size_t nextOffset =
427  getOffsetFromOffsetsBuffer(index + 1, _arrayOffsets, _arrayOffsetType) *
428  sizeof(T);
429  const gsl::span<const std::byte> values(
430  _values.data() + currentOffset,
431  nextOffset - currentOffset);
432  return PropertyArrayView<T>{values};
433  }
434 
435  PropertyArrayView<std::string_view>
436  getStringArrayValues(int64_t index) const noexcept {
437  size_t count = static_cast<size_t>(this->arrayCount());
438  // Handle fixed-length arrays
439  if (count > 0) {
440  // Copy the corresponding string offsets to pass to the PropertyArrayView.
441  const size_t arraySize = count * _stringOffsetTypeSize;
442  const gsl::span<const std::byte> stringOffsetValues(
443  _stringOffsets.data() + index * arraySize,
444  arraySize + _stringOffsetTypeSize);
445  return PropertyArrayView<std::string_view>(
446  _values,
447  stringOffsetValues,
448  _stringOffsetType,
449  count);
450  }
451 
452  // Handle variable-length arrays
453  const size_t currentArrayOffset =
454  getOffsetFromOffsetsBuffer(index, _arrayOffsets, _arrayOffsetType);
455  const size_t nextArrayOffset =
456  getOffsetFromOffsetsBuffer(index + 1, _arrayOffsets, _arrayOffsetType);
457  const size_t arraySize = nextArrayOffset - currentArrayOffset;
458  const gsl::span<const std::byte> stringOffsetValues(
459  _stringOffsets.data() + currentArrayOffset,
460  arraySize + _arrayOffsetTypeSize);
461  return PropertyArrayView<std::string_view>(
462  _values,
463  stringOffsetValues,
464  _stringOffsetType,
465  arraySize / _arrayOffsetTypeSize);
466  }
467 
468  PropertyArrayView<bool> getBooleanArrayValues(int64_t index) const noexcept {
469  size_t count = static_cast<size_t>(this->arrayCount());
470  // Handle fixed-length arrays
471  if (count > 0) {
472  const size_t offsetBits = count * index;
473  const size_t nextOffsetBits = count * (index + 1);
474  const gsl::span<const std::byte> buffer(
475  _values.data() + offsetBits / 8,
476  (nextOffsetBits / 8 - offsetBits / 8 + 1));
477  return PropertyArrayView<bool>(buffer, offsetBits % 8, count);
478  }
479 
480  // Handle variable-length arrays
481  const size_t currentOffset =
482  getOffsetFromOffsetsBuffer(index, _arrayOffsets, _arrayOffsetType);
483  const size_t nextOffset =
484  getOffsetFromOffsetsBuffer(index + 1, _arrayOffsets, _arrayOffsetType);
485  const size_t totalBits = nextOffset - currentOffset;
486  const gsl::span<const std::byte> buffer(
487  _values.data() + currentOffset / 8,
488  (nextOffset / 8 - currentOffset / 8 + 1));
489  return PropertyArrayView<bool>(buffer, currentOffset % 8, totalBits);
490  }
491 
492  gsl::span<const std::byte> _values;
493  int64_t _size;
494 
495  gsl::span<const std::byte> _arrayOffsets;
496  PropertyComponentType _arrayOffsetType;
497  int64_t _arrayOffsetTypeSize;
498 
499  gsl::span<const std::byte> _stringOffsets;
500  PropertyComponentType _stringOffsetType;
501  int64_t _stringOffsetTypeSize;
502 };
503 
518 template <typename ElementType>
519 class PropertyTablePropertyView<ElementType, true>
520  : public PropertyView<ElementType, true> {
521 private:
522  using NormalizedType = typename TypeToNormalizedType<ElementType>::type;
523 
524 public:
529  : PropertyView<ElementType, true>(),
530  _values{},
531  _size{0},
532  _arrayOffsets{},
533  _arrayOffsetType{PropertyComponentType::None},
534  _arrayOffsetTypeSize{0} {}
535 
541  PropertyTablePropertyView(PropertyViewStatusType status)
542  : PropertyView<ElementType, true>(status),
543  _values{},
544  _size{0},
545  _arrayOffsets{},
546  _arrayOffsetType{PropertyComponentType::None},
547  _arrayOffsetTypeSize{0} {
548  CESIUM_ASSERT(
549  this->_status != PropertyTablePropertyViewStatus::Valid &&
550  "An empty property view should not be constructed with a valid status");
551  }
552 
562  PropertyTablePropertyView(const ClassProperty& classProperty, int64_t size)
563  : PropertyView<ElementType, true>(classProperty),
564  _values{},
565  _size{0},
566  _arrayOffsets{},
567  _arrayOffsetType{PropertyComponentType::None},
568  _arrayOffsetTypeSize{0} {
569  if (this->_status != PropertyTablePropertyViewStatus::Valid) {
570  // Don't override the status / size if something is wrong with the class
571  // property's definition.
572  return;
573  }
574 
575  if (!classProperty.defaultProperty) {
576  // This constructor should only be called if the class property *has* a
577  // default value. But in the case that it does not, this property view
578  // becomes invalid.
580  return;
581  }
582 
584  this->_size = size;
585  }
586 
597  const PropertyTableProperty& property,
598  const ClassProperty& classProperty,
599  int64_t size,
600  gsl::span<const std::byte> values) noexcept
601  : PropertyView<ElementType, true>(classProperty, property),
602  _values{values},
603  _size{
604  this->_status == PropertyTablePropertyViewStatus::Valid ? size : 0},
605  _arrayOffsets{},
606  _arrayOffsetType{PropertyComponentType::None},
607  _arrayOffsetTypeSize{0} {}
608 
621  const PropertyTableProperty& property,
622  const ClassProperty& classProperty,
623  int64_t size,
624  gsl::span<const std::byte> values,
625  gsl::span<const std::byte> arrayOffsets,
626  PropertyComponentType arrayOffsetType) noexcept
627  : PropertyView<ElementType, true>(classProperty, property),
628  _values{values},
629  _size{
630  this->_status == PropertyTablePropertyViewStatus::Valid ? size : 0},
631  _arrayOffsets{arrayOffsets},
632  _arrayOffsetType{arrayOffsetType},
633  _arrayOffsetTypeSize{getOffsetTypeSize(arrayOffsetType)} {}
634 
650  std::optional<PropertyValueViewToCopy<NormalizedType>>
651  get(int64_t index) const noexcept {
652  if (this->_status ==
654  CESIUM_ASSERT(index >= 0 && "index must be non-negative");
655  CESIUM_ASSERT(index < size() && "index must be less than size");
656 
657  return propertyValueViewToCopy(this->defaultValue());
658  }
659 
660  ElementType value = getRaw(index);
661  if (this->noData() && value == *(this->noData())) {
662  return propertyValueViewToCopy(this->defaultValue());
663  } else if constexpr (IsMetadataScalar<ElementType>::value) {
664  return transformValue<NormalizedType>(
665  normalize<ElementType>(value),
666  this->offset(),
667  this->scale());
668  } else if constexpr (IsMetadataVecN<ElementType>::value) {
669  constexpr glm::length_t N = ElementType::length();
670  using T = typename ElementType::value_type;
671  using NormalizedT = typename NormalizedType::value_type;
672  return transformValue<glm::vec<N, NormalizedT>>(
673  normalize<N, T>(value),
674  this->offset(),
675  this->scale());
676  } else if constexpr (IsMetadataMatN<ElementType>::value) {
677  constexpr glm::length_t N = ElementType::length();
678  using T = typename ElementType::value_type;
679  using NormalizedT = typename NormalizedType::value_type;
680  return transformValue<glm::mat<N, N, NormalizedT>>(
681  normalize<N, T>(value),
682  this->offset(),
683  this->scale());
684  } else if constexpr (IsMetadataArray<ElementType>::value) {
685  using ArrayElementType = typename MetadataArrayType<ElementType>::type;
687  return transformNormalizedArray<ArrayElementType>(
688  value,
689  this->offset(),
690  this->scale());
691  } else if constexpr (IsMetadataVecN<ArrayElementType>::value) {
692  constexpr glm::length_t N = ArrayElementType::length();
693  using T = typename ArrayElementType::value_type;
694  return transformNormalizedVecNArray<N, T>(
695  value,
696  this->offset(),
697  this->scale());
698  } else if constexpr (IsMetadataMatN<ArrayElementType>::value) {
699  constexpr glm::length_t N = ArrayElementType::length();
700  using T = typename ArrayElementType::value_type;
701  return transformNormalizedMatNArray<N, T>(
702  value,
703  this->offset(),
704  this->scale());
705  }
706  }
707  }
708 
719  ElementType getRaw(int64_t index) const noexcept {
720  CESIUM_ASSERT(
721  this->_status == PropertyTablePropertyViewStatus::Valid &&
722  "Check the status() first to make sure view is valid");
723  CESIUM_ASSERT(
724  size() > 0 &&
725  "Check the size() of the view to make sure it's not empty");
726  CESIUM_ASSERT(index >= 0 && "index must be non-negative");
727  CESIUM_ASSERT(index < size() && "index must be less than size");
728 
730  return getValue(index);
731  }
732 
734  return getArrayValues<typename MetadataArrayType<ElementType>::type>(
735  index);
736  }
737  }
738 
746  int64_t size() const noexcept {
747  return this->_status == PropertyTablePropertyViewStatus::Valid ? _size : 0;
748  }
749 
750 private:
751  ElementType getValue(int64_t index) const noexcept {
752  return reinterpret_cast<const ElementType*>(_values.data())[index];
753  }
754 
755  template <typename T>
756  PropertyArrayView<T> getArrayValues(int64_t index) const noexcept {
757  size_t count = static_cast<size_t>(this->arrayCount());
758  // Handle fixed-length arrays
759  if (count > 0) {
760  size_t arraySize = count * sizeof(T);
761  const gsl::span<const std::byte> values(
762  _values.data() + index * arraySize,
763  arraySize);
764  return PropertyArrayView<T>{values};
765  }
766 
767  // Handle variable-length arrays. The offsets are interpreted as array
768  // indices, not byte offsets, so they must be multiplied by sizeof(T)
769  const size_t currentOffset =
770  getOffsetFromOffsetsBuffer(index, _arrayOffsets, _arrayOffsetType) *
771  sizeof(T);
772  const size_t nextOffset =
773  getOffsetFromOffsetsBuffer(index + 1, _arrayOffsets, _arrayOffsetType) *
774  sizeof(T);
775  const gsl::span<const std::byte> values(
776  _values.data() + currentOffset,
777  nextOffset - currentOffset);
778  return PropertyArrayView<T>{values};
779  }
780 
781  gsl::span<const std::byte> _values;
782  int64_t _size;
783 
784  gsl::span<const std::byte> _arrayOffsets;
785  PropertyComponentType _arrayOffsetType;
786  int64_t _arrayOffsetTypeSize;
787 };
788 
789 } // namespace CesiumGltf
Indicates the status of a property table property view.
static const PropertyViewStatusType ErrorBufferViewSizeDoesNotMatchPropertyTableCount
This property view has an invalid buffer view; its length does not match the size of the property tab...
static const PropertyViewStatusType ErrorInvalidArrayOffsetBufferView
This array property view does not have a valid array offset buffer view index.
static const PropertyViewStatusType ErrorBufferViewOutOfBounds
This property view has a buffer view that points outside the bounds of its target buffer.
static const PropertyViewStatusType ErrorArrayCountAndOffsetBufferCoexist
This array property view has both a fixed length and an offset buffer view defined.
static const PropertyViewStatusType ErrorInvalidValueBufferView
This property view does not have a valid value buffer view index.
static const PropertyViewStatusType ErrorInvalidStringOffsetBuffer
This property view has a valid string offset buffer view, but the buffer view specifies an invalid bu...
static const PropertyViewStatusType ErrorInvalidStringOffsetType
This property view has an unknown string offset type.
static const PropertyViewStatusType ErrorArrayCountAndOffsetBufferDontExist
This array property view has neither a fixed length nor an offset buffer view defined.
static const PropertyViewStatusType ErrorArrayOffsetsNotSorted
This property view's array offset values are not sorted in ascending order.
static const PropertyViewStatusType ErrorInvalidArrayOffsetBuffer
This property view has a valid array string buffer view, but the buffer view specifies an invalid buf...
static const PropertyViewStatusType ErrorArrayOffsetOutOfBounds
This property view has an array offset that is out of bounds.
static const PropertyViewStatusType ErrorInvalidPropertyTable
This property view was initialized from an invalid PropertyTable.
static const PropertyViewStatusType ErrorInvalidValueBuffer
This property view has a valid value buffer view, but the buffer view specifies an invalid buffer ind...
static const PropertyViewStatusType ErrorInvalidStringOffsetBufferView
This string property view does not have a valid string offset buffer view index.
static const PropertyViewStatusType ErrorInvalidArrayOffsetType
This property view has an unknown array offset type.
static const PropertyViewStatusType ErrorStringOffsetsNotSorted
This property view's string offset values are not sorted in ascending order.
static const PropertyViewStatusType ErrorStringOffsetOutOfBounds
This property view has a string offset that is out of bounds.
static const PropertyViewStatusType ErrorBufferViewSizeNotDivisibleByTypeSize
This property view has an invalid buffer view; its length is not a multiple of the size of its type /...
PropertyTablePropertyView(const ClassProperty &classProperty, int64_t size)
Constructs an instance of an empty property that specifies a default value. Although this property ha...
PropertyTablePropertyView()
Constructs an invalid instance for a non-existent property.
PropertyTablePropertyView(const PropertyTableProperty &property, const ClassProperty &classProperty, int64_t size, gsl::span< const std::byte > values) noexcept
Construct an instance pointing to data specified by a PropertyTableProperty. Used for non-array or fi...
ElementType getRaw(int64_t index) const noexcept
Get the raw value of an element of the PropertyTable, without offset or scale applied.
PropertyTablePropertyView(PropertyViewStatusType status)
Constructs an invalid instance for an erroneous property.
int64_t size() const noexcept
Get the number of elements in this PropertyTablePropertyView. If the view is valid,...
PropertyTablePropertyView(const PropertyTableProperty &property, const ClassProperty &classProperty, int64_t size, gsl::span< const std::byte > values, gsl::span< const std::byte > arrayOffsets, gsl::span< const std::byte > stringOffsets, PropertyComponentType arrayOffsetType, PropertyComponentType stringOffsetType) noexcept
Construct an instance pointing to the data specified by a PropertyTableProperty.
std::optional< PropertyValueViewToCopy< ElementType > > get(int64_t index) const noexcept
Get the value of an element in the PropertyTable, with all value transforms applied....
PropertyTablePropertyView()
Constructs an invalid instance for a non-existent property.
ElementType getRaw(int64_t index) const noexcept
Get the raw value of an element of the PropertyTable, without offset, scale, or normalization applied...
std::optional< PropertyValueViewToCopy< NormalizedType > > get(int64_t index) const noexcept
Get the value of an element of the PropertyTable, with normalization and other value transforms appli...
PropertyTablePropertyView(const PropertyTableProperty &property, const ClassProperty &classProperty, int64_t size, gsl::span< const std::byte > values) noexcept
Construct an instance pointing to data specified by a PropertyTableProperty. Used for non-array or fi...
PropertyTablePropertyView(const PropertyTableProperty &property, const ClassProperty &classProperty, int64_t size, gsl::span< const std::byte > values, gsl::span< const std::byte > arrayOffsets, PropertyComponentType arrayOffsetType) noexcept
Construct an instance pointing to the data specified by a PropertyTableProperty.
PropertyTablePropertyView(PropertyViewStatusType status)
Constructs an invalid instance for an erroneous property.
int64_t size() const noexcept
Get the number of elements in this PropertyTablePropertyView. If the view is valid,...
PropertyTablePropertyView(const ClassProperty &classProperty, int64_t size)
Constructs an instance of an empty property that specifies a default value. Although this property ha...
A view on the data of the PropertyTableProperty that is created by a PropertyTableView.
Indicates the status of a property view.
Definition: PropertyView.h:27
static const PropertyViewStatusType Valid
This property view is valid and ready to use.
Definition: PropertyView.h:32
static const PropertyViewStatusType ErrorNonexistentProperty
This property view is trying to view a property that does not exist.
Definition: PropertyView.h:47
static const PropertyViewStatusType EmptyPropertyWithDefault
This property view does not contain any data, but specifies a default value. This happens when a clas...
Definition: PropertyView.h:41
Represents a normalized metadata property in EXT_structural_metadata.
Definition: PropertyView.h:647
Represents a metadata property in EXT_structural_metadata.
Definition: PropertyView.h:251
Classes for working with glTF models.
A class property.
Definition: ClassProperty.h:19
std::optional< CesiumUtility::JsonValue > defaultProperty
A default value to use when encountering a noData value or an omitted property. The value is given in...
Check if a C++ type can be represented as an array.
Check if a C++ type can be represented as an array of booleans property type.
Check if a C++ type can be represented as a boolean property type.
Check if a C++ type can be represented as a matN type.
Check if a C++ type can be represented as an array of numeric elements property type.
Check if a C++ type can be represented as a numeric property, i.e. a scalar / vecN / matN type.
Check if a C++ type can be represented as a scalar property type.
Check if a C++ type can be represented as an array of strings property type.
Check if a C++ type can be represented as a string property type.
Check if a C++ type can be represented as a vecN type.
An array of binary property values.
Convert an integer numeric type to the corresponding representation as a double type....