VTK  9.3.1
vtkWebGLExporter.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
8#ifndef vtkWebGLExporter_h
9#define vtkWebGLExporter_h
10
11#include "vtkObject.h"
12#include "vtkWebGLExporterModule.h" // needed for export macro
13
14VTK_ABI_NAMESPACE_BEGIN
15class vtkActor;
16class vtkActor2D;
17class vtkCellData;
18class vtkMapper;
19class vtkPointData;
20class vtkPolyData;
21class vtkRenderer;
24class vtkWebGLObject;
26
27VTK_ABI_NAMESPACE_END
28
29#include <string> // needed for internal structure
30
31VTK_ABI_NAMESPACE_BEGIN
38
39class VTKWEBGLEXPORTER_EXPORT vtkWebGLExporter : public vtkObject
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
47
50 void parseScene(vtkRendererCollection* renderers, const char* viewId, int parseType);
51 // Generate and return the Metadata
52 void exportStaticScene(vtkRendererCollection* renderers, int width, int height, std::string path);
53 const char* GenerateMetadata();
54 const char* GetId();
57 bool hasChanged();
58 void SetCenterOfRotation(float a1, float a2, float a3);
59 void SetMaxAllowedSize(int mesh, int lines);
60 void SetMaxAllowedSize(int size);
62
63 static void ComputeMD5(const unsigned char* content, int size, std::string& hash);
64
65protected:
68
69 void parseRenderer(vtkRenderer* render, const char* viewId, bool onlyWidget, void* mapTime);
70 void generateRendererData(vtkRendererCollection* renderers, const char* viewId);
72 vtkActor* actor, vtkMTimeType actorTime, size_t rendererId, int layer, bool isWidget);
74 vtkActor2D* actor, vtkMTimeType actorTime, size_t renderId, int layer, bool isWidget);
76
77 // Get the dataset from the mapper
79
80 vtkTriangleFilter* TriangleFilter; // Last Polygon Dataset Parse
81 double CameraLookAt[10]; // Camera Look At (fov, position[3], up[3], eye[3])
82 bool GradientBackground; // If the scene use a gradient background
83 double Background1[3]; // Background color of the rendering screen (RGB)
84 double Background2[3]; // Scond background color
85 double SceneSize[3]; // Size of the bounding box of the scene
86 std::string SceneId; // Id of the parsed scene
87 float CenterOfRotation[3]; // Center Of Rotation
88 int meshObjMaxSize, lineObjMaxSize; // Max size of object allowed (faces)
89 std::string renderersMetaData;
91
92private:
93 vtkWebGLExporter(const vtkWebGLExporter&) = delete;
94 void operator=(const vtkWebGLExporter&) = delete;
95
96 class vtkInternal;
97 vtkInternal* Internal;
98};
99
100VTK_ABI_NAMESPACE_END
101#endif
a actor that draws 2D data
Definition vtkActor2D.h:35
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:41
represent and manipulate cell attribute data
Definition vtkCellData.h:31
a simple class to control print indentation
Definition vtkIndent.h:29
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:77
abstract base class for most VTK objects
Definition vtkObject.h:52
represent and manipulate point attribute data
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
an ordered list of renderers
abstract specification for renderers
Definition vtkRenderer.h:62
convert input polygons and strips to triangles
vtkWebGLExporter export the data of the scene to be used in the WebGL.
void parseActor2D(vtkActor2D *actor, vtkMTimeType actorTime, size_t renderId, int layer, bool isWidget)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTriangleFilter * GetPolyData(vtkMapper *mapper, vtkMTimeType &dataMTime)
void exportStaticScene(vtkRendererCollection *renderers, int width, int height, std::string path)
Get all the needed information from the vtkRenderer.
bool hasChanged()
Get all the needed information from the vtkRenderer.
void generateRendererData(vtkRendererCollection *renderers, const char *viewId)
void SetCenterOfRotation(float a1, float a2, float a3)
Get all the needed information from the vtkRenderer.
const char * GenerateExportMetadata()
static void ComputeMD5(const unsigned char *content, int size, std::string &hash)
void parseRenderer(vtkRenderer *render, const char *viewId, bool onlyWidget, void *mapTime)
void SetMaxAllowedSize(int size)
Get all the needed information from the vtkRenderer.
void parseScene(vtkRendererCollection *renderers, const char *viewId, int parseType)
Get all the needed information from the vtkRenderer.
int GetNumberOfObjects()
Get all the needed information from the vtkRenderer.
void parseActor(vtkActor *actor, vtkMTimeType actorTime, size_t rendererId, int layer, bool isWidget)
const char * GetId()
Get all the needed information from the vtkRenderer.
static vtkWebGLExporter * New()
std::string renderersMetaData
const char * GenerateMetadata()
Get all the needed information from the vtkRenderer.
void SetMaxAllowedSize(int mesh, int lines)
Get all the needed information from the vtkRenderer.
vtkTriangleFilter * TriangleFilter
~vtkWebGLExporter() override
vtkWebGLObject * GetWebGLObject(int index)
Get all the needed information from the vtkRenderer.
vtkWebGLObject represent and manipulate an WebGL object and its data.
PolyData representation for WebGL.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
VTKParseType
@ VTK_ONLYWIDGET
@ VTK_PARSEALL
@ VTK_ONLYCAMERA