VTK
vtkPLYWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPLYWriter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
37 #ifndef __vtkPLYWriter_h
38 #define __vtkPLYWriter_h
39 
40 #include "vtkIOPLYModule.h" // For export macro
41 #include "vtkPolyDataWriter.h"
42 
43 class vtkScalarsToColors;
45 
46 #define VTK_LITTLE_ENDIAN 0
47 #define VTK_BIG_ENDIAN 1
48 
49 #define VTK_COLOR_MODE_DEFAULT 0
50 #define VTK_COLOR_MODE_UNIFORM_CELL_COLOR 1
51 #define VTK_COLOR_MODE_UNIFORM_POINT_COLOR 2
52 #define VTK_COLOR_MODE_UNIFORM_COLOR 3
53 #define VTK_COLOR_MODE_OFF 4
54 
55 
56 class VTKIOPLY_EXPORT vtkPLYWriter : public vtkPolyDataWriter
57 {
58 public:
59  static vtkPLYWriter *New();
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
66  vtkSetClampMacro(DataByteOrder,int,VTK_LITTLE_ENDIAN,VTK_BIG_ENDIAN);
67  vtkGetMacro(DataByteOrder,int);
68  void SetDataByteOrderToBigEndian()
69  {this->SetDataByteOrder(VTK_BIG_ENDIAN);}
70  void SetDataByteOrderToLittleEndian()
71  {this->SetDataByteOrder(VTK_LITTLE_ENDIAN);}
73 
75 
88  vtkSetMacro(ColorMode,int);
89  vtkGetMacro(ColorMode,int);
90  void SetColorModeToDefault()
91  {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);}
92  void SetColorModeToUniformCellColor()
93  {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_CELL_COLOR);}
94  void SetColorModeToUniformPointColor()
95  {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_POINT_COLOR);}
96  void SetColorModeToUniformColor() //both cells and points are colored
97  {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);}
98  void SetColorModeToOff() //No color information is written
99  {this->SetColorMode(VTK_COLOR_MODE_OFF);}
101 
103 
104  vtkSetStringMacro(ArrayName);
105  vtkGetStringMacro(ArrayName);
107 
109 
110  vtkSetClampMacro(Component,int,0,VTK_LARGE_INTEGER);
111  vtkGetMacro(Component,int);
113 
115 
117  virtual void SetLookupTable(vtkScalarsToColors*);
118  vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
120 
122 
126  vtkSetVector3Macro(Color,unsigned char);
127  vtkGetVector3Macro(Color,unsigned char);
129 
130 protected:
131  vtkPLYWriter();
132  ~vtkPLYWriter();
133 
134  void WriteData();
135  unsigned char *GetColors(vtkIdType num, vtkDataSetAttributes *dsa);
136 
138  char *ArrayName;
142  unsigned char Color[3];
143 
144 private:
145  vtkPLYWriter(const vtkPLYWriter&); // Not implemented.
146  void operator=(const vtkPLYWriter&); // Not implemented.
147 };
148 
149 #endif
150