VTK
9.2.6
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
=========================================================================*/
35
36
#ifndef vtkSingleVTPExporter_h
37
#define vtkSingleVTPExporter_h
38
39
#include "
vtkExporter.h
"
40
#include "vtkIOExportModule.h"
// For export macro
41
#include <vector>
// for method args
42
43
class
vtkActor
;
44
class
vtkPolyData
;
45
class
vtkTexture
;
46
47
class
VTKIOEXPORT_EXPORT
vtkSingleVTPExporter
:
public
vtkExporter
48
{
49
public
:
50
static
vtkSingleVTPExporter
*
New
();
51
vtkTypeMacro(
vtkSingleVTPExporter
,
vtkExporter
);
52
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
53
55
59
vtkSetFilePathMacro
(
FilePrefix
);
60
vtkGetFilePathMacro
(
FilePrefix
);
62
63
// computes the file prefix from a filename by removing
64
// the .vtp extension if present. Useful for APIs that
65
// are filename centric.
66
void
SetFileName
(
VTK_FILEPATH
const
char
*);
67
68
protected
:
69
vtkSingleVTPExporter
();
70
~vtkSingleVTPExporter
()
override
;
71
72
void
WriteData
()
override
;
73
74
class
actorData
75
{
76
public
:
77
vtkActor
*
Actor
=
nullptr
;
78
vtkTexture
*
Texture
=
nullptr
;
79
int
ImagePosition
[2];
80
double
URange
[2];
81
double
VRange
[2];
82
bool
HaveRepeatingTexture
=
false
;
83
};
84
int
TextureSize
[2];
85
void
WriteTexture
(std::vector<actorData>& actors);
86
void
WriteVTP
(std::vector<actorData>& actors);
87
char
*
FilePrefix
;
88
89
// handle repeating textures by subdividing triangles
90
// so that they do not span mode than 0.0-1.5 of texture
91
// range.
92
vtkPolyData
*
FixTextureCoordinates
(
vtkPolyData
*);
93
94
// recursive method that handles one triangle
95
void
ProcessTriangle
(
const
vtkIdType
* pts,
vtkPolyData
* out);
96
97
private
:
98
vtkSingleVTPExporter
(
const
vtkSingleVTPExporter
&) =
delete
;
99
void
operator=(
const
vtkSingleVTPExporter
&) =
delete
;
100
};
101
102
#endif
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition
vtkActor.h:52
vtkExporter::vtkExporter
vtkExporter()
vtkIndent
a simple class to control print indentation
Definition
vtkIndent.h:40
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition
vtkPolyData.h:91
vtkSingleVTPExporter::actorData
Definition
vtkSingleVTPExporter.h:75
vtkSingleVTPExporter::actorData::HaveRepeatingTexture
bool HaveRepeatingTexture
Definition
vtkSingleVTPExporter.h:82
vtkSingleVTPExporter::actorData::VRange
double VRange[2]
Definition
vtkSingleVTPExporter.h:81
vtkSingleVTPExporter::actorData::URange
double URange[2]
Definition
vtkSingleVTPExporter.h:80
vtkSingleVTPExporter::actorData::Texture
vtkTexture * Texture
Definition
vtkSingleVTPExporter.h:78
vtkSingleVTPExporter::actorData::ImagePosition
int ImagePosition[2]
Definition
vtkSingleVTPExporter.h:79
vtkSingleVTPExporter::actorData::Actor
vtkActor * Actor
Definition
vtkSingleVTPExporter.h:77
vtkSingleVTPExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSingleVTPExporter::TextureSize
int TextureSize[2]
Definition
vtkSingleVTPExporter.h:84
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:87
vtkTexture
handles properties associated with a texture map
Definition
vtkTexture.h:69
vtkExporter.h
vtkIdType
int vtkIdType
Definition
vtkType.h:332
VTK_FILEPATH
#define VTK_FILEPATH
Definition
vtkWrappingHints.h:46
Generated on Sun Mar 23 2025 00:00:00 for VTK by
1.13.2