VTK  9.3.20240420
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
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;
38
39class VTKIOMINC_EXPORT vtkMNIObjectWriter : public vtkWriter
40{
41public:
43
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
50 virtual const char* GetFileExtensions() { return ".obj"; }
51
55 virtual const char* GetDescriptiveName() { return "MNI object"; }
56
58
62 virtual void SetProperty(vtkProperty* property);
63 virtual vtkProperty* GetProperty() { return this->Property; }
65
67
72 virtual void SetMapper(vtkMapper* mapper);
73 virtual vtkMapper* GetMapper() { return this->Mapper; }
75
77
81 virtual void SetLookupTable(vtkLookupTable* table);
82 virtual vtkLookupTable* GetLookupTable() { return this->LookupTable; }
84
86
92
94
100
102
105 vtkSetClampMacro(FileType, int, VTK_ASCII, VTK_BINARY);
106 vtkGetMacro(FileType, int);
107 void SetFileTypeToASCII() { this->SetFileType(VTK_ASCII); }
108 void SetFileTypeToBinary() { this->SetFileType(VTK_BINARY); }
110
111protected:
114
118
119 ostream* OutputStream;
120
121 int WriteObjectType(int objType);
125
128 int WritePoints(vtkPolyData* polyData);
129 int WriteNormals(vtkPolyData* polyData);
130 int WriteColors(vtkProperty* property, vtkMapper* mapper, vtkPolyData* data);
131 int WriteCells(vtkPolyData* data, int cellType);
132
135
136 void WriteData() override;
137
138 char* FileName;
139
141
142 int FillInputPortInformation(int port, vtkInformation* info) override;
143
144 ostream* OpenFile();
145 void CloseFile(ostream* fp);
146
147private:
148 vtkMNIObjectWriter(const vtkMNIObjectWriter&) = delete;
149 void operator=(const vtkMNIObjectWriter&) = delete;
150};
151
152VTK_ABI_NAMESPACE_END
153#endif
abstract superclass for arrays of numeric data
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
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:137
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
abstract class to write data to file(s)
Definition vtkWriter.h:35
int vtkIdType
Definition vtkType.h:315
#define VTK_BINARY
Definition vtkWriter.h:32
#define VTK_ASCII
Definition vtkWriter.h:31