VTK  9.3.1
vtkWebGLPolyData.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 vtkWebGLPolyData_h
9 #define vtkWebGLPolyData_h
10 
11 #include "vtkWebGLExporterModule.h" // needed for export macro
12 #include "vtkWebGLObject.h"
13 
14 VTK_ABI_NAMESPACE_BEGIN
15 class vtkActor;
16 class vtkMatrix4x4;
17 class vtkMapper;
18 class vtkPointData;
19 class vtkPolyData;
20 class vtkTriangleFilter;
21 
22 class VTKWEBGLEXPORTER_EXPORT vtkWebGLPolyData : public vtkWebGLObject
23 {
24 public:
25  static vtkWebGLPolyData* New();
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
29  void GenerateBinaryData() override;
30  unsigned char* GetBinaryData(int part) override;
31  int GetBinarySize(int part) override;
32  int GetNumberOfParts() override;
33 
34  void GetPoints(vtkTriangleFilter* polydata, vtkActor* actor, int maxSize);
35 
36  void GetLinesFromPolygon(vtkMapper* mapper, vtkActor* actor, int lineMaxSize, double* edgeColor);
37  void GetLines(vtkTriangleFilter* polydata, vtkActor* actor, int lineMaxSize);
38  void GetColorsFromPolyData(unsigned char* color, vtkPolyData* polydata, vtkActor* actor);
39 
40  // Get following data from the actor
41  void GetPolygonsFromPointData(vtkTriangleFilter* polydata, vtkActor* actor, int maxSize);
42  void GetPolygonsFromCellData(vtkTriangleFilter* polydata, vtkActor* actor, int maxSize);
43  void GetColorsFromPointData(
44  unsigned char* color, vtkPointData* pointdata, vtkPolyData* polydata, vtkActor* actor);
45 
46  void SetMesh(float* _vertices, int _numberOfVertices, int* _index, int _numberOfIndexes,
47  float* _normals, unsigned char* _colors, float* _tcoords, int maxSize);
48  void SetLine(float* _points, int _numberOfPoints, int* _index, int _numberOfIndex,
49  unsigned char* _colors, int maxSize);
50  void SetPoints(float* points, int numberOfPoints, unsigned char* colors, int maxSize);
52 
53 protected:
55  ~vtkWebGLPolyData() override;
56 
57 private:
58  vtkWebGLPolyData(const vtkWebGLPolyData&) = delete;
59  void operator=(const vtkWebGLPolyData&) = delete;
60 
61  class vtkInternal;
62  vtkInternal* Internal;
63 };
64 
65 VTK_ABI_NAMESPACE_END
66 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
represent and manipulate point attribute data
Definition: vtkPointData.h:29
PolyData representation for WebGL.
void SetTransformationMatrix(vtkMatrix4x4 *m)
convert input polygons and strips to triangles
virtual int GetBinarySize(int part)
vtkWebGLObject represent and manipulate an WebGL object and its data.
virtual unsigned char * GetBinaryData(int part)
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:76
static vtkWebGLObject * New()
virtual void GenerateBinaryData()
virtual int GetNumberOfParts()