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 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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() //both cells and points are colored
00125     {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);}
00126   void SetColorModeToOff() //No color information is written
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&);  // Not implemented.
00174   void operator=(const vtkPLYWriter&);  // Not implemented.
00175 };
00176 
00177 #endif
00178 

Generated on Thu Mar 28 14:19:28 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001