Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkPLYWriter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPLYWriter.h,v $
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 =========================================================================*/
00045 #ifndef __vtkPLYWriter_h
00046 #define __vtkPLYWriter_h
00047 
00048 #include "vtkPolyDataWriter.h"
00049 
00050 class vtkScalarsToColors;
00051 class vtkDataSetAttributes;
00052 
00053 #define VTK_LITTLE_ENDIAN 0
00054 #define VTK_BIG_ENDIAN    1
00055 
00056 #define VTK_COLOR_MODE_DEFAULT 0
00057 #define VTK_COLOR_MODE_UNIFORM_CELL_COLOR 1
00058 #define VTK_COLOR_MODE_UNIFORM_POINT_COLOR 2
00059 #define VTK_COLOR_MODE_UNIFORM_COLOR 3
00060 #define VTK_COLOR_MODE_OFF 4
00061 
00062 
00063 class VTK_IO_EXPORT vtkPLYWriter : public vtkPolyDataWriter
00064 {
00065 public:
00066   static vtkPLYWriter *New();
00067   vtkTypeRevisionMacro(vtkPLYWriter,vtkPolyDataWriter);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00071 
00073   vtkSetClampMacro(DataByteOrder,int,VTK_LITTLE_ENDIAN,VTK_BIG_ENDIAN);
00074   vtkGetMacro(DataByteOrder,int);
00075   void SetDataByteOrderToBigEndian()
00076     {this->SetDataByteOrder(VTK_BIG_ENDIAN);}
00077   void SetDataByteOrderToLittleEndian()
00078     {this->SetDataByteOrder(VTK_LITTLE_ENDIAN);}
00080 
00082 
00095   vtkSetMacro(ColorMode,int);
00096   vtkGetMacro(ColorMode,int);
00097   void SetColorModeToDefault() 
00098     {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);}
00099   void SetColorModeToUniformCellColor() 
00100     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_CELL_COLOR);}
00101   void SetColorModeToUniformPointColor() 
00102     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_POINT_COLOR);}
00103   void SetColorModeToUniformColor() //both cells and points are colored
00104     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);}
00105   void SetColorModeToOff() //No color information is written
00106     {this->SetColorMode(VTK_COLOR_MODE_OFF);}
00108   
00110 
00111   vtkSetStringMacro(ArrayName);
00112   vtkGetStringMacro(ArrayName);
00114   
00116 
00117   vtkSetClampMacro(Component,int,0,VTK_LARGE_INTEGER);
00118   vtkGetMacro(Component,int);
00120 
00122 
00124   virtual void SetLookupTable(vtkScalarsToColors*);
00125   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00127   
00129 
00133   vtkSetVector3Macro(Color,unsigned char);
00134   vtkGetVector3Macro(Color,unsigned char);
00136 
00137 protected:
00138   vtkPLYWriter();
00139   ~vtkPLYWriter();
00140 
00141   void WriteData();
00142   unsigned char *GetColors(vtkIdType num, vtkDataSetAttributes *dsa);
00143   
00144   int DataByteOrder;
00145   char *ArrayName;
00146   int Component;
00147   int ColorMode;
00148   vtkScalarsToColors *LookupTable;
00149   unsigned char Color[3];
00150 
00151 private:
00152   vtkPLYWriter(const vtkPLYWriter&);  // Not implemented.
00153   void operator=(const vtkPLYWriter&);  // Not implemented.
00154 };
00155 
00156 #endif
00157