VTK
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 
17 Copyright (c) 2006 Atamai, Inc.
18 
19 Use, modification and redistribution of the software, in source or
20 binary forms, are permitted provided that the following terms and
21 conditions are met:
22 
23 1) 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 
28 2) 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 
33 3) 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 
36 THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37 WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40 MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42 (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43 OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44 THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45 POSSIBILITY OF SUCH DAMAGES.
46 
47 =========================================================================*/
67 #ifndef __vtkMNIObjectWriter_h
68 #define __vtkMNIObjectWriter_h
69 
70 #include "vtkPolyDataWriter.h"
71 
72 class vtkMapper;
73 class vtkProperty;
74 class vtkLookupTable;
75 class vtkPolyData;
76 class vtkFloatArray;
77 class vtkIntArray;
78 class vtkPoints;
79 
81 {
82 public:
84 
85  static vtkMNIObjectWriter *New();
86  virtual void PrintSelf(ostream& os, vtkIndent indent);
87 
89 
90  virtual const char* GetFileExtensions() {
91  return ".obj"; }
93 
95 
96  virtual const char* GetDescriptiveName() {
97  return "MNI object"; }
99 
101 
103  virtual void SetProperty(vtkProperty *property);
104  virtual vtkProperty *GetProperty() { return this->Property; };
106 
108 
111  virtual void SetMapper(vtkMapper *mapper);
112  virtual vtkMapper *GetMapper() { return this->Mapper; };
114 
116 
118  virtual void SetLookupTable(vtkLookupTable *table);
119  virtual vtkLookupTable *GetLookupTable() { return this->LookupTable; };
121 
122 protected:
125 
129 
130  ostream *OutputStream;
131 
132  int WriteObjectType(int objType);
133  int WriteValues(vtkDataArray *array);
134  int WriteIdValue(vtkIdType value);
135  int WriteNewline();
136 
137  int WriteProperty(vtkProperty *property);
138  int WriteLineThickness(vtkProperty *property);
139  int WritePoints(vtkPolyData *polyData);
140  int WriteNormals(vtkPolyData *polyData);
141  int WriteColors(vtkProperty *property, vtkMapper *mapper, vtkPolyData *data);
142  int WriteCells(vtkPolyData *data, int cellType);
143 
144  int WritePolygonObject(vtkPolyData *output);
145  int WriteLineObject(vtkPolyData *output);
146 
147  void WriteData();
148 
149 private:
150  vtkMNIObjectWriter(const vtkMNIObjectWriter&); // Not implemented
151  void operator=(const vtkMNIObjectWriter&); // Not implemented
152 
153 };
154 
155 #endif
write vtk polygonal data
represent surface properties of a geometric object
Definition: vtkProperty.h:61
virtual vtkLookupTable * GetLookupTable()
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
map scalar values into colors via a lookup table
virtual const char * GetFileExtensions()
int vtkIdType
Definition: vtkType.h:255
int WritePoints(ostream *fp, vtkPoints *p)
virtual vtkProperty * GetProperty()
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:81
virtual const char * GetDescriptiveName()
A writer for MNI surface mesh files.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:42
int WriteCells(ostream *fp, vtkCellArray *cells, const char *label)
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkLookupTable * LookupTable
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
static vtkPolyDataWriter * New()
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:85
virtual vtkMapper * GetMapper()
void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_HYBRID_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38