Skip to main content

SceneReader

SceneReader.

#include <scene/TellusimSceneReader.h>

Constructors

SceneReader()
explicit SceneReader(const Xml &xml)
explicit SceneReader(const Json &json)
explicit SceneReader(Stream &stream)
SceneReader(const char *name, const char *type, uint32_t format = 0)
SceneReader(Stream &stream, const char *type, uint32_t format = 0)

Methods

Stream version.

void setVersion(uint32_t version)
uint32_t getVersion() const

References.

void setReference(uint32_t id, void *reference)
void getReference(uint32_t id, void **reference)
void *getReference(const char *scope, uint32_t &id)

Next scope.

uint32_t getID(const char *scope)

Named scope.

bool push(const char *scope)
bool pop(const char *scope)

Scope depth.

uint32_t getDepth() const

String.

String readString(const char *name, const char *default_value = nullptr)

Boolean value.

bool readBool(const char *name, bool default_value = false)

Integer numbers.

int32_t readi32(const char *name, int32_t default_value = 0)
uint32_t readu32(const char *name, uint32_t default_value = 0)
uint64_t readu64(const char *name, uint64_t default_value = 0)

Floating-point numbers.

float32_t readf32(const char *name, float32_t default_value = 0.0f)
float64_t readf64(const char *name, float64_t default_value = 0.0)

Integer array.

bool readArray(const char *name, int32_t *dest, uint32_t size)
bool readArray(const char *name, uint32_t *dest, uint32_t size)

Floating-point array.

bool readArray(const char *name, float32_t *dest, uint32_t size)
bool readArray(const char *name, float64_t *dest, uint32_t size)

Raw data.

bool readData(const char *name, void *dest, size_t size)

Two-component vectors.

Vector2i readVector2i(const char *name, Vector2i default_value = Vector2i::zero)
Vector2u readVector2u(const char *name, Vector2u default_value = Vector2u::zero)
Vector2f readVector2f(const char *name, Vector2f default_value = Vector2f::zero)
Vector2d readVector2d(const char *name, Vector2d default_value = Vector2d::zero)

Three-component vectors.

Vector3i readVector3i(const char *name, Vector3i default_value = Vector3i::zero)
Vector3u readVector3u(const char *name, Vector3u default_value = Vector3u::zero)
Vector3f readVector3f(const char *name, Vector3f default_value = Vector3f::zero)
Vector3d readVector3d(const char *name, Vector3d default_value = Vector3d::zero)

Four-component vectors.

Vector4i readVector4i(const char *name, Vector4i default_value = Vector4i::zero)
Vector4u readVector4u(const char *name, Vector4u default_value = Vector4u::zero)
Vector4f readVector4f(const char *name, Vector4f default_value = Vector4f::zero)
Vector4d readVector4d(const char *name, Vector4d default_value = Vector4d::zero)

Two-by-three matrices.

Matrix3x2f readMatrix3x2f(const char *name)
Matrix3x2d readMatrix3x2d(const char *name)

Three-by-four matrices.

Matrix4x3f readMatrix4x3f(const char *name)
Matrix4x3d readMatrix4x3d(const char *name)

Four-by-four matrices.

Matrix4x4f readMatrix4x4f(const char *name)
Matrix4x4d readMatrix4x4d(const char *name)

Quaternion.

Quaternionf readQuaternionf(const char *name)
Quaterniond readQuaterniond(const char *name)

Bound box.

BoundBoxf readBoundBoxf(const char *name)
BoundBoxd readBoundBoxd(const char *name)

Color.

Color readColor(const char *name, Color default_color = Color::white)