VTK  9.5.20251218
vtkMNIObjectWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) 2006 Atamai, Inc.
3// SPDX-License-Identifier: BSD-3-Clause
23
24#ifndef vtkMNIObjectWriter_h
25#define vtkMNIObjectWriter_h
26
27#include "vtkIOMINCModule.h" // For export macro
28#include "vtkWriter.h"
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkMapper;
32class vtkProperty;
33class vtkLookupTable;
34class vtkPolyData;
35class vtkFloatArray;
36class vtkIntArray;
37class vtkPoints;
38struct vtkMNIObjectWriterFunctor;
39
40class VTKIOMINC_EXPORT vtkMNIObjectWriter : public vtkWriter
41{
42public:
44
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
51 virtual const char* GetFileExtensions() { return ".obj"; }
52
56 virtual const char* GetDescriptiveName() { return "MNI object"; }
57
59
63 virtual void SetProperty(vtkProperty* property);
64 virtual vtkProperty* GetProperty() { return this->Property; }
66
68
73 virtual void SetMapper(vtkMapper* mapper);
74 virtual vtkMapper* GetMapper() { return this->Mapper; }
76
78
82 virtual void SetLookupTable(vtkLookupTable* table);
83 virtual vtkLookupTable* GetLookupTable() { return this->LookupTable; }
85
87
93
95
101
103
106 vtkSetClampMacro(FileType, int, VTK_ASCII, VTK_BINARY);
107 vtkGetMacro(FileType, int);
111
112protected:
115
119
120 ostream* OutputStream;
121
122 int WriteObjectType(int objType);
126
129 int WritePoints(vtkPolyData* polyData);
130 int WriteNormals(vtkPolyData* polyData);
131 int WriteColors(vtkProperty* property, vtkMapper* mapper, vtkPolyData* data);
132 int WriteCells(vtkPolyData* data, int cellType);
133
136
137 void WriteData() override;
138
139 char* FileName;
140
142
143 int FillInputPortInformation(int port, vtkInformation* info) override;
144
145 ostream* OpenFile();
146 void CloseFile(ostream* fp);
147
148private:
149 vtkMNIObjectWriter(const vtkMNIObjectWriter&) = delete;
150 void operator=(const vtkMNIObjectWriter&) = delete;
151
153};
154
155VTK_ABI_NAMESPACE_END
156#endif
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
map scalar values into colors via a lookup table
virtual const char * GetFileExtensions()
Get the extension for this file format.
virtual vtkLookupTable * GetLookupTable()
Set the lookup table associated with the object.
friend struct vtkMNIObjectWriterFunctor
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)
virtual void SetFileType(int)
Specify file type (ASCII or BINARY) for vtk data file.
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:98
represent and manipulate 3D points
Definition vtkPoints.h:139
concrete dataset represents vertices, lines, polygons, and triangle strips
represent surface properties of a geometric object
#define vtkDataArray
int vtkIdType
Definition vtkType.h:368
#define VTK_BINARY
Definition vtkWriter.h:33
#define VTK_ASCII
Definition vtkWriter.h:32