VTK
9.4.20250304
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
IO
Export
vtkSingleVTPExporter.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2
// SPDX-License-Identifier: BSD-3-Clause
24
#ifndef vtkSingleVTPExporter_h
25
#define vtkSingleVTPExporter_h
26
27
#include "
vtkExporter.h
"
28
#include "vtkIOExportModule.h"
// For export macro
29
#include <vector>
// for method args
30
31
VTK_ABI_NAMESPACE_BEGIN
32
class
vtkActor
;
33
class
vtkPolyData
;
34
class
vtkTexture
;
35
36
class
VTKIOEXPORT_EXPORT
vtkSingleVTPExporter
:
public
vtkExporter
37
{
38
public
:
39
static
vtkSingleVTPExporter
*
New
();
40
vtkTypeMacro(
vtkSingleVTPExporter
,
vtkExporter
);
41
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
42
44
48
vtkSetFilePathMacro
(FilePrefix);
49
vtkGetFilePathMacro
(FilePrefix);
51
52
// computes the file prefix from a filename by removing
53
// the .vtp extension if present. Useful for APIs that
54
// are filename centric.
55
void
SetFileName
(
VTK_FILEPATH
const
char
*);
56
57
protected
:
58
vtkSingleVTPExporter
();
59
~vtkSingleVTPExporter
()
override
;
60
61
void
WriteData
()
override
;
62
63
class
actorData
64
{
65
public
:
66
vtkActor
* Actor =
nullptr
;
67
vtkTexture
* Texture =
nullptr
;
68
int
ImagePosition[2];
69
double
URange[2];
70
double
VRange[2];
71
bool
HaveRepeatingTexture =
false
;
72
};
73
int
TextureSize[2];
74
void
WriteTexture
(std::vector<actorData>& actors);
75
void
WriteVTP
(std::vector<actorData>& actors);
76
char
*
FilePrefix
;
77
78
// handle repeating textures by subdividing triangles
79
// so that they do not span mode than 0.0-1.5 of texture
80
// range.
81
vtkPolyData
*
FixTextureCoordinates
(
vtkPolyData
*);
82
83
// recursive method that handles one triangle
84
void
ProcessTriangle
(
const
vtkIdType
* pts,
vtkPolyData
* out);
85
86
private
:
87
vtkSingleVTPExporter
(
const
vtkSingleVTPExporter
&) =
delete
;
88
void
operator=(
const
vtkSingleVTPExporter
&) =
delete
;
89
};
90
91
VTK_ABI_NAMESPACE_END
92
#endif
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition
vtkActor.h:151
vtkExporter
abstract class to write a scene to a file
Definition
vtkExporter.h:37
vtkIndent
a simple class to control print indentation
Definition
vtkIndent.h:108
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition
vtkPolyData.h:181
vtkSingleVTPExporter::actorData
Definition
vtkSingleVTPExporter.h:64
vtkSingleVTPExporter
export a scene into a single vtp file and png texture
Definition
vtkSingleVTPExporter.h:37
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:76
vtkTexture
handles properties associated with a texture map
Definition
vtkTexture.h:168
vtkExporter.h
vtkIdType
int vtkIdType
Definition
vtkType.h:332
VTK_FILEPATH
#define VTK_FILEPATH
Definition
vtkWrappingHints.h:46
Generated on Tue Mar 4 2025 09:51:47 for VTK by
1.9.7