VTK  9.4.20250304
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
31VTK_ABI_NAMESPACE_BEGIN
32class vtkActor;
33class vtkPolyData;
34class vtkTexture;
35
36class VTKIOEXPORT_EXPORT vtkSingleVTPExporter : public vtkExporter
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
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
57protected:
60
61 void WriteData() override;
62
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);
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.
82
83 // recursive method that handles one triangle
84 void ProcessTriangle(const vtkIdType* pts, vtkPolyData* out);
85
86private:
88 void operator=(const vtkSingleVTPExporter&) = delete;
89};
90
91VTK_ABI_NAMESPACE_END
92#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
abstract class to write a scene to a file
Definition vtkExporter.h:37
a simple class to control print indentation
Definition vtkIndent.h:108
concrete dataset represents vertices, lines, polygons, and triangle strips
export a scene into a single vtp file and png texture
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void WriteTexture(std::vector< actorData > &actors)
void SetFileName(VTK_FILEPATH const char *)
~vtkSingleVTPExporter() override
static vtkSingleVTPExporter * New()
void WriteData() override
vtkSetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
vtkPolyData * FixTextureCoordinates(vtkPolyData *)
void ProcessTriangle(const vtkIdType *pts, vtkPolyData *out)
vtkGetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
void WriteVTP(std::vector< actorData > &actors)
handles properties associated with a texture map
Definition vtkTexture.h:168
int vtkIdType
Definition vtkType.h:332
#define VTK_FILEPATH