VTK
9.3.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
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
vtkExporter
abstract class to write a scene to a file
Definition:
vtkExporter.h:36
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition:
vtkActor.h:40
vtkExporter::WriteData
virtual void WriteData()=0
vtkSingleVTPExporter::actorData
Definition:
vtkSingleVTPExporter.h:63
vtkIdType
int vtkIdType
Definition:
vtkType.h:315
vtkSingleVTPExporter
export a scene into a single vtp file and png texture
Definition:
vtkSingleVTPExporter.h:36
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition:
vtkPolyData.h:79
vtkSingleVTPExporter::FilePrefix
char * FilePrefix
Definition:
vtkSingleVTPExporter.h:76
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:28
vtkTexture
handles properties associated with a texture map
Definition:
vtkTexture.h:57
vtkExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_FILEPATH
#define VTK_FILEPATH
Definition:
vtkWrappingHints.h:34
vtkExporter.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Generated on Sun Dec 8 2024 22:05:33 for VTK by
1.8.10