00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00067 #ifndef __vtkPLYWriter_h
00068 #define __vtkPLYWriter_h
00069
00070 #include "vtkPolyDataWriter.h"
00071 #include "vtkPolyData.h"
00072 #include "vtkScalarsToColors.h"
00073
00074 #define VTK_LITTLE_ENDIAN 0
00075 #define VTK_BIG_ENDIAN 1
00076
00077 #define VTK_COLOR_MODE_DEFAULT 0
00078 #define VTK_COLOR_MODE_UNIFORM_CELL_COLOR 1
00079 #define VTK_COLOR_MODE_UNIFORM_POINT_COLOR 2
00080 #define VTK_COLOR_MODE_UNIFORM_COLOR 3
00081 #define VTK_COLOR_MODE_OFF 4
00082
00083
00084 class VTK_IO_EXPORT vtkPLYWriter : public vtkPolyDataWriter
00085 {
00086 public:
00087 static vtkPLYWriter *New();
00088 vtkTypeMacro(vtkPLYWriter,vtkPolyDataWriter);
00089 void PrintSelf(ostream& os, vtkIndent indent);
00090
00092
00094 vtkSetClampMacro(DataByteOrder,int,VTK_LITTLE_ENDIAN,VTK_BIG_ENDIAN);
00095 vtkGetMacro(DataByteOrder,int);
00096 void SetDataByteOrderToBigEndian()
00097 {this->SetDataByteOrder(VTK_BIG_ENDIAN);}
00098 void SetDataByteOrderToLittleEndian()
00099 {this->SetDataByteOrder(VTK_LITTLE_ENDIAN);}
00101
00103
00116 vtkSetMacro(ColorMode,int);
00117 vtkGetMacro(ColorMode,int);
00118 void SetColorModeToDefault()
00119 {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);}
00120 void SetColorModeToUniformCellColor()
00121 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_CELL_COLOR);}
00122 void SetColorModeToUniformPointColor()
00123 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_POINT_COLOR);}
00124 void SetColorModeToUniformColor()
00125 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);}
00126 void SetColorModeToOff()
00127 {this->SetColorMode(VTK_COLOR_MODE_OFF);}
00129
00131
00132 vtkSetStringMacro(ArrayName);
00133 vtkGetStringMacro(ArrayName);
00135
00137
00138 vtkSetClampMacro(Component,int,0,VTK_LARGE_INTEGER);
00139 vtkGetMacro(Component,int);
00141
00143
00145 vtkSetObjectMacro(LookupTable,vtkScalarsToColors);
00146 vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00148
00150
00154 vtkSetVector3Macro(Color,unsigned char);
00155 vtkGetVector3Macro(Color,unsigned char);
00157
00158 protected:
00159 vtkPLYWriter();
00160 ~vtkPLYWriter();
00161
00162 void WriteData();
00163 unsigned char *GetColors(vtkIdType num, vtkDataSetAttributes *dsa);
00164
00165 int DataByteOrder;
00166 char *ArrayName;
00167 int Component;
00168 int ColorMode;
00169 vtkScalarsToColors *LookupTable;
00170 unsigned char Color[3];
00171
00172 private:
00173 vtkPLYWriter(const vtkPLYWriter&);
00174 void operator=(const vtkPLYWriter&);
00175 };
00176
00177 #endif
00178