VTK  9.2.6
vtkMNIObjectWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMNIObjectWriter.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=========================================================================*/
15/*=========================================================================
16
17Copyright (c) 2006 Atamai, Inc.
18
19Use, modification and redistribution of the software, in source or
20binary forms, are permitted provided that the following terms and
21conditions are met:
22
231) Redistribution of the source code, in verbatim or modified
24 form, must retain the above copyright notice, this license,
25 the following disclaimer, and any notices that refer to this
26 license and/or the following disclaimer.
27
282) Redistribution in binary form must include the above copyright
29 notice, a copy of this license and the following disclaimer
30 in the documentation or with other materials provided with the
31 distribution.
32
333) Modified copies of the source code must be clearly marked as such,
34 and must not be misrepresented as verbatim copies of the source code.
35
36THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42(INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45POSSIBILITY OF SUCH DAMAGES.
46
47=========================================================================*/
68#ifndef vtkMNIObjectWriter_h
69#define vtkMNIObjectWriter_h
70
71#include "vtkIOMINCModule.h" // For export macro
72#include "vtkWriter.h"
73
74class vtkMapper;
75class vtkProperty;
76class vtkLookupTable;
77class vtkPolyData;
78class vtkFloatArray;
79class vtkIntArray;
80class vtkPoints;
81
82class VTKIOMINC_EXPORT vtkMNIObjectWriter : public vtkWriter
83{
84public:
86
88 void PrintSelf(ostream& os, vtkIndent indent) override;
89
93 virtual const char* GetFileExtensions() { return ".obj"; }
94
98 virtual const char* GetDescriptiveName() { return "MNI object"; }
99
101
105 virtual void SetProperty(vtkProperty* property);
106 virtual vtkProperty* GetProperty() { return this->Property; }
108
110
115 virtual void SetMapper(vtkMapper* mapper);
116 virtual vtkMapper* GetMapper() { return this->Mapper; }
118
120
124 virtual void SetLookupTable(vtkLookupTable* table);
125 virtual vtkLookupTable* GetLookupTable() { return this->LookupTable; }
127
129
135
137
143
145
148 vtkSetClampMacro(FileType, int, VTK_ASCII, VTK_BINARY);
149 vtkGetMacro(FileType, int);
150 void SetFileTypeToASCII() { this->SetFileType(VTK_ASCII); }
151 void SetFileTypeToBinary() { this->SetFileType(VTK_BINARY); }
153
154protected:
157
161
162 ostream* OutputStream;
163
164 int WriteObjectType(int objType);
168
171 int WritePoints(vtkPolyData* polyData);
172 int WriteNormals(vtkPolyData* polyData);
173 int WriteColors(vtkProperty* property, vtkMapper* mapper, vtkPolyData* data);
174 int WriteCells(vtkPolyData* data, int cellType);
175
178
179 void WriteData() override;
180
181 char* FileName;
182
184
185 int FillInputPortInformation(int port, vtkInformation* info) override;
186
187 ostream* OpenFile();
188 void CloseFile(ostream* fp);
189
190private:
191 vtkMNIObjectWriter(const vtkMNIObjectWriter&) = delete;
192 void operator=(const vtkMNIObjectWriter&) = delete;
193};
194
195#endif
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:40
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition vtkIntArray.h:46
map scalar values into colors via a lookup table
A writer for MNI surface mesh files.
virtual const char * GetFileExtensions()
Get the extension for this file format.
virtual vtkLookupTable * GetLookupTable()
Set the lookup table associated with the object.
virtual const char * GetDescriptiveName()
Get the name of this file format.
virtual vtkMapper * GetMapper()
Set the mapper associated with the object.
virtual vtkProperty * GetProperty()
Set the property associated with the object.
virtual void SetMapper(vtkMapper *mapper)
Set the mapper associated with the object.
int WriteLineObject(vtkPolyData *output)
int WritePolygonObject(vtkPolyData *output)
int WriteObjectType(int objType)
int WriteNormals(vtkPolyData *polyData)
ostream * OpenFile()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int WriteProperty(vtkProperty *property)
vtkPolyData * GetInput()
Get the input to this writer.
virtual void SetProperty(vtkProperty *property)
Set the property associated with the object.
void SetFileTypeToBinary()
Specify file type (ASCII or BINARY) for vtk data file.
virtual void SetLookupTable(vtkLookupTable *table)
Set the lookup table associated with the object.
~vtkMNIObjectWriter() override
int WritePoints(vtkPolyData *polyData)
void WriteData() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkMNIObjectWriter * New()
int WriteValues(vtkDataArray *array)
int WriteIdValue(vtkIdType value)
int WriteLineThickness(vtkProperty *property)
vtkSetFilePathMacro(FileName)
Specify file name of vtk polygon data file to write.
vtkGetFilePathMacro(FileName)
Specify file name of vtk polygon data file to write.
void CloseFile(ostream *fp)
void SetFileTypeToASCII()
Specify file type (ASCII or BINARY) for vtk data file.
vtkPolyData * GetInput(int port)
Get the input to this writer.
int WriteCells(vtkPolyData *data, int cellType)
int WriteColors(vtkProperty *property, vtkMapper *mapper, vtkPolyData *data)
vtkLookupTable * LookupTable
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:88
represent and manipulate 3D points
Definition vtkPoints.h:40
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:91
represent surface properties of a geometric object
Definition vtkProperty.h:68
abstract class to write data to file(s)
Definition vtkWriter.h:46
int vtkIdType
Definition vtkType.h:332
#define VTK_BINARY
Definition vtkWriter.h:43
#define VTK_ASCII
Definition vtkWriter.h:42