Skip to main content

EnSight 2025 R2

GLTFScene

Last update: 16.07.2025
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
20namespace ANSYS { namespace AVZ { namespace GLTFWriter {
21 class GLTF;
22 class Node;
23 class Value;
24
29 class Scene : public Object
30 {
31 public:
41
42 protected:
43 virtual ~Scene() {}
44
45 public:
48 static GLTFWRITERSPEC Scene *Create(GLTF *gltf,
49 const char *name = 0,
50 const char *units = 0,
51 float scale = 1,
52 Scene::BackgroundType backgroundType = Scene::BT_NONE,
53 float r1 = 0,
54 float g1 = 0,
55 float b1 = 0,
56 float r2 = 0,
57 float g2 = 0,
58 float b2 = 0
59 );
60
65 GLTFWRITERSPEC virtual bool SetCamera(Node *camera
66 ) = 0;
69 GLTFWRITERSPEC virtual bool SetLight(Node *light
70 ) = 0;
74 GLTFWRITERSPEC virtual bool SetProxyImage(Node* image
75 ) = 0;
80 GLTFWRITERSPEC virtual void SetClipPlane(float p0x,
81 float p0y,
82 float p0z,
83 float p1x,
84 float p1y,
85 float p1z,
86 float p2x,
87 float p2y,
88 float p2z
89 ) = 0;
92 GLTFWRITERSPEC virtual bool AppendMesh(Node *mesh
93 ) = 0;
96 GLTFWRITERSPEC virtual bool Add2DText(GLTF *gltf,
97 const char *text,
98 float x,
99 float y,
101 float textSize = 20,
102 const char *textFont = 0,
103 float textR = 0,
104 float textG = 0,
105 float textB = 0,
106 float bgR = 1,
107 float bgG = 1,
108 float bgB = 1,
109 float bgA = 0,
110 const char *path = 0
111 ) = 0;
114 GLTFWRITERSPEC virtual bool Add3DText(GLTF *gltf,
115 const char *text,
116 float x,
117 float y,
118 float z,
120 float textSize = 12,
121 const char *textFont = 0,
122 float textOffX = 0,
123 float textOffY = 0,
125 float lineR = 0,
126 float lineG = 0,
127 float lineB = 0,
128 float textR = 0,
129 float textG = 0,
130 float textB = 0,
131 float bgR = 1,
132 float bgG = 1,
133 float bgB = 1,
134 float bgA = 0.5,
135 const char *path = 0
136 ) = 0;
140 GLTFWRITERSPEC virtual bool AppendValue(Value* value
141 ) = 0;
142 };
143
144} } }
145
146#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
Object is base class for GLTF objects.
Definition GLTFObject.h:23
Scenes are the GLTFWriter class that create the view of the data that is defined in the GLTF file.
Definition GLTFScene.h:30
@ BT_SOLID
Make solid color from color 1.
Definition GLTFScene.h:36
@ BT_TLBR
Make gradient from color 1 top/left to color 2 bottom/right.
Definition GLTFScene.h:39
@ BT_LR
Make gradient from color 1 left to color 2 right.
Definition GLTFScene.h:38
@ BT_TB
Make gradient from color 1 top to color 2 bottom.
Definition GLTFScene.h:37
@ BT_NONE
Use viewer default background.
Definition GLTFScene.h:35
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 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
virtual bool SetProxyImage(Node *image)=0
virtual bool AppendMesh(Node *mesh)=0
virtual void SetClipPlane(float p0x, float p0y, float p0z, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)=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)
virtual bool AppendValue(Value *value)=0
virtual bool SetLight(Node *light)=0
virtual bool SetCamera(Node *camera)=0
Values are objects for storing single and multiple numbers and strings.
Definition GLTFValue.h:26
@ 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.

Connect with Ansys