Point Cloud Library (PCL) 1.12.0
vtkVertexBufferObjectMapper.h
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkVertexBufferObjectMapper.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=========================================================================*/
15// .NAME vtkVertexBufferObjectMapper - map vtkPolyData to graphics primitives
16// .SECTION Description
17// vtkVertexBufferObjectMapper is a class that maps polygonal data (i.e., vtkPolyData)
18// to graphics primitives. vtkVertexBufferObjectMapper serves as a superclass for
19// device-specific poly data mappers, that actually do the mapping to the
20// rendering/graphics hardware/software.
21
22#pragma once
23
24#include <pcl/pcl_exports.h>
25#include <pcl/pcl_macros.h>
26
27#include "vtkMapper.h"
28#include "vtkSmartPointer.h"
29
30class vtkOpenGLRenderWindow;
31class vtkPolyData;
32class vtkRenderer;
33class vtkRenderWindow;
34class vtkShader2;
35class vtkShaderProgram2;
37
38class PCL_DEPRECATED(1, 13, "The OpenGL backend of VTK is deprecated. Please switch to the OpenGL2 backend.")
40{
41public:
44// void PrintSelf(ostream& os, vtkIndent indent);
45
46 // Description:
47 // Implemented by sub classes. Actual rendering is done here.
48// virtual void RenderPiece(vtkRenderer *ren, vtkActor *act);
49
50 // Description:
51 // This calls RenderPiece (in a for loop is streaming is necessary).
52 void Render(vtkRenderer *ren, vtkActor *act) override;
53
54 // Description:
55 // Specify the input data to map.
56 //void SetInputData(vtkPolyData *in);
57 void SetInput(vtkPolyData *input);
58 void SetInput(vtkDataSet *input);
59 vtkPolyData *GetInput();
60
62 {
63 this->program = program;
64 }
65
66 // Description:
67 // Update that sets the update piece first.
68 void Update() override;
69
70 // Description:
71 // Return bounding box (array of six doubles) of data expressed as
72 // (xmin,xmax, ymin,ymax, zmin,zmax).
73 double *GetBounds() override;
74 void GetBounds(double bounds[6]) override
75 {this->Superclass::GetBounds(bounds);};
76
77 // Description:
78 // Make a shallow copy of this mapper.
79// void ShallowCopy(vtkAbstractMapper *m);
80
81 // Description:
82 // Select a data array from the point/cell data
83 // and map it to a generic vertex attribute.
84 // vertexAttributeName is the name of the vertex attribute.
85 // dataArrayName is the name of the data array.
86 // fieldAssociation indicates when the data array is a point data array or
87 // cell data array (vtkDataObject::FIELD_ASSOCIATION_POINTS or
88 // (vtkDataObject::FIELD_ASSOCIATION_CELLS).
89 // componentno indicates which component from the data array must be passed as
90 // the attribute. If -1, then all components are passed.
91// virtual void MapDataArrayToVertexAttribute(
92// const char* vertexAttributeName,
93// const char* dataArrayName, int fieldAssociation, int componentno=-1);
94//
95// virtual void MapDataArrayToMultiTextureAttribute(
96// int unit,
97// const char* dataArrayName, int fieldAssociation, int componentno=-1);
98
99 // Description:
100 // Remove a vertex attribute mapping.
101// virtual void RemoveVertexAttributeMapping(const char* vertexAttributeName);
102//
103// // Description:
104// // Remove all vertex attributes.
105// virtual void RemoveAllVertexAttributeMappings();
106
107protected:
110
111 // Description:
112 // Called in GetBounds(). When this method is called, the consider the input
113 // to be updated depending on whether this->Static is set or not. This method
114 // simply obtains the bounds from the data-object and returns it.
115 virtual void ComputeBounds();
116
121// vtkVertexBufferObject *normalIndiceVbo;
122
124
125 int FillInputPortInformation(int, vtkInformation*) override;
126
127 void createShaders(vtkOpenGLRenderWindow* win);
128 void createVBOs(vtkRenderWindow* win);
129
132
133private:
135 void operator=(const vtkVertexBufferObjectMapper&); // Not implemented.
136};
int FillInputPortInformation(int, vtkInformation *) override
static vtkVertexBufferObjectMapper * New()
void Render(vtkRenderer *ren, vtkActor *act) override
void GetBounds(double bounds[6]) override
vtkTypeMacro(vtkVertexBufferObjectMapper, vtkMapper)
void createShaders(vtkOpenGLRenderWindow *win)
virtual void ComputeBounds()
double * GetBounds() override
void SetProgram(vtkSmartPointer< vtkShaderProgram2 > program)
vtkSmartPointer< vtkShaderProgram2 > program
void SetInput(vtkPolyData *input)
void SetInput(vtkDataSet *input)
void createVBOs(vtkRenderWindow *win)
Defines all the PCL and non-PCL macros used.
#define PCL_EXPORTS
Definition: pcl_macros.h:323
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....
Definition: pcl_macros.h:156