VTK  9.3.20240328
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;
19 
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);
52  void SetIsWidget(bool w);
53  void SetHasTransparency(bool t);
54  void SetInteractAtServer(bool i);
57  bool isVisible();
58  bool HasChanged();
59  bool isWidget();
62 
65 
66  size_t GetRendererId();
67  int GetLayer();
68 
69 protected:
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
78  bool hasChanged;
80  bool isvisible;
83  bool iswidget;
85 
86 private:
87  vtkWebGLObject(const vtkWebGLObject&) = delete;
88  void operator=(const vtkWebGLObject&) = delete;
89 };
90 
91 VTK_ABI_NAMESPACE_END
92 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:140
abstract base class for most VTK objects
Definition: vtkObject.h:161
dynamic, self-adjusting array of unsigned char
vtkWebGLObject represent and manipulate an WebGL object and its data.
void SetHasTransparency(bool t)
std::string id
void SetTransformationMatrix(vtkMatrix4x4 *m)
void SetId(const std::string &i)
void SetLayer(int l)
size_t GetRendererId()
virtual int GetBinarySize(int part)
std::string GetId()
WebGLObjectTypes webGlType
void SetIsWidget(bool w)
virtual int GetNumberOfParts()
virtual void GenerateBinaryData()
bool isWireframeMode()
bool HasTransparency()
virtual unsigned char * GetBinaryData(int part)
void SetWireframeMode(bool wireframe)
void SetType(WebGLObjectTypes t)
void SetInteractAtServer(bool i)
void GetBinaryData(int part, vtkUnsignedCharArray *buffer)
This is a wrapper friendly method for access the binary data.
static vtkWebGLObject * New()
void SetVisibility(bool vis)
std::string GetMD5()
std::string MD5
~vtkWebGLObject() override
void SetRendererId(size_t i)
bool InteractAtServer()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
@ string
Definition: vtkX3D.h:490
WebGLObjectTypes
@ wTRIANGLES
@ wPOINTS
@ wLINES