VTK
9.1.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
=========================================================================*/
30
#ifndef vtkSingleVTPExporter_h
31
#define vtkSingleVTPExporter_h
32
33
#include "
vtkExporter.h
"
34
#include "vtkIOExportModule.h"
// For export macro
35
#include <vector>
// for method args
36
37
class
vtkActor
;
38
class
vtkPolyData
;
39
class
vtkTexture
;
40
41
class
VTKIOEXPORT_EXPORT
vtkSingleVTPExporter
:
public
vtkExporter
42
{
43
public
:
44
static
vtkSingleVTPExporter
*
New
();
45
vtkTypeMacro(
vtkSingleVTPExporter
,
vtkExporter
);
46
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
47
49
53
vtkSetFilePathMacro
(FilePrefix);
54
vtkGetFilePathMacro
(FilePrefix);
56
57
// computes the file prefix from a filename by removing
58
// the .vtp extension if present. Useful for APIs that
59
// are filename centric.
60
void
SetFileName
(
VTK_FILEPATH
const
char
*);
61
62
protected
:
63
vtkSingleVTPExporter
();
64
~vtkSingleVTPExporter
()
override
;
65
66
void
WriteData
()
override
;
67
68
class
actorData
69
{
70
public
:
71
vtkActor
* Actor =
nullptr
;
72
vtkTexture
* Texture =
nullptr
;
73
int
ImagePosition[2];
74
double
URange[2];
75
double
VRange[2];
76
bool
HaveRepeatingTexture =
false
;
77
};
78
int
TextureSize[2];
79
void
WriteTexture
(std::vector<actorData>& actors);
80
void
WriteVTP
(std::vector<actorData>& actors);
81
char
*
FilePrefix
;
82
83
// handle repeating textures by subdividing triangles
84
// so that they do not span mode than 0.0-1.5 of texture
85
// range.
86
vtkPolyData
*
FixTextureCoordinates
(
vtkPolyData
*);
87
88
// recursive method that handles one triangle
89
void
ProcessTriangle
(
const
vtkIdType
* pts,
vtkPolyData
* out);
90
91
private
:
92
vtkSingleVTPExporter
(
const
vtkSingleVTPExporter
&) =
delete
;
93
void
operator=(
const
vtkSingleVTPExporter
&) =
delete
;
94
};
95
96
#endif
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition:
vtkActor.h:155
vtkExporter
abstract class to write a scene to a file
Definition:
vtkExporter.h:48
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:113
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition:
vtkPolyData.h:195
vtkSingleVTPExporter::actorData
Definition:
vtkSingleVTPExporter.h:69
vtkSingleVTPExporter
export a scene into a single vtp file and png texture
Definition:
vtkSingleVTPExporter.h:42
vtkSingleVTPExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSingleVTPExporter::vtkSingleVTPExporter
vtkSingleVTPExporter()
vtkSingleVTPExporter::WriteTexture
void WriteTexture(std::vector< actorData > &actors)
vtkSingleVTPExporter::SetFileName
void SetFileName(VTK_FILEPATH const char *)
vtkSingleVTPExporter::~vtkSingleVTPExporter
~vtkSingleVTPExporter() override
vtkSingleVTPExporter::New
static vtkSingleVTPExporter * New()
vtkSingleVTPExporter::WriteData
void WriteData() override
vtkSingleVTPExporter::vtkSetFilePathMacro
vtkSetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
vtkSingleVTPExporter::FixTextureCoordinates
vtkPolyData * FixTextureCoordinates(vtkPolyData *)
vtkSingleVTPExporter::ProcessTriangle
void ProcessTriangle(const vtkIdType *pts, vtkPolyData *out)
vtkSingleVTPExporter::vtkGetFilePathMacro
vtkGetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
vtkSingleVTPExporter::WriteVTP
void WriteVTP(std::vector< actorData > &actors)
vtkSingleVTPExporter::FilePrefix
char * FilePrefix
Definition:
vtkSingleVTPExporter.h:81
vtkTexture
handles properties associated with a texture map
Definition:
vtkTexture.h:175
vtkExporter.h
vtkIdType
int vtkIdType
Definition:
vtkType.h:332
VTK_FILEPATH
#define VTK_FILEPATH
Definition:
vtkWrappingHints.h:46
Generated on Sat Feb 25 2023 08:59:35 for VTK by
1.9.4