VTK: Web/WebGLExporter/vtkWebGLObject.h Source File

| VTK 9.3.1

vtkWebGLObject.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
8 #ifndef vtkWebGLObject_h
9 #define vtkWebGLObject_h
10
11 #include "vtkObject.h"
12 #include "vtkWebGLExporterModule.h" // needed for export macro
13
14 #include <string> // needed for ID and md5 storing
15
16 VTK_ABI_NAMESPACE_BEGIN
17 class vtkMatrix4x4;
18 class vtkUnsignedCharArray;
19
20 enum WebGLObjectTypes
21 {
22 wPOINTS = 0,
23 wLINES = 1,
24 wTRIANGLES = 2
25 };
26
27 class VTKWEBGLEXPORTER_EXPORT vtkWebGLObject : public vtkObject
28 {
29 public:
30 static vtkWebGLObject* New();
31 vtkTypeMacro(vtkWebGLObject, vtkObject);
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
34 virtual void GenerateBinaryData();
35 virtual unsigned char* GetBinaryData(int part);
36 virtual int GetBinarySize(int part);
37 virtual int GetNumberOfParts();
38
44 void GetBinaryData(int part, vtkUnsignedCharArray* buffer);
45
46 void SetLayer(int l);
47 void SetRendererId(size_t i);
48 void SetId(const std::string& i);
49 void SetWireframeMode(bool wireframe);
50 void SetVisibility(bool vis);
51 void SetTransformationMatrix(vtkMatrix4x4* m);
52 void SetIsWidget(bool w);
53 void SetHasTransparency(bool t);
54 void SetInteractAtServer(bool i);
55 void SetType(WebGLObjectTypes t);
56 bool isWireframeMode();
57 bool isVisible();
58 bool HasChanged();
59 bool isWidget();
60 bool HasTransparency();
61 bool InteractAtServer();
62
63 std::string GetMD5();
64 std::string GetId();
65
66 size_t GetRendererId();
67 int GetLayer();
68
69 protected:
70 vtkWebGLObject();
71 ~vtkWebGLObject() override;
72
73 float Matrix[16];
74 size_t rendererId;
75 int layer; // Renderer Layer
76 std::string id; // Id of the object
77 std::string MD5;
78 bool hasChanged;
79 bool iswireframeMode;
80 bool isvisible;
81 WebGLObjectTypes webGlType;
82 bool hasTransparency;
83 bool iswidget;
84 bool interactAtServer;
85
86 private:
87 vtkWebGLObject(const vtkWebGLObject&) = delete;
88 void operator=(const vtkWebGLObject&) = delete;
89 };
90
91 VTK_ABI_NAMESPACE_END
92 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:40
vtkWebGLObject
vtkWebGLObject represent and manipulate an WebGL object and its data.
Definition: vtkWebGLObject.h:28
vtkWebGLObject::SetHasTransparency
void SetHasTransparency(bool t)
vtkWebGLObject::id
std::string id
Definition: vtkWebGLObject.h:76
vtkWebGLObject::hasChanged
bool hasChanged
Definition: vtkWebGLObject.h:78
vtkWebGLObject::rendererId
size_t rendererId
Definition: vtkWebGLObject.h:74
vtkWebGLObject::SetTransformationMatrix
void SetTransformationMatrix(vtkMatrix4x4 *m)
vtkWebGLObject::SetId
void SetId(const std::string &i)
vtkWebGLObject::SetLayer
void SetLayer(int l)
vtkWebGLObject::GetRendererId
size_t GetRendererId()
vtkWebGLObject::GetBinarySize
virtual int GetBinarySize(int part)
vtkWebGLObject::GetId
std::string GetId()
vtkWebGLObject::isWidget
bool isWidget()
vtkWebGLObject::webGlType
WebGLObjectTypes webGlType
Definition: vtkWebGLObject.h:81
vtkWebGLObject::iswidget
bool iswidget
Definition: vtkWebGLObject.h:83
vtkWebGLObject::vtkWebGLObject
vtkWebGLObject()
vtkWebGLObject::SetIsWidget
void SetIsWidget(bool w)
vtkWebGLObject::GetLayer
int GetLayer()
vtkWebGLObject::GetNumberOfParts
virtual int GetNumberOfParts()
vtkWebGLObject::hasTransparency
bool hasTransparency
Definition: vtkWebGLObject.h:82
vtkWebGLObject::GenerateBinaryData
virtual void GenerateBinaryData()
vtkWebGLObject::interactAtServer
bool interactAtServer
Definition: vtkWebGLObject.h:84
vtkWebGLObject::isWireframeMode
bool isWireframeMode()
vtkWebGLObject::HasTransparency
bool HasTransparency()
vtkWebGLObject::GetBinaryData
virtual unsigned char * GetBinaryData(int part)
vtkWebGLObject::isvisible
bool isvisible
Definition: vtkWebGLObject.h:80
vtkWebGLObject::SetWireframeMode
void SetWireframeMode(bool wireframe)
vtkWebGLObject::SetType
void SetType(WebGLObjectTypes t)
vtkWebGLObject::layer
int layer
Definition: vtkWebGLObject.h:75
vtkWebGLObject::SetInteractAtServer
void SetInteractAtServer(bool i)
vtkWebGLObject::GetBinaryData
void GetBinaryData(int part, vtkUnsignedCharArray *buffer)
This is a wrapper friendly method for access the binary data.
vtkWebGLObject::New
static vtkWebGLObject * New()
vtkWebGLObject::iswireframeMode
bool iswireframeMode
Definition: vtkWebGLObject.h:79
vtkWebGLObject::HasChanged
bool HasChanged()
vtkWebGLObject::isVisible
bool isVisible()
vtkWebGLObject::SetVisibility
void SetVisibility(bool vis)
vtkWebGLObject::GetMD5
std::string GetMD5()
vtkWebGLObject::MD5
std::string MD5
Definition: vtkWebGLObject.h:77
vtkWebGLObject::~vtkWebGLObject
~vtkWebGLObject() override
vtkWebGLObject::SetRendererId
void SetRendererId(size_t i)
vtkWebGLObject::InteractAtServer
bool InteractAtServer()
vtkWebGLObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkObject.h
WebGLObjectTypes
WebGLObjectTypes
Definition: vtkWebGLObject.h:21
wTRIANGLES
@ wTRIANGLES
Definition: vtkWebGLObject.h:24
wPOINTS
@ wPOINTS
Definition: vtkWebGLObject.h:22
wLINES
@ wLINES
Definition: vtkWebGLObject.h:23