ANSYS::Nexus::GLTFWriter::GLTF Class Reference
Last update: 17.04.2023This is the main class of the GLTFWriter. More...
#include <GLTFWriter.h>
Public Types | |
enum | GLTFError { GLTF_ERROR_NONE = 0 , GLTF_ERROR_DUPLICATE_VALUE , GLTF_ERROR_INCOMPATIBLE_VALUE , GLTF_ERROR_INVALID_PATH , GLTF_ERROR_INVALID_TARGET , GLTF_ERROR_INVALID_TYPE , GLTF_ERROR_INVALID_VALUE , GLTF_ERROR_MEMORY , GLTF_ERROR_RANGE , GLTF_ERROR_READ , GLTF_ERROR_SIZE_MISMATCH , GLTF_ERROR_VALUE_NOT_INITIALIZED , GLTF_ERROR_WRITE , GLT_ERROR_MAX } |
enum | OutputType { OT_AVZ , OT_GLTF , OT_GLB1 , OT_GLTF1 , OT_GLB2 } |
Public Member Functions | |
virtual bool | Write (bool formatJSON=false)=0 |
virtual void | SetDefaultScene (const Scene *scene)=0 |
virtual GLTFError | GetError ()=0 |
Static Public Member Functions | |
static GLTF * | Create (const char *application, const char *applicationVersion, const char *filePath, OutputType fileType=OT_AVZ) |
static void | Destroy (GLTF *gltf) |
Detailed Description
This is the main class of the GLTFWriter.
It is required to create all other classes and it is responsible for writing the GLTF files. This is the first object that should be created.
Definition at line 31 of file GLTFGLTF.h.
Member Enumeration Documentation
◆ GLTFError
Returned by GetError
Enumerator | |
---|---|
GLTF_ERROR_NONE | No Error. |
GLTF_ERROR_DUPLICATE_VALUE | Value is a duplicated. |
GLTF_ERROR_INCOMPATIBLE_VALUE | Value not compatible with other properties. |
GLTF_ERROR_INVALID_PATH | Path not valid. |
GLTF_ERROR_INVALID_TARGET | Animation target not valid. |
GLTF_ERROR_INVALID_TYPE | Value type not valid for other properties. |
GLTF_ERROR_INVALID_VALUE | Value is not valid. |
GLTF_ERROR_MEMORY | Memory allocation error. |
GLTF_ERROR_RANGE | Index out of range. |
GLTF_ERROR_READ | Error reading file data. |
GLTF_ERROR_SIZE_MISMATCH | Animation input/output size mismatch. |
GLTF_ERROR_VALUE_NOT_INITIALIZED | Trying to animate value that was never initialized. |
GLTF_ERROR_WRITE | Error writing file data. |
- Examples
- Test001.cpp, Test002.cpp, Test003.cpp, Test004.cpp, Test005.cpp, Test006.cpp, Test007.cpp, Test008.cpp, Test009.cpp, Test010.cpp, Test011.cpp, Test012.cpp, Test013.cpp, and Test014.cpp.
Definition at line 35 of file GLTFGLTF.h.
◆ OutputType
Member Function Documentation
◆ Create()
|
static |
Constructs a GLTF object.
- Parameters
-
[in] application Name of application that is using GLTFWriter. [in] applicationVersion Version of application that is using GLTFWriter. [in] filePath Fully qualified path to AVZ file or main GLTF file. Any additional files that are required will be created in the folder of this path. [in] fileType Optional, GLTF::OutputType defining type of output to create. Any extension of filePath will be ignored and replaced by the appropriate extension of the fileType.
- Examples
- Test001.cpp, Test002.cpp, Test003.cpp, Test004.cpp, Test005.cpp, Test006.cpp, Test007.cpp, Test008.cpp, Test009.cpp, Test010.cpp, Test011.cpp, Test012.cpp, Test013.cpp, and Test014.cpp.
◆ Destroy()
|
static |
Destroys a GLTF object created by Create.
- Parameters
-
[in] gltf GLTF object return by Create
- Examples
- Test001.cpp, Test002.cpp, Test003.cpp, Test004.cpp, Test005.cpp, Test006.cpp, Test007.cpp, Test008.cpp, Test009.cpp, Test010.cpp, Test011.cpp, Test012.cpp, Test013.cpp, and Test014.cpp.
◆ GetError()
|
pure virtual |
Returns the code for the last error. When an error occurs an error code is set. No further error is recorded until GetError is called. When GetError is called, the erorr code is reset to GLTF_ERROR_NONE.
- Returns
- GLTFError code.
◆ SetDefaultScene()
|
pure virtual |
◆ Write()
|
pure virtual |
Completes the GLTF file and writes out all data. This is the last call that should be made. Any additional GLTF objects created after this call will be ignored. This call does nothing if called a second time.
This call is optional. If it has not been called when the GLTF object is destroyed it will be called. However, any errors in writing GLTF file will be ignored.
- Returns
- status of write.
- Parameters
-
[in] formatJSON Format the JSON file for easier readability
The documentation for this class was generated from the following file:
- D:/ANSYSDev/NoBackup/branches/EnSight-Second-Coming/webgl_viewer/gltfwriterlib/include/GLTFGLTF.h