VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkWebGLObject.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00020 #ifndef vtkWebGLObject_h 00021 #define vtkWebGLObject_h 00022 00023 #include "vtkObject.h" 00024 #include "vtkWebGLExporterModule.h" // needed for export macro 00025 00026 #include <string> // needed for ID and md5 storing 00027 00028 class vtkMatrix4x4; 00029 class vtkUnsignedCharArray; 00030 00031 enum WebGLObjectTypes { 00032 wPOINTS = 0, 00033 wLINES = 1, 00034 wTRIANGLES = 2 00035 }; 00036 00037 class VTKWEBGLEXPORTER_EXPORT vtkWebGLObject : public vtkObject 00038 { 00039 public: 00040 static vtkWebGLObject* New(); 00041 vtkTypeMacro(vtkWebGLObject, vtkObject) 00042 void PrintSelf(ostream &os, vtkIndent indent); 00043 00044 virtual void GenerateBinaryData(); 00045 virtual unsigned char* GetBinaryData(int part); 00046 virtual int GetBinarySize(int part); 00047 virtual int GetNumberOfParts(); 00048 00052 void GetBinaryData(int part, vtkUnsignedCharArray* buffer); 00053 00054 void SetLayer(int l); 00055 void SetRendererId(long int i); 00056 void SetId(std::string i); 00057 void SetWireframeMode(bool wireframe); 00058 void SetVisibility(bool vis); 00059 void SetTransformationMatrix(vtkMatrix4x4* m); 00060 void SetIsWidget(bool w); 00061 void SetHasTransparency(bool t); 00062 void SetInteractAtServer(bool i); 00063 void SetType(WebGLObjectTypes t); 00064 bool isWireframeMode(); 00065 bool isVisible(); 00066 bool HasChanged(); 00067 bool isWidget(); 00068 bool HasTransparency(); 00069 bool InteractAtServer(); 00070 //BTX 00071 std::string GetMD5(); 00072 std::string GetId(); 00073 //ETX 00074 long int GetRendererId(); 00075 int GetLayer(); 00076 00077 protected: 00078 vtkWebGLObject(); 00079 ~vtkWebGLObject(); 00080 00081 float Matrix[16]; 00082 long int rendererId; 00083 int layer; // Renderer Layer 00084 std::string id; // Id of the object 00085 std::string MD5; 00086 bool hasChanged; 00087 bool iswireframeMode; 00088 bool isvisible; 00089 WebGLObjectTypes webGlType; 00090 bool hasTransparency; 00091 bool iswidget; 00092 bool interactAtServer; 00093 00094 private: 00095 vtkWebGLObject(const vtkWebGLObject&); // Not implemented 00096 void operator=(const vtkWebGLObject&); // Not implemented 00097 }; 00098 00099 #endif