VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkX3DExporter.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 =========================================================================*/ 00029 #ifndef __vtkX3DExporter_h 00030 #define __vtkX3DExporter_h 00031 00032 #include "vtkExporter.h" 00033 00034 class vtkLight; 00035 class vtkActor; 00036 class vtkActor2D; 00037 class vtkPoints; 00038 class vtkDataArray; 00039 class vtkUnsignedCharArray; 00040 class vtkX3DExporterWriter; 00041 class vtkRenderer; 00042 00043 class VTK_HYBRID_EXPORT vtkX3DExporter : public vtkExporter 00044 { 00045 public: 00046 static vtkX3DExporter *New(); 00047 vtkTypeMacro(vtkX3DExporter,vtkExporter); 00048 void PrintSelf(ostream& os, vtkIndent indent); 00049 00051 00052 vtkSetStringMacro(FileName); 00053 vtkGetStringMacro(FileName); 00055 00057 00058 vtkSetMacro(Speed,double); 00059 vtkGetMacro(Speed,double); 00061 00063 00064 vtkSetClampMacro(Binary, int, 0, 1); 00065 vtkBooleanMacro(Binary, int); 00066 vtkGetMacro(Binary, int); 00068 00070 00071 vtkSetClampMacro(Fastest, int, 0, 1); 00072 vtkBooleanMacro(Fastest, int); 00073 vtkGetMacro(Fastest, int); 00075 00077 00078 vtkSetMacro(WriteToOutputString,int); 00079 vtkGetMacro(WriteToOutputString,int); 00080 vtkBooleanMacro(WriteToOutputString,int); 00082 00084 00087 vtkGetMacro(OutputStringLength, int); 00088 vtkGetStringMacro(OutputString); 00089 unsigned char *GetBinaryOutputString() 00090 { 00091 return reinterpret_cast<unsigned char *>(this->OutputString); 00092 } 00094 00098 char *RegisterAndGetOutputString(); 00099 00100 protected: 00101 vtkX3DExporter(); 00102 ~vtkX3DExporter(); 00103 00104 // Stream management 00105 int WriteToOutputString; 00106 char *OutputString; 00107 int OutputStringLength; 00108 00110 void WriteData(); 00111 00112 void WriteALight(vtkLight *aLight, vtkX3DExporterWriter* writer); 00113 void WriteAnActor(vtkActor *anActor, vtkX3DExporterWriter* writer, 00114 int index); 00115 void WritePointData(vtkPoints *points, vtkDataArray *normals, 00116 vtkDataArray *tcoords, vtkUnsignedCharArray *colors, 00117 vtkX3DExporterWriter* writer, int index); 00118 void WriteATextActor2D(vtkActor2D *anTextActor2D, 00119 vtkX3DExporterWriter* writer); 00120 void WriteATexture(vtkActor *anActor, vtkX3DExporterWriter* writer); 00121 void WriteAnAppearance(vtkActor *anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer); 00122 int HasHeadLight(vtkRenderer* ren); 00123 char *FileName; 00124 double Speed; 00125 int Binary; 00126 int Fastest; 00127 00128 private: 00129 00130 vtkX3DExporter(const vtkX3DExporter&); // Not implemented. 00131 void operator=(const vtkX3DExporter&); // Not implemented. 00132 }; 00133 00134 00135 #endif