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 "vtkIOExportModule.h" // For export macro 00033 #include "vtkExporter.h" 00034 00035 class vtkLight; 00036 class vtkActor; 00037 class vtkActor2D; 00038 class vtkPoints; 00039 class vtkDataArray; 00040 class vtkUnsignedCharArray; 00041 class vtkX3DExporterWriter; 00042 class vtkRenderer; 00043 00044 class VTKIOEXPORT_EXPORT vtkX3DExporter : public vtkExporter 00045 { 00046 public: 00047 static vtkX3DExporter *New(); 00048 vtkTypeMacro(vtkX3DExporter,vtkExporter); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 00053 vtkSetStringMacro(FileName); 00054 vtkGetStringMacro(FileName); 00056 00058 00059 vtkSetMacro(Speed,double); 00060 vtkGetMacro(Speed,double); 00062 00064 00065 vtkSetClampMacro(Binary, int, 0, 1); 00066 vtkBooleanMacro(Binary, int); 00067 vtkGetMacro(Binary, int); 00069 00071 00072 vtkSetClampMacro(Fastest, int, 0, 1); 00073 vtkBooleanMacro(Fastest, int); 00074 vtkGetMacro(Fastest, int); 00076 00078 00079 vtkSetMacro(WriteToOutputString,int); 00080 vtkGetMacro(WriteToOutputString,int); 00081 vtkBooleanMacro(WriteToOutputString,int); 00083 00085 00088 vtkGetMacro(OutputStringLength, int); 00089 vtkGetStringMacro(OutputString); 00090 unsigned char *GetBinaryOutputString() 00091 { 00092 return reinterpret_cast<unsigned char *>(this->OutputString); 00093 } 00095 00099 char *RegisterAndGetOutputString(); 00100 00101 protected: 00102 vtkX3DExporter(); 00103 ~vtkX3DExporter(); 00104 00105 // Stream management 00106 int WriteToOutputString; 00107 char *OutputString; 00108 int OutputStringLength; 00109 00111 void WriteData(); 00112 00113 void WriteALight(vtkLight *aLight, vtkX3DExporterWriter* writer); 00114 void WriteAnActor(vtkActor *anActor, vtkX3DExporterWriter* writer, 00115 int index); 00116 void WritePointData(vtkPoints *points, vtkDataArray *normals, 00117 vtkDataArray *tcoords, vtkUnsignedCharArray *colors, 00118 vtkX3DExporterWriter* writer, int index); 00119 void WriteATextActor2D(vtkActor2D *anTextActor2D, 00120 vtkX3DExporterWriter* writer); 00121 void WriteATexture(vtkActor *anActor, vtkX3DExporterWriter* writer); 00122 void WriteAnAppearance(vtkActor *anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer); 00123 int HasHeadLight(vtkRenderer* ren); 00124 char *FileName; 00125 double Speed; 00126 int Binary; 00127 int Fastest; 00128 00129 private: 00130 00131 vtkX3DExporter(const vtkX3DExporter&); // Not implemented. 00132 void operator=(const vtkX3DExporter&); // Not implemented. 00133 }; 00134 00135 00136 #endif