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=========================================================================*/
38#ifndef vtkPLYWriter_h
39#define vtkPLYWriter_h
40
41#include "vtkIOPLYModule.h" // For export macro
42#include "vtkSmartPointer.h" // For protected ivars
43#include "vtkWriter.h"
44
45#include <string> // For string parameter
46
48class vtkPolyData;
50class vtkStringArray;
51
52#define VTK_LITTLE_ENDIAN 0
53#define VTK_BIG_ENDIAN 1
54
55#define VTK_COLOR_MODE_DEFAULT 0
56#define VTK_COLOR_MODE_UNIFORM_CELL_COLOR 1
57#define VTK_COLOR_MODE_UNIFORM_POINT_COLOR 2
58#define VTK_COLOR_MODE_UNIFORM_COLOR 3
59#define VTK_COLOR_MODE_OFF 4
60
61#define VTK_TEXTURECOORDS_UV 0
62#define VTK_TEXTURECOORDS_TEXTUREUV 1
63
64class VTKIOPLY_EXPORT vtkPLYWriter : public vtkWriter
65{
66public:
67 static vtkPLYWriter *New();
68 vtkTypeMacro(vtkPLYWriter,vtkWriter);
69 void PrintSelf(ostream& os, vtkIndent indent);
70
72
76 vtkSetClampMacro(DataByteOrder,int,VTK_LITTLE_ENDIAN,VTK_BIG_ENDIAN);
77 vtkGetMacro(DataByteOrder,int);
79 {this->SetDataByteOrder(VTK_BIG_ENDIAN);}
81 {this->SetDataByteOrder(VTK_LITTLE_ENDIAN);}
83
85
102 vtkSetMacro(ColorMode,int);
103 vtkGetMacro(ColorMode,int);
105 {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);}
107 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_CELL_COLOR);}
109 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_POINT_COLOR);}
110 void SetColorModeToUniformColor() //both cells and points are colored
111 {this->SetColorMode(VTK_COLOR_MODE_UNIFORM_COLOR);}
112 void SetColorModeToOff() //No color information is written
113 {this->SetColorMode(VTK_COLOR_MODE_OFF);}
115
117
120 vtkSetStringMacro(ArrayName);
123
125
128 vtkSetClampMacro(Component,int,0,VTK_INT_MAX);
129 vtkGetMacro(Component,int);
131
133
138 vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
140
142
148 vtkSetVector3Macro(Color,unsigned char);
149 vtkGetVector3Macro(Color,unsigned char);
151
153
159
161
164 vtkSetStringMacro(FileName);
167
169
172 vtkSetClampMacro(FileType,int,VTK_ASCII,VTK_BINARY);
173 vtkGetMacro(FileType,int);
174 void SetFileTypeToASCII() {this->SetFileType(VTK_ASCII);};
175 void SetFileTypeToBinary() {this->SetFileType(VTK_BINARY);};
177
179
183 vtkSetClampMacro(TextureCoordinatesName,int,VTK_TEXTURECOORDS_UV, VTK_TEXTURECOORDS_TEXTUREUV);
184 vtkGetMacro(TextureCoordinatesName,int);
186 {this->SetTextureCoordinatesName(VTK_TEXTURECOORDS_UV);}
188 {this->SetTextureCoordinatesName(VTK_TEXTURECOORDS_TEXTUREUV);}
190
194 void AddComment(const std::string &comment);
195
196protected:
199
200 void WriteData();
201 unsigned char *GetColors(vtkIdType num, vtkDataSetAttributes *dsa);
203
209 unsigned char Color[3];
210
211 char* FileName;
212
215
217
219
220private:
221 vtkPLYWriter(const vtkPLYWriter&) VTK_DELETE_FUNCTION;
222 void operator=(const vtkPLYWriter&) VTK_DELETE_FUNCTION;
223};
224
225#endif
226
represent and manipulate attribute data in a dataset
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
write Stanford PLY file format
Definition: vtkPLYWriter.h:65
char * FileName
Definition: vtkPLYWriter.h:211
void SetDataByteOrderToLittleEndian()
Definition: vtkPLYWriter.h:80
void SetColorModeToUniformCellColor()
Definition: vtkPLYWriter.h:106
void SetFileTypeToASCII()
Definition: vtkPLYWriter.h:174
void SetColorModeToUniformColor()
Definition: vtkPLYWriter.h:110
void SetFileTypeToBinary()
Definition: vtkPLYWriter.h:175
void SetDataByteOrderToBigEndian()
Definition: vtkPLYWriter.h:78
vtkPolyData * GetInput(int port)
void AddComment(const std::string &comment)
Add a comment in the header part.
char * ArrayName
Definition: vtkPLYWriter.h:205
const float * GetTextureCoordinates(vtkIdType num, vtkDataSetAttributes *dsa)
vtkPolyData * GetInput()
Get the input to this writer.
vtkScalarsToColors * LookupTable
Definition: vtkPLYWriter.h:208
void SetTextureCoordinatesNameToUV()
Definition: vtkPLYWriter.h:185
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetColorModeToDefault()
Definition: vtkPLYWriter.h:104
unsigned char * GetColors(vtkIdType num, vtkDataSetAttributes *dsa)
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
void SetColorModeToUniformPointColor()
Definition: vtkPLYWriter.h:108
int TextureCoordinatesName
Definition: vtkPLYWriter.h:214
static vtkPLYWriter * New()
virtual void SetLookupTable(vtkScalarsToColors *)
A lookup table can be specified in order to convert data arrays to RGBA colors.
void SetTextureCoordinatesNameToTextureUV()
Definition: vtkPLYWriter.h:187
vtkSmartPointer< vtkStringArray > HeaderComments
Definition: vtkPLYWriter.h:216
void SetColorModeToOff()
Definition: vtkPLYWriter.h:112
void WriteData()
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
Superclass for mapping scalar values to colors.
a vtkAbstractArray subclass for strings
abstract class to write data to file(s)
Definition: vtkWriter.h:43
@ Color
Definition: vtkX3D.h:46
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ string
Definition: vtkX3D.h:490
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
#define VTK_LITTLE_ENDIAN
Definition: vtkPLYWriter.h:52
#define VTK_COLOR_MODE_DEFAULT
Definition: vtkPLYWriter.h:55
#define VTK_COLOR_MODE_OFF
Definition: vtkPLYWriter.h:59
#define VTK_COLOR_MODE_UNIFORM_POINT_COLOR
Definition: vtkPLYWriter.h:57
#define VTK_TEXTURECOORDS_UV
Definition: vtkPLYWriter.h:61
#define VTK_COLOR_MODE_UNIFORM_COLOR
Definition: vtkPLYWriter.h:58
#define VTK_BIG_ENDIAN
Definition: vtkPLYWriter.h:53
#define VTK_COLOR_MODE_UNIFORM_CELL_COLOR
Definition: vtkPLYWriter.h:56
#define VTK_TEXTURECOORDS_TEXTUREUV
Definition: vtkPLYWriter.h:62
int vtkIdType
Definition: vtkType.h:287
#define VTK_INT_MAX
Definition: vtkType.h:153
#define VTK_BINARY
Definition: vtkWriter.h:40
#define VTK_ASCII
Definition: vtkWriter.h:39