VTK
dox/IO/vtkPLYWriter.h
Go to the documentation of this file.
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 "vtkPolyDataWriter.h"
00041 
00042 class vtkScalarsToColors;
00043 class vtkDataSetAttributes;
00044 
00045 #define VTK_LITTLE_ENDIAN 0
00046 #define VTK_BIG_ENDIAN    1
00047 
00048 #define VTK_COLOR_MODE_DEFAULT 0
00049 #define VTK_COLOR_MODE_UNIFORM_CELL_COLOR 1
00050 #define VTK_COLOR_MODE_UNIFORM_POINT_COLOR 2
00051 #define VTK_COLOR_MODE_UNIFORM_COLOR 3
00052 #define VTK_COLOR_MODE_OFF 4
00053 
00054 
00055 class VTK_IO_EXPORT vtkPLYWriter : public vtkPolyDataWriter
00056 {
00057 public:
00058   static vtkPLYWriter *New();
00059   vtkTypeMacro(vtkPLYWriter,vtkPolyDataWriter);
00060   void PrintSelf(ostream& os, vtkIndent indent);
00061 
00063 
00065   vtkSetClampMacro(DataByteOrder,int,VTK_LITTLE_ENDIAN,VTK_BIG_ENDIAN);
00066   vtkGetMacro(DataByteOrder,int);
00067   void SetDataByteOrderToBigEndian()
00068     {this->SetDataByteOrder(VTK_BIG_ENDIAN);}
00069   void SetDataByteOrderToLittleEndian()
00070     {this->SetDataByteOrder(VTK_LITTLE_ENDIAN);}
00072 
00074 
00087   vtkSetMacro(ColorMode,int);
00088   vtkGetMacro(ColorMode,int);
00089   void SetColorModeToDefault() 
00090     {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);}
00091   void SetColorModeToUniformCellColor() 
00092     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_CELL_COLOR);}
00093   void SetColorModeToUniformPointColor() 
00094     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_POINT_COLOR);}
00095   void SetColorModeToUniformColor() //both cells and points are colored
00096     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);}
00097   void SetColorModeToOff() //No color information is written
00098     {this->SetColorMode(VTK_COLOR_MODE_OFF);}
00100   
00102 
00103   vtkSetStringMacro(ArrayName);
00104   vtkGetStringMacro(ArrayName);
00106   
00108 
00109   vtkSetClampMacro(Component,int,0,VTK_LARGE_INTEGER);
00110   vtkGetMacro(Component,int);
00112 
00114 
00116   virtual void SetLookupTable(vtkScalarsToColors*);
00117   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00119   
00121 
00125   vtkSetVector3Macro(Color,unsigned char);
00126   vtkGetVector3Macro(Color,unsigned char);
00128 
00129 protected:
00130   vtkPLYWriter();
00131   ~vtkPLYWriter();
00132 
00133   void WriteData();
00134   unsigned char *GetColors(vtkIdType num, vtkDataSetAttributes *dsa);
00135   
00136   int DataByteOrder;
00137   char *ArrayName;
00138   int Component;
00139   int ColorMode;
00140   vtkScalarsToColors *LookupTable;
00141   unsigned char Color[3];
00142 
00143 private:
00144   vtkPLYWriter(const vtkPLYWriter&);  // Not implemented.
00145   void operator=(const vtkPLYWriter&);  // Not implemented.
00146 };
00147 
00148 #endif
00149