VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPLYWriter.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 =========================================================================*/ 00037 #ifndef vtkPLYWriter_h 00038 #define vtkPLYWriter_h 00039 00040 #include "vtkIOPLYModule.h" // For export macro 00041 #include "vtkWriter.h" 00042 00043 class vtkScalarsToColors; 00044 class vtkDataSetAttributes; 00045 00046 #define VTK_LITTLE_ENDIAN 0 00047 #define VTK_BIG_ENDIAN 1 00048 00049 #define VTK_COLOR_MODE_DEFAULT 0 00050 #define VTK_COLOR_MODE_UNIFORM_CELL_COLOR 1 00051 #define VTK_COLOR_MODE_UNIFORM_POINT_COLOR 2 00052 #define VTK_COLOR_MODE_UNIFORM_COLOR 3 00053 #define VTK_COLOR_MODE_OFF 4 00054 00055 class vtkPolyData; 00056 00057 class VTKIOPLY_EXPORT vtkPLYWriter : public vtkWriter 00058 { 00059 public: 00060 static vtkPLYWriter *New(); 00061 vtkTypeMacro(vtkPLYWriter,vtkWriter); 00062 void PrintSelf(ostream& os, vtkIndent indent); 00063 00065 00067 vtkSetClampMacro(DataByteOrder,int,VTK_LITTLE_ENDIAN,VTK_BIG_ENDIAN); 00068 vtkGetMacro(DataByteOrder,int); 00069 void SetDataByteOrderToBigEndian() 00070 {this->SetDataByteOrder(VTK_BIG_ENDIAN);} 00071 void SetDataByteOrderToLittleEndian() 00072 {this->SetDataByteOrder(VTK_LITTLE_ENDIAN);} 00074 00076 00089 vtkSetMacro(ColorMode,int); 00090 vtkGetMacro(ColorMode,int); 00091 void SetColorModeToDefault() 00092 {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);} 00093 void SetColorModeToUniformCellColor() 00094 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_CELL_COLOR);} 00095 void SetColorModeToUniformPointColor() 00096 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_POINT_COLOR);} 00097 void SetColorModeToUniformColor() //both cells and points are colored 00098 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);} 00099 void SetColorModeToOff() //No color information is written 00100 {this->SetColorMode(VTK_COLOR_MODE_OFF);} 00102 00104 00105 vtkSetStringMacro(ArrayName); 00106 vtkGetStringMacro(ArrayName); 00108 00110 00111 vtkSetClampMacro(Component,int,0,VTK_INT_MAX); 00112 vtkGetMacro(Component,int); 00114 00116 00118 virtual void SetLookupTable(vtkScalarsToColors*); 00119 vtkGetObjectMacro(LookupTable,vtkScalarsToColors); 00121 00123 00127 vtkSetVector3Macro(Color,unsigned char); 00128 vtkGetVector3Macro(Color,unsigned char); 00130 00132 00133 vtkPolyData* GetInput(); 00134 vtkPolyData* GetInput(int port); 00136 00138 00139 vtkSetStringMacro(FileName); 00140 vtkGetStringMacro(FileName); 00142 00144 00145 vtkSetClampMacro(FileType,int,VTK_ASCII,VTK_BINARY); 00146 vtkGetMacro(FileType,int); 00147 void SetFileTypeToASCII() {this->SetFileType(VTK_ASCII);}; 00148 void SetFileTypeToBinary() {this->SetFileType(VTK_BINARY);}; 00150 00151 protected: 00152 vtkPLYWriter(); 00153 ~vtkPLYWriter(); 00154 00155 void WriteData(); 00156 unsigned char *GetColors(vtkIdType num, vtkDataSetAttributes *dsa); 00157 00158 int DataByteOrder; 00159 char *ArrayName; 00160 int Component; 00161 int ColorMode; 00162 vtkScalarsToColors *LookupTable; 00163 unsigned char Color[3]; 00164 00165 char* FileName; 00166 00167 int FileType; 00168 00169 virtual int FillInputPortInformation(int port, vtkInformation *info); 00170 00171 private: 00172 vtkPLYWriter(const vtkPLYWriter&); // Not implemented. 00173 void operator=(const vtkPLYWriter&); // Not implemented. 00174 }; 00175 00176 #endif 00177