VTK  9.1.0
vtkWebGLObject.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWebGLObject.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
20 #ifndef vtkWebGLObject_h
21 #define vtkWebGLObject_h
22 
23 #include "vtkObject.h"
24 #include "vtkWebGLExporterModule.h" // needed for export macro
25 
26 #include <string> // needed for ID and md5 storing
27 
28 class vtkMatrix4x4;
30 
32 {
33  wPOINTS = 0,
34  wLINES = 1,
35  wTRIANGLES = 2
36 };
37 
38 class VTKWEBGLEXPORTER_EXPORT vtkWebGLObject : public vtkObject
39 {
40 public:
41  static vtkWebGLObject* New();
42  vtkTypeMacro(vtkWebGLObject, vtkObject);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
45  virtual void GenerateBinaryData();
46  virtual unsigned char* GetBinaryData(int part);
47  virtual int GetBinarySize(int part);
48  virtual int GetNumberOfParts();
49 
55  void GetBinaryData(int part, vtkUnsignedCharArray* buffer);
56 
57  void SetLayer(int l);
58  void SetRendererId(size_t i);
59  void SetId(const std::string& i);
60  void SetWireframeMode(bool wireframe);
61  void SetVisibility(bool vis);
63  void SetIsWidget(bool w);
64  void SetHasTransparency(bool t);
65  void SetInteractAtServer(bool i);
68  bool isVisible();
69  bool HasChanged();
70  bool isWidget();
73 
76 
77  size_t GetRendererId();
78  int GetLayer();
79 
80 protected:
82  ~vtkWebGLObject() override;
83 
84  float Matrix[16];
85  size_t rendererId;
86  int layer; // Renderer Layer
87  std::string id; // Id of the object
89  bool hasChanged;
91  bool isvisible;
94  bool iswidget;
96 
97 private:
98  vtkWebGLObject(const vtkWebGLObject&) = delete;
99  void operator=(const vtkWebGLObject&) = delete;
100 };
101 
102 #endif
vtkWebGLObject::GetBinaryData
virtual unsigned char * GetBinaryData(int part)
vtkWebGLObject::GetBinaryData
void GetBinaryData(int part, vtkUnsignedCharArray *buffer)
This is a wrapper friendly method for access the binary data.
vtkWebGLObject::MD5
std::string MD5
Definition: vtkWebGLObject.h:88
vtkWebGLObject::isWireframeMode
bool isWireframeMode()
vtkWebGLObject::GetRendererId
size_t GetRendererId()
vtkWebGLObject::hasTransparency
bool hasTransparency
Definition: vtkWebGLObject.h:93
vtkWebGLObject::GetLayer
int GetLayer()
vtkWebGLObject::SetHasTransparency
void SetHasTransparency(bool t)
vtkWebGLObject::GenerateBinaryData
virtual void GenerateBinaryData()
vtkWebGLObject::GetId
std::string GetId()
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:145
vtkWebGLObject::SetRendererId
void SetRendererId(size_t i)
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkWebGLObject::GetMD5
std::string GetMD5()
vtkWebGLObject::SetVisibility
void SetVisibility(bool vis)
vtkWebGLObject::isVisible
bool isVisible()
vtkWebGLObject::SetIsWidget
void SetIsWidget(bool w)
vtkWebGLObject::vtkWebGLObject
vtkWebGLObject()
vtkWebGLObject::interactAtServer
bool interactAtServer
Definition: vtkWebGLObject.h:95
vtkWebGLObject::iswireframeMode
bool iswireframeMode
Definition: vtkWebGLObject.h:90
vtkWebGLObject::SetTransformationMatrix
void SetTransformationMatrix(vtkMatrix4x4 *m)
vtkWebGLObject::~vtkWebGLObject
~vtkWebGLObject() override
vtkWebGLObject::rendererId
size_t rendererId
Definition: vtkWebGLObject.h:85
vtkWebGLObject::GetBinarySize
virtual int GetBinarySize(int part)
wTRIANGLES
@ wTRIANGLES
Definition: vtkWebGLObject.h:35
vtkWebGLObject::SetType
void SetType(WebGLObjectTypes t)
vtkWebGLObject::InteractAtServer
bool InteractAtServer()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:145
vtkWebGLObject::iswidget
bool iswidget
Definition: vtkWebGLObject.h:94
vtkWebGLObject::isvisible
bool isvisible
Definition: vtkWebGLObject.h:91
vtkWebGLObject::layer
int layer
Definition: vtkWebGLObject.h:86
vtkWebGLObject::id
std::string id
Definition: vtkWebGLObject.h:87
vtkWebGLObject
vtkWebGLObject represent and manipulate an WebGL object and its data.
Definition: vtkWebGLObject.h:39
vtkWebGLObject::New
static vtkWebGLObject * New()
vtkWebGLObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject.h
wLINES
@ wLINES
Definition: vtkWebGLObject.h:34
wPOINTS
@ wPOINTS
Definition: vtkWebGLObject.h:33
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkWebGLObject::GetNumberOfParts
virtual int GetNumberOfParts()
vtkWebGLObject::webGlType
WebGLObjectTypes webGlType
Definition: vtkWebGLObject.h:92
vtkWebGLObject::HasChanged
bool HasChanged()
vtkWebGLObject::isWidget
bool isWidget()
WebGLObjectTypes
WebGLObjectTypes
Definition: vtkWebGLObject.h:32
vtkWebGLObject::HasTransparency
bool HasTransparency()
vtkWebGLObject::SetLayer
void SetLayer(int l)
vtkWebGLObject::hasChanged
bool hasChanged
Definition: vtkWebGLObject.h:89
vtkWebGLObject::SetWireframeMode
void SetWireframeMode(bool wireframe)
vtkWebGLObject::SetId
void SetId(const std::string &i)
vtkWebGLObject::SetInteractAtServer
void SetInteractAtServer(bool i)