Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

IO/vtkPLYWriter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPLYWriter.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00049 #ifndef __vtkPLYWriter_h
00050 #define __vtkPLYWriter_h
00051 
00052 #include "vtkPolyDataWriter.h"
00053 
00054 class vtkScalarsToColors;
00055 class vtkDataSetAttributes;
00056 
00057 #define VTK_LITTLE_ENDIAN 0
00058 #define VTK_BIG_ENDIAN    1
00059 
00060 #define VTK_COLOR_MODE_DEFAULT 0
00061 #define VTK_COLOR_MODE_UNIFORM_CELL_COLOR 1
00062 #define VTK_COLOR_MODE_UNIFORM_POINT_COLOR 2
00063 #define VTK_COLOR_MODE_UNIFORM_COLOR 3
00064 #define VTK_COLOR_MODE_OFF 4
00065 
00066 
00067 class VTK_IO_EXPORT vtkPLYWriter : public vtkPolyDataWriter
00068 {
00069 public:
00070   static vtkPLYWriter *New();
00071   vtkTypeRevisionMacro(vtkPLYWriter,vtkPolyDataWriter);
00072   void PrintSelf(ostream& os, vtkIndent indent);
00073 
00075 
00077   vtkSetClampMacro(DataByteOrder,int,VTK_LITTLE_ENDIAN,VTK_BIG_ENDIAN);
00078   vtkGetMacro(DataByteOrder,int);
00079   void SetDataByteOrderToBigEndian()
00080     {this->SetDataByteOrder(VTK_BIG_ENDIAN);}
00081   void SetDataByteOrderToLittleEndian()
00082     {this->SetDataByteOrder(VTK_LITTLE_ENDIAN);}
00084 
00086 
00099   vtkSetMacro(ColorMode,int);
00100   vtkGetMacro(ColorMode,int);
00101   void SetColorModeToDefault() 
00102     {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);}
00103   void SetColorModeToUniformCellColor() 
00104     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_CELL_COLOR);}
00105   void SetColorModeToUniformPointColor() 
00106     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_POINT_COLOR);}
00107   void SetColorModeToUniformColor() //both cells and points are colored
00108     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);}
00109   void SetColorModeToOff() //No color information is written
00110     {this->SetColorMode(VTK_COLOR_MODE_OFF);}
00112   
00114 
00115   vtkSetStringMacro(ArrayName);
00116   vtkGetStringMacro(ArrayName);
00118   
00120 
00121   vtkSetClampMacro(Component,int,0,VTK_LARGE_INTEGER);
00122   vtkGetMacro(Component,int);
00124 
00126 
00128   virtual void SetLookupTable(vtkScalarsToColors*);
00129   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00131   
00133 
00137   vtkSetVector3Macro(Color,unsigned char);
00138   vtkGetVector3Macro(Color,unsigned char);
00140 
00141 protected:
00142   vtkPLYWriter();
00143   ~vtkPLYWriter();
00144 
00145   void WriteData();
00146   unsigned char *GetColors(vtkIdType num, vtkDataSetAttributes *dsa);
00147   
00148   int DataByteOrder;
00149   char *ArrayName;
00150   int Component;
00151   int ColorMode;
00152   vtkScalarsToColors *LookupTable;
00153   unsigned char Color[3];
00154 
00155 private:
00156   vtkPLYWriter(const vtkPLYWriter&);  // Not implemented.
00157   void operator=(const vtkPLYWriter&);  // Not implemented.
00158 };
00159 
00160 #endif
00161