Skip to main content

Post-processing tools 2023 R2

GLTFScene.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 #ifndef __INCLUDED_GLTF_GLTFSCENE__
14 #define __INCLUDED_GLTF_GLTFSCENE__
15 
16 #include "GLTFCommon.h"
17 #include "GLTFObject.h"
18 #include "GLTFMarkup.h"
19 
20 namespace ANSYS { namespace Nexus { namespace GLTFWriter {
21  class GLTF;
22  class Node;
23 
28  class Scene : public Object
29  {
30  public:
33  {
34  BT_NONE = -1,
35  BT_SOLID = 0,
38  BT_TLBR
39  };
40 
41  protected:
42  virtual ~Scene() {}
43 
44  public:
47  static GLTFWRITERSPEC Scene *Create(GLTF *gltf,
48  const char *name = 0,
49  const char *units = 0,
50  float scale = 1,
51  Scene::BackgroundType backgroundType = Scene::BT_NONE,
52  float r1 = 0,
53  float g1 = 0,
54  float b1 = 0,
55  float r2 = 0,
56  float g2 = 0,
57  float b2 = 0
58  );
59 
64  GLTFWRITERSPEC virtual bool SetCamera(Node *camera
65  ) = 0;
68  GLTFWRITERSPEC virtual bool SetLight(Node *light
69  ) = 0;
73  GLTFWRITERSPEC virtual bool SetProxyImage(Node* image
74  ) = 0;
79  GLTFWRITERSPEC virtual void SetClipPlane(float p0x,
80  float p0y,
81  float p0z,
82  float p1x,
83  float p1y,
84  float p1z,
85  float p2x,
86  float p2y,
87  float p2z
88  ) = 0;
91  GLTFWRITERSPEC virtual bool AppendMesh(Node *mesh
92  ) = 0;
95  GLTFWRITERSPEC virtual bool Add2DText(GLTF *gltf,
96  const char *text,
97  float x,
98  float y,
100  float textSize = 20,
101  const char *textFont = 0,
102  float textR = 0,
103  float textG = 0,
104  float textB = 0,
105  float bgR = 1,
106  float bgG = 1,
107  float bgB = 1,
108  float bgA = 0,
109  const char *path = 0
110  ) = 0;
113  GLTFWRITERSPEC virtual bool Add3DText(GLTF *gltf,
114  const char *text,
115  float x,
116  float y,
117  float z,
119  float textSize = 12,
120  const char *textFont = 0,
121  float textOffX = 0,
122  float textOffY = 0,
124  float lineR = 0,
125  float lineG = 0,
126  float lineB = 0,
127  float textR = 0,
128  float textG = 0,
129  float textB = 0,
130  float bgR = 1,
131  float bgG = 1,
132  float bgB = 1,
133  float bgA = 0.5,
134  const char *path = 0
135  ) = 0;
136  };
137 
138 } } }
139 
140 #endif
This is the main class of the GLTFWriter.
Definition: GLTFGLTF.h:32
Nodes are the GLTFWriter class that contain the data that is defined in the GLTF file.
Definition: GLTFNode.h:31
Scenes are the GLTFWriter class that create the view of the data that is defined in the GLTF file.
Definition: GLTFScene.h:29
virtual bool SetCamera(Node *camera)=0
virtual bool Add2DText(GLTF *gltf, const char *text, float x, float y, Markup::MarkupTextAttachmentType textAttach=Markup::MTAT_CENTER, float textSize=20, const char *textFont=0, float textR=0, float textG=0, float textB=0, float bgR=1, float bgG=1, float bgB=1, float bgA=0, const char *path=0)=0
virtual void SetClipPlane(float p0x, float p0y, float p0z, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)=0
virtual bool Add3DText(GLTF *gltf, const char *text, float x, float y, float z, Markup::MarkupTextAttachmentType textAttach=Markup::MTAT_AUTO, float textSize=12, const char *textFont=0, float textOffX=0, float textOffY=0, Markup::MarkupLineType lineShape=Markup::MLT_LINE, float lineR=0, float lineG=0, float lineB=0, float textR=0, float textG=0, float textB=0, float bgR=1, float bgG=1, float bgB=1, float bgA=0.5, const char *path=0)=0
static Scene * Create(GLTF *gltf, const char *name=0, const char *units=0, float scale=1, Scene::BackgroundType backgroundType=Scene::BT_NONE, float r1=0, float g1=0, float b1=0, float r2=0, float g2=0, float b2=0)
@ BT_TB
Make gradient from color 1 top to color 2 bottom.
Definition: GLTFScene.h:36
@ BT_LR
Make gradient from color 1 left to color 2 right.
Definition: GLTFScene.h:37
@ BT_NONE
Use viewer default background.
Definition: GLTFScene.h:34
@ BT_TLBR
Make gradient from color 1 top/left to color 2 bottom/right.
Definition: GLTFScene.h:38
@ BT_SOLID
Make solid color from color 1.
Definition: GLTFScene.h:35
virtual bool SetProxyImage(Node *image)=0
virtual bool SetLight(Node *light)=0
virtual bool AppendMesh(Node *mesh)=0
@ MTAT_AUTO
Label is automatically positioned relative to x,y.
Definition: GLTFMarkup.h:32
@ MTAT_CENTER
Label is centered about x,y.
Definition: GLTFMarkup.h:37
GLTFWriter API Documentation.
Definition: GLTFAnimation.h:19