VTK
dox
IO
Export
vtkSingleVTPExporter.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkSingleVTPExporter.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
=========================================================================*/
33
#ifndef vtkSingleVTPExporter_h
34
#define vtkSingleVTPExporter_h
35
36
#include "vtkIOExportModule.h"
// For export macro
37
#include "
vtkExporter.h
"
38
#include <vector>
// for method args
39
40
class
vtkActor
;
41
class
vtkPolyData
;
42
class
vtkTexture
;
43
44
class
VTKIOEXPORT_EXPORT
vtkSingleVTPExporter
:
public
vtkExporter
45
{
46
public
:
47
static
vtkSingleVTPExporter
*
New
();
48
vtkTypeMacro(
vtkSingleVTPExporter
,
vtkExporter
);
49
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
50
52
56
vtkSetStringMacro(FilePrefix);
57
vtkGetStringMacro(FilePrefix);
59
60
// computes the file prefix from a filename by removing
61
// the .vtp extension if present. Useful for APIs that
62
// are filename centric.
63
void
SetFileName(
const
char
*);
64
65
protected
:
66
vtkSingleVTPExporter
();
67
~
vtkSingleVTPExporter
()
override
;
68
69
void
WriteData
()
override
;
70
71
class
actorData
72
{
73
public
:
74
vtkActor
*Actor =
nullptr
;
75
vtkTexture
*Texture =
nullptr
;
76
int
ImagePosition[2];
77
double
URange[2];
78
double
VRange[2];
79
bool
HaveRepeatingTexture =
false
;
80
};
81
int
TextureSize[2];
82
void
WriteTexture(std::vector<actorData> &actors);
83
void
WriteVTP(std::vector<actorData> &actors);
84
char
*
FilePrefix
;
85
86
// handle repeating textures by subdividing triangles
87
// so that they do not span mode than 0.0-1.5 of texture
88
// range.
89
vtkPolyData
*FixTextureCoordinates(
vtkPolyData
*);
90
91
// recursive method that handles one triangle
92
void
ProcessTriangle(
vtkIdType
*pts,
vtkPolyData
*out);
93
94
private
:
95
vtkSingleVTPExporter
(
const
vtkSingleVTPExporter
&) =
delete
;
96
void
operator=(
const
vtkSingleVTPExporter
&) =
delete
;
97
};
98
99
#endif
vtkExporter
abstract class to write a scene to a file
Definition:
vtkExporter.h:46
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition:
vtkActor.h:51
vtkExporter::WriteData
virtual void WriteData()=0
vtkSingleVTPExporter::actorData
Definition:
vtkSingleVTPExporter.h:71
vtkIdType
int vtkIdType
Definition:
vtkType.h:345
vtkSingleVTPExporter
export a scene into a single vtp file and png texture
Definition:
vtkSingleVTPExporter.h:44
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition:
vtkPolyData.h:85
vtkSingleVTPExporter::FilePrefix
char * FilePrefix
Definition:
vtkSingleVTPExporter.h:84
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:39
vtkTexture
handles properties associated with a texture map
Definition:
vtkTexture.h:71
vtkExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkExporter.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Generated by
1.8.14