VTK  9.3.0
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 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkMapper;
32 class vtkProperty;
33 class vtkLookupTable;
34 class vtkPolyData;
35 class vtkFloatArray;
36 class vtkIntArray;
37 class vtkPoints;
38 
39 class VTKIOMINC_EXPORT vtkMNIObjectWriter : public vtkWriter
40 {
41 public:
42  vtkTypeMacro(vtkMNIObjectWriter, vtkWriter);
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 
111 protected:
114 
118 
119  ostream* OutputStream;
120 
121  int WriteObjectType(int objType);
125 
126  int WriteProperty(vtkProperty* property);
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 
140  int FileType;
141 
143 
144  ostream* OpenFile();
145  void CloseFile(ostream* fp);
146 
147 private:
148  vtkMNIObjectWriter(const vtkMNIObjectWriter&) = delete;
149  void operator=(const vtkMNIObjectWriter&) = delete;
150 };
151 
152 VTK_ABI_NAMESPACE_END
153 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:45
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:31
a simple class to control print indentation
Definition: vtkIndent.h:29
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:35
map scalar values into colors via a lookup table
A writer for MNI surface mesh files.
vtkPolyData * GetInput(int port)
Get the input to this writer.
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)
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual vtkMapper * GetMapper()
Set the mapper associated with the object.
ostream * OpenFile()
int WriteProperty(vtkProperty *property)
virtual vtkLookupTable * GetLookupTable()
Set the lookup table associated with the object.
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()
vtkPolyData * GetInput()
Get the input to this writer.
int WriteValues(vtkDataArray *array)
virtual const char * GetDescriptiveName()
Get the name of this file format.
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)
virtual vtkProperty * GetProperty()
Set the property associated with the object.
void SetFileTypeToASCII()
Specify file type (ASCII or BINARY) for vtk data file.
int WriteCells(vtkPolyData *data, int cellType)
virtual const char * GetFileExtensions()
Get the extension for this file format.
int WriteColors(vtkProperty *property, vtkMapper *mapper, vtkPolyData *data)
vtkLookupTable * LookupTable
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:77
represent and manipulate 3D points
Definition: vtkPoints.h:29
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:80
represent surface properties of a geometric object
Definition: vtkProperty.h:57
abstract class to write data to file(s)
Definition: vtkWriter.h:35
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ data
Definition: vtkX3D.h:315
int vtkIdType
Definition: vtkType.h:315
#define VTK_BINARY
Definition: vtkWriter.h:32
#define VTK_ASCII
Definition: vtkWriter.h:31