Skip to main content

Post-processing tools 2023 R2

GLTFGLTF.h

Last update: 17.04.2023
1 /*
2  * Copyright 2018-2021 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
3  *
4  * Restricted Rights Legend
5  *
6  * Use, duplication, or disclosure of this
7  * software and its documentation by the
8  * Government is subject to restrictions as
9  * set forth in subdivision [(b)(3)(ii)] of
10  * the Rights in Technical Data and Computer
11  * Software clause at 52.227-7013.
12  */
13 
18 #ifndef __INCLUDED_GLTF_GLTF__
19 #define __INCLUDED_GLTF_GLTF__
20 
21 #include "GLTFCommon.h"
22 
23 namespace ANSYS { namespace Nexus { namespace GLTFWriter {
24  class Scene;
25 
31  class GLTF
32  {
33  public:
35  enum GLTFError {
49 
50  GLT_ERROR_MAX
51  };
52 
55  {
60  OT_GLB2
61  };
62 
63  protected:
64  virtual ~GLTF() {};
65 
66  public:
68  static GLTFWRITERSPEC GLTF *Create(const char *application,
69  const char *applicationVersion,
70  const char *filePath,
71  OutputType fileType = OT_AVZ
72  );
74  static GLTFWRITERSPEC void Destroy(GLTF *gltf
75  );
76 
83  GLTFWRITERSPEC virtual bool Write(bool formatJSON = false
84  ) = 0;
88  GLTFWRITERSPEC virtual void SetDefaultScene(const Scene *scene
89  ) = 0;
93  GLTFWRITERSPEC virtual GLTFError GetError() = 0;
94  };
276 
277 } } }
278 
279 #endif
This is the main class of the GLTFWriter.
Definition: GLTFGLTF.h:32
static void Destroy(GLTF *gltf)
@ OT_GLTF1
GLTF 1.0 spec.
Definition: GLTFGLTF.h:59
@ OT_GLTF
GLTF for ANSYS Viewer.
Definition: GLTFGLTF.h:57
@ OT_GLB2
GLB file in GLTF 2.0 spec.
Definition: GLTFGLTF.h:60
@ OT_GLB1
GLB file in GLTF 1.0 spec (may not be supported)
Definition: GLTFGLTF.h:58
@ OT_AVZ
AVZ file for ANSYS Viewer.
Definition: GLTFGLTF.h:56
virtual void SetDefaultScene(const Scene *scene)=0
virtual bool Write(bool formatJSON=false)=0
virtual GLTFError GetError()=0
static GLTF * Create(const char *application, const char *applicationVersion, const char *filePath, OutputType fileType=OT_AVZ)
@ GLTF_ERROR_WRITE
Error writing file data.
Definition: GLTFGLTF.h:48
@ GLTF_ERROR_INVALID_PATH
Path not valid.
Definition: GLTFGLTF.h:39
@ GLTF_ERROR_VALUE_NOT_INITIALIZED
Trying to animate value that was never initialized.
Definition: GLTFGLTF.h:47
@ GLTF_ERROR_INVALID_VALUE
Value is not valid.
Definition: GLTFGLTF.h:42
@ GLTF_ERROR_INCOMPATIBLE_VALUE
Value not compatible with other properties.
Definition: GLTFGLTF.h:38
@ GLTF_ERROR_INVALID_TYPE
Value type not valid for other properties.
Definition: GLTFGLTF.h:41
@ GLTF_ERROR_INVALID_TARGET
Animation target not valid.
Definition: GLTFGLTF.h:40
@ GLTF_ERROR_DUPLICATE_VALUE
Value is a duplicated.
Definition: GLTFGLTF.h:37
@ GLTF_ERROR_RANGE
Index out of range.
Definition: GLTFGLTF.h:44
@ GLTF_ERROR_READ
Error reading file data.
Definition: GLTFGLTF.h:45
@ GLTF_ERROR_MEMORY
Memory allocation error.
Definition: GLTFGLTF.h:43
@ GLTF_ERROR_SIZE_MISMATCH
Animation input/output size mismatch.
Definition: GLTFGLTF.h:46
Scenes are the GLTFWriter class that create the view of the data that is defined in the GLTF file.
Definition: GLTFScene.h:29
GLTFWriter API Documentation.
Definition: GLTFAnimation.h:19