Workspace 6.21.5
|
Helper class for writing SceneItem data to the Workspace Hdf5 format. More...
#include <HDF5/hdf5sceneserializer.h>
Public Types | |
typedef Mesh::MeshModelInterface::int_type | int_type |
using | MeshSourceMap = QMap< QString, Mesh::MeshModelSource * > |
typedef QList< Rendering::SceneItem * > | SceneItemList |
typedef Mesh::MeshModelInterface::size_type | size_type |
typedef QMap< QString, const DataExecution::DataFactory * > | StateTypeMap |
Public Member Functions | |
Hdf5SceneSerializer (hid_t &file) | |
bool | readTransformHierarchy (Rendering::Transform &transform, SceneItemList &newSceneItems, MeshSourceMap &meshSources, Rendering::Shader &shader, const QString &subtreePath=QString(), const QString &modelIdPrefix=QString()) const |
bool | readVersion (size_type &version) const |
bool | writeMeshInstance (const QString &meshId, const QString &instanceId, const QString &transformPath=QString()) |
bool | writeTransform (const QString &transformId, const Mesh::TransformMatrix &matrix, const QString &transformPath=QString()) |
bool | writeVersion () |
Public Member Functions inherited from BasicTextLogger | |
BasicTextLogger () | |
virtual | ~BasicTextLogger () |
void | logLine (const Application::LogManager::MessageCategory &category, const QString &msg) const |
void | logLine (const QString &msg) const |
void | logText (const Application::LogManager::MessageCategory &category, const QString &msg) const |
void | logText (const QString &msg) const |
Static Public Attributes | |
static const hid_t | LONG_STRING_DATATYPE = H5Tcopy(H5T_C_S1) |
static const int | LONG_STRING_DATATYPE_LENGTH = 255 |
static const size_t | MAX_NAME_LENGTH = 1024 |
The format is capable of storing an entire scene hierarchy, each MeshModelInstance referencing a mesh (each with potentially multiple LODs) in the same file.
Workspace Hdf5 Scene v1 Format (stored in HDF5)
g: root/ a: format_version (int) g: meshes/ (see Hdf5MeshSerializer) ... g: instances/ g: transform_id g: instance_id a: referenced_mesh_id (long string)
using MeshSourceMap = QMap<QString, Mesh::MeshModelSource*> |
typedef QList<Rendering::SceneItem*> SceneItemList |
typedef QMap<QString, const DataExecution::DataFactory*> StateTypeMap |
Hdf5SceneSerializer | ( | hid_t & | file | ) |
file | The HDF5 file to which we are reading / writing scene hierarchy data. |
bool readTransformHierarchy | ( | Rendering::Transform & | transform, |
SceneItemList & | newSceneItems, | ||
MeshSourceMap & | meshSources, | ||
Rendering::Shader & | shader, | ||
const QString & | subtreePath = QString() , |
||
const QString & | modelIdPrefix = QString() |
||
) | const |
transform | (out) Root transform into which all SceneItems will be added as children. Note that the transform will not "own" the newly created SceneItems, as these will be stored in the newSceneItems list. |
newSceneItems | (out) SceneItemList into which to store all newly created SceneItems that are loaded from file. It is the responsibility of calling code to delete these when they are no longer needed. |
meshSources | (out) MeshSourceMap into which newly created MeshModelSources are stored as meshes are read from the file. It is the responsibility of calling code to delete these when they are no longer needed. |
shader | The shader to attach to each newly created MeshModelInstance object. |
subtreePath | Absolute path to the subtree in the "instances" section of the HDF5 file that we with to read. Callers will generally leave this as the empty string. |
modelIdPrefix | The prefix of the modelId |
bool readVersion | ( | size_type & | version | ) | const |
version | (out) Variable into which the version will be written upon successful read. |
bool writeMeshInstance | ( | const QString & | meshId, |
const QString & | instanceId, | ||
const QString & | transformPath = QString() |
||
) |
meshId | The ID of the mesh data that this instance refers to. This should refer to a group path under the "meshes" section of the HDF5 file. |
instanceId | The unique identifier of this MeshModelInstance. |
transformPath | The absolute path to this instance in the scene hierarchy in the HDF5 file. |
bool writeTransform | ( | const QString & | transformId, |
const Mesh::TransformMatrix & | matrix, | ||
const QString & | transformPath = QString() |
||
) |
transformId | The unique identifier of the transform being written. |
matrix | The 4x4 transform matrix. |
transformPath | The path to the transform in the file. For example, the empty string would be at the root, while a specific path would point to its location in the tree. |
bool writeVersion | ( | ) |
|
static |
Long string datatype used to store mesh references. We don't use HDF5 links because we don't need to jump to the data using the HDF5 API: rather we use our Hdf5MeshModelInstance instead.
|
static |
Long string datatype length
|
static |
Maximum name length