This class is not meant to be instantiated directly. Use Accessor
instead.
More...
#include <CesiumGltf/Accessor.h>
|
int8_t | computeNumberOfComponents () const noexcept |
| Computes the number of components for this accessor.
|
|
int8_t | computeByteSizeOfComponent () const noexcept |
| Computes the number of bytes for this accessor's component type.
|
|
int64_t | computeBytesPerVertex () const noexcept |
| Computes the total number of bytes for this accessor in each vertex.
|
|
int64_t | computeByteStride (const CesiumGltf::Model &model) const noexcept |
| Computes this accessor's stride.
|
|
int64_t | getSizeBytes () const |
| Calculates the size in bytes of this object, including the contents of all collections, pointers, and strings. This will NOT include the size of any extensions attached to the object. Calling this method may be slow as it requires traversing the object's entire structure.
|
|
int64_t | getSizeBytes () const |
| Calculates the size in bytes of this object, including the contents of all collections, pointers, and strings. Calling this method may be slow as it requires traversing the object's entire structure.
|
|
template<typename T > |
bool | hasExtension () const noexcept |
| Checks if an extension exists given its static type.
|
|
template<typename T > |
const T * | getExtension () const noexcept |
| Gets an extension given its static type.
|
|
template<typename T > |
T * | getExtension () noexcept |
| Gets an extension given its static type.
|
|
const JsonValue * | getGenericExtension (const std::string &extensionName) const noexcept |
| Gets a generic extension with the given name as a CesiumUtility::JsonValue .
|
|
JsonValue * | getGenericExtension (const std::string &extensionName) noexcept |
| Gets a generic extension with the given name as a CesiumUtility::JsonValue .
|
|
template<typename T , typename... ConstructorArgumentTypes> |
T & | addExtension (ConstructorArgumentTypes &&... constructorArguments) |
| Adds a statically-typed extension to this object.
|
|
template<typename T > |
void | removeExtension () |
| Removes a statically-typed extension from this object.
|
|
int64_t | getSizeBytes () const |
| Calculates the size in bytes of this ExtensibleObject, including all of its extras but NOT including its extensions. Calling this method may be slow as it requires traversing the entire object.
|
|
|
int32_t | bufferView = -1 |
| The index of the bufferView.
|
|
int64_t | byteOffset = 0 |
| The offset relative to the start of the buffer view in bytes.
|
|
int32_t | componentType = ComponentType::BYTE |
| The datatype of the accessor's components.
|
|
bool | normalized = false |
| Specifies whether integer data values are normalized before usage.
|
|
int64_t | count = int64_t() |
| The number of elements referenced by this accessor.
|
|
std::string | type = Type::SCALAR |
| Specifies if the accessor's elements are scalars, vectors, or matrices.
|
|
std::vector< double > | max |
| Maximum value of each component in this accessor.
|
|
std::vector< double > | min |
| Minimum value of each component in this accessor.
|
|
std::optional< CesiumGltf::AccessorSparse > | sparse |
| Sparse storage of elements that deviate from their initialization value.
|
|
std::string | name |
| The user-defined name of this object.
|
|
std::unordered_map< std::string, std::any > | extensions |
| The extensions attached to this object.
|
|
JsonValue::Object | extras |
| Application-specific data.
|
|
JsonValue::Object | unknownProperties |
| Unknown properties that exist on this object but do not have any representation in the statically-typed classes.
|
|
static constexpr const char * | TypeName = "Accessor" |
| The original name of this type.
|
|
| AccessorSpec ()=default |
| This class is not meant to be instantiated directly. Use Accessor instead.
|
|
This class is not meant to be instantiated directly. Use Accessor
instead.
Definition at line 12 of file Accessor.h.
◆ computeByteSizeOfComponent() [1/2]
int8_t CesiumGltf::Accessor::computeByteSizeOfComponent |
( |
| ) |
const |
|
noexcept |
Computes the number of bytes for this accessor's component type.
For example if this accessor's Accessor::componentType
is CesiumGltf::Accessor::ComponentType::UNSIGNED_SHORT
, then the component type is 2 bytes, while if it's CesiumGltf::Accessor::ComponentType::FLOAT
then it is 4 bytes.
- Returns
- The number of bytes for this accessor's component type. Returns 0 if this accessor's
Accessor::componentType
does not have a valid enumeration value.
◆ computeByteSizeOfComponent() [2/2]
static int8_t CesiumGltf::Accessor::computeByteSizeOfComponent |
( |
int32_t | componentType | ) |
|
|
staticnoexcept |
Computes the number of bytes for a given accessor component type.
For example CesiumGltf::Accessor::ComponentType::UNSIGNED_SHORT
is 2 bytes while CesiumGltf::Accessor::ComponentType::FLOAT
is 4 bytes.
- Parameters
-
componentType | The accessor component type. |
- Returns
- The number of bytes for the component type. Returns 0 if
Accessor::componentType
is not a valid enumeration value.
◆ computeBytesPerVertex()
int64_t CesiumGltf::Accessor::computeBytesPerVertex |
( |
| ) |
const |
|
noexcept |
◆ computeByteStride()
int64_t CesiumGltf::Accessor::computeByteStride |
( |
const CesiumGltf::Model & | model | ) |
const |
|
noexcept |
Computes this accessor's stride.
The stride is the number of bytes between the same elements of successive vertices. The returned value will be at least as large as Accessor::computeBytesPerVertex
, but maybe be larger if this accessor's data is interleaved with other accessors.
The behavior is undefined if this accessor is not part of the given model.
- Parameters
-
model | The model that this accessor is a part of. |
- Returns
- The stride in bytes. Returns 0 if this accessor's
Accessor::type
or Accessor::componentType
does not have a valid enumeration value, or if Accessor::bufferView
does not refer to a valid BufferView
.
◆ computeNumberOfComponents() [1/2]
int8_t CesiumGltf::Accessor::computeNumberOfComponents |
( |
| ) |
const |
|
noexcept |
Computes the number of components for this accessor.
For example if this accessor's Accessor::type
is CesiumGltf::Accessor::Type::SCALAR
, then it has 1 component, while if it's CesiumGltf::Accessor::Type::VEC4
it has 4 components.
- Returns
- The number of components in this accessor. Returns 0 if this accessor's
Accessor::type
does not have a valid enumeration value.
◆ computeNumberOfComponents() [2/2]
static int8_t CesiumGltf::Accessor::computeNumberOfComponents |
( |
const std::string & | type | ) |
|
|
staticnoexcept |
Computes the number of components for a given accessor type.
For example CesiumGltf::Accessor::Type::SCALAR
has 1 component while CesiumGltf::Accessor::Type::VEC4
has 4 components.
- Parameters
-
- Returns
- The number of components. Returns 0 if
Accessor::type
is not a valid enumeration value.
The documentation for this struct was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumGltf/include/CesiumGltf/Accessor.h