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 "vtkPolyDataWriter.h"
41 
42 class vtkScalarsToColors;
44 
45 #define VTK_LITTLE_ENDIAN 0
46 #define VTK_BIG_ENDIAN 1
47 
48 #define VTK_COLOR_MODE_DEFAULT 0
49 #define VTK_COLOR_MODE_UNIFORM_CELL_COLOR 1
50 #define VTK_COLOR_MODE_UNIFORM_POINT_COLOR 2
51 #define VTK_COLOR_MODE_UNIFORM_COLOR 3
52 #define VTK_COLOR_MODE_OFF 4
53 
54 
56 {
57 public:
58  static vtkPLYWriter *New();
60  void PrintSelf(ostream& os, vtkIndent indent);
61 
63 
65  vtkSetClampMacro(DataByteOrder,int,VTK_LITTLE_ENDIAN,VTK_BIG_ENDIAN);
66  vtkGetMacro(DataByteOrder,int);
67  void SetDataByteOrderToBigEndian()
68  {this->SetDataByteOrder(VTK_BIG_ENDIAN);}
69  void SetDataByteOrderToLittleEndian()
70  {this->SetDataByteOrder(VTK_LITTLE_ENDIAN);}
72 
74 
87  vtkSetMacro(ColorMode,int);
88  vtkGetMacro(ColorMode,int);
89  void SetColorModeToDefault()
90  {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);}
91  void SetColorModeToUniformCellColor()
92  {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_CELL_COLOR);}
93  void SetColorModeToUniformPointColor()
94  {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_POINT_COLOR);}
95  void SetColorModeToUniformColor() //both cells and points are colored
96  {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);}
97  void SetColorModeToOff() //No color information is written
98  {this->SetColorMode(VTK_COLOR_MODE_OFF);}
100 
102 
103  vtkSetStringMacro(ArrayName);
104  vtkGetStringMacro(ArrayName);
106 
108 
109  vtkSetClampMacro(Component,int,0,VTK_LARGE_INTEGER);
110  vtkGetMacro(Component,int);
112 
114 
116  virtual void SetLookupTable(vtkScalarsToColors*);
117  vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
119 
121 
125  vtkSetVector3Macro(Color,unsigned char);
126  vtkGetVector3Macro(Color,unsigned char);
128 
129 protected:
130  vtkPLYWriter();
131  ~vtkPLYWriter();
132 
133  void WriteData();
134  unsigned char *GetColors(vtkIdType num, vtkDataSetAttributes *dsa);
135 
137  char *ArrayName;
141  unsigned char Color[3];
142 
143 private:
144  vtkPLYWriter(const vtkPLYWriter&); // Not implemented.
145  void operator=(const vtkPLYWriter&); // Not implemented.
146 };
147 
148 #endif
149