VTK  9.1.0
vtkOpenGLPolyDataMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4 
5  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
21 #ifndef vtkOpenGLPolyDataMapper_h
22 #define vtkOpenGLPolyDataMapper_h
23 
24 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_0_0
25 #include "vtkInformation.h" // for prim struct
26 #include "vtkNew.h" // For vtkNew
27 #include "vtkOpenGLHelper.h" // used for ivars
28 #include "vtkPolyDataMapper.h"
29 #include "vtkRenderingOpenGL2Module.h" // For export macro
30 #include "vtkShader.h" // for methods
31 #include "vtkStateStorage.h" // used for ivars
32 
33 #include <map> // for map
34 #include <tuple> // for tuple
35 #include <vector> // for vector
36 
37 class vtkCellArray;
39 class vtkMatrix4x4;
40 class vtkMatrix3x3;
43 class vtkOpenGLTexture;
47 class vtkPoints;
48 class vtkTexture;
49 class vtkTextureObject;
50 class vtkTransform;
52 
53 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLPolyDataMapper : public vtkPolyDataMapper
54 {
55 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
63  void RenderPiece(vtkRenderer* ren, vtkActor* act) override;
64 
66 
69  virtual void RenderPieceStart(vtkRenderer* ren, vtkActor* act);
70  virtual void RenderPieceDraw(vtkRenderer* ren, vtkActor* act);
71  virtual void RenderPieceFinish(vtkRenderer* ren, vtkActor* act);
73 
80 
81  vtkGetMacro(PopulateSelectionSettings, int);
82  void SetPopulateSelectionSettings(int v) { this->PopulateSelectionSettings = v; }
83 
90  bool GetSupportsSelection() override { return true; }
91 
92  // used by RenderPiece and functions it calls to reduce
93  // calls to get the input and allow for rendering of
94  // other polydata (not the input)
96 
98 
104  vtkSetStringMacro(PointIdArrayName);
105  vtkGetStringMacro(PointIdArrayName);
106  vtkSetStringMacro(CellIdArrayName);
107  vtkGetStringMacro(CellIdArrayName);
109 
111 
116  vtkSetStringMacro(ProcessIdArrayName);
117  vtkGetStringMacro(ProcessIdArrayName);
119 
121 
130  vtkSetStringMacro(CompositeIdArrayName);
131  vtkGetStringMacro(CompositeIdArrayName);
133 
135 
145  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::AddShaderReplacement")
146  void AddShaderReplacement(vtkShader::Type shaderType, // vertex, fragment, etc
147  const std::string& originalValue,
148  bool replaceFirst, // do this replacement before the default
149  const std::string& replacementValue, bool replaceAll);
150  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::ClearShaderReplacement")
151  void ClearShaderReplacement(vtkShader::Type shaderType, // vertex, fragment, etc
152  const std::string& originalValue, bool replaceFirst);
153  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::ClearAllShaderReplacements")
154  void ClearAllShaderReplacements(vtkShader::Type shaderType);
155  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::ClearAllShaderReplacements")
156  void ClearAllShaderReplacements();
158 
160 
168  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::SetVertexShaderCode")
169  virtual void SetVertexShaderCode(const char* code);
170  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::GetVertexShaderCode")
171  virtual char* GetVertexShaderCode();
172  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::SetFragmentShaderCode")
173  virtual void SetFragmentShaderCode(const char* code);
174  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::GetFragmentShaderCode")
175  virtual char* GetFragmentShaderCode();
176  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::SetGeometryShaderCode")
177  virtual void SetGeometryShaderCode(const char* code);
178  VTK_DEPRECATED_IN_9_0_0("Use vtkOpenGLShaderProperty::GetGeometryShaderCode")
179  virtual char* GetGeometryShaderCode();
181 
185  void ShallowCopy(vtkAbstractMapper* m) override;
186 
188  vtkGetObjectMacro(VBOs, vtkOpenGLVertexBufferObjectGroup);
189 
193  virtual void SetVBOShiftScaleMethod(int m);
194  virtual int GetVBOShiftScaleMethod() { return this->ShiftScaleMethod; }
195 
210  virtual void SetPauseShiftScale(bool pauseShiftScale) { this->PauseShiftScale = pauseShiftScale; }
211  vtkGetMacro(PauseShiftScale, bool);
212  vtkBooleanMacro(PauseShiftScale, bool);
213 
215  {
216  PrimitiveStart = 0,
217  PrimitivePoints = 0,
222  PrimitiveEnd
223  };
224 
236  void MapDataArrayToVertexAttribute(const char* vertexAttributeName, const char* dataArrayName,
237  int fieldAssociation, int componentno = -1) override;
238 
239  // This method will Map the specified data array for use as
240  // a texture coordinate for texture tname. The actual
241  // attribute will be named tname_coord so as to not
242  // conflict with the texture sampler definition which will
243  // be tname.
244  void MapDataArrayToMultiTextureAttribute(const char* tname, const char* dataArrayName,
245  int fieldAssociation, int componentno = -1) override;
246 
250  void RemoveVertexAttributeMapping(const char* vertexAttributeName) override;
251 
256 
262  vtkHardwareSelector* sel, std::vector<unsigned int>& pixeloffsets, vtkProp* prop) override;
263 
264 protected:
267 
269 
270  void MapDataArray(const char* vertexAttributeName, const char* dataArrayName,
271  const char* texturename, int fieldAssociation, int componentno);
272 
273  // what coordinate should be used for this texture
275 
276  // handle updating shift scale based on pose changes
277  virtual void UpdateCameraShiftScale(vtkRenderer* ren, vtkActor* actor);
278 
282  void GetCoincidentParameters(vtkRenderer* ren, vtkActor* actor, float& factor, float& offset);
283 
289  void ComputeBounds() override;
290 
295  virtual void UpdateShaders(vtkOpenGLHelper& cellBO, vtkRenderer* ren, vtkActor* act);
296 
300  virtual bool GetNeedToRebuildShaders(vtkOpenGLHelper& cellBO, vtkRenderer* ren, vtkActor* act);
301 
305  virtual void BuildShaders(
306  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
307 
311  virtual void GetShaderTemplate(
312  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
313 
317  virtual void ReplaceShaderValues(
318  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
319 
321 
326  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act, bool prePass);
328  std::map<vtkShader::Type, vtkShader*> shaders, vtkActor* act);
329  virtual void ReplaceShaderColor(
330  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
331  virtual void ReplaceShaderEdges(
332  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
333  virtual void ReplaceShaderLight(
334  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
335  virtual void ReplaceShaderTCoord(
336  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
337  virtual void ReplaceShaderPicking(
338  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
339  virtual void ReplaceShaderPrimID(
340  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
341  virtual void ReplaceShaderNormal(
342  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
343  virtual void ReplaceShaderClip(
344  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
346  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
348  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
349  virtual void ReplaceShaderDepth(
350  std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
352 
356  virtual void SetCustomUniforms(vtkOpenGLHelper& cellBO, vtkActor* actor);
357 
362 
367  vtkOpenGLHelper& cellBO, vtkRenderer* ren, vtkActor* act);
368 
373 
378  vtkOpenGLHelper& cellBO, vtkRenderer* ren, vtkActor* act);
379 
383  virtual void UpdateBufferObjects(vtkRenderer* ren, vtkActor* act);
384 
389 
393  virtual void BuildBufferObjects(vtkRenderer* ren, vtkActor* act);
394 
398  virtual void BuildIBO(vtkRenderer* ren, vtkActor* act, vtkPolyData* poly);
399 
403  virtual void BuildSelectionIBO(
404  vtkPolyData* poly, std::vector<unsigned int> (&indices)[4], vtkIdType offset);
405 
409  virtual void BuildSelectionCache(const char* arrayName, bool selectingPoints, vtkPolyData* poly);
410 
411  // The VBO and its layout.
413 
414  // Structures for the various cell types we render.
415  vtkOpenGLHelper Primitives[PrimitiveEnd];
416  vtkOpenGLHelper SelectionPrimitives[PrimitiveEnd];
419  bool DrawingSelection = false;
421  vtkMTimeType SelectionTime = 0;
422 
423  std::map<std::tuple<unsigned int, unsigned int, vtkIdType>, std::vector<vtkIdType>>
426  bool SelectionCacheForPoints = false;
427  vtkMTimeType SelectionCacheTime = 0;
428  vtkPolyData* SelectionPolyData = nullptr;
429 
430  // do we have wide lines that require special handling
432 
433  // do we have textures that require special handling
434  virtual bool HaveTextures(vtkActor* actor);
435 
436  // how many textures do we have
437  virtual unsigned int GetNumberOfTextures(vtkActor* actor);
438 
439  // populate a vector with the textures we have
440  // the order is always
441  // ColorInternalTexture
442  // Actors texture
443  // Properties textures
444  virtual std::vector<std::pair<vtkTexture*, std::string>> GetTextures(vtkActor* actor);
445 
446  // do we have textures coordinates that require special handling
447  virtual bool HaveTCoords(vtkPolyData* poly);
448 
449  // values we use to determine if we need to rebuild shaders
450  // stored in a map keyed on the vtkOpenGLHelper, so one
451  // typically entry per type of primitive we render which
452  // matches the shader programs we use
454  {
455  public:
459 
460  // Caches the vtkOpenGLRenderPass::RenderPasses() information.
461  // Note: Do not dereference the pointers held by this object. There is no
462  // guarantee that they are still valid!
464  };
465  std::map<const vtkOpenGLHelper*, primitiveInfo> PrimitiveInfo;
466 
470 
471  // Check the renderpasses in actor's property keys to see if they've changed
472  // render stages:
474 
476  vtkTimeStamp VBOBuildTime; // When was the OpenGL VBO updated?
477  vtkStateStorage VBOBuildState; // used for determining when to rebuild the VBO
478  vtkStateStorage IBOBuildState; // used for determining whento rebuild the IBOs
480  vtkStateStorage TempState; // can be used to avoid constant allocs/deallocs
482 
485 
490  int ShiftScaleMethod; // for points
492 
493  // if set to true, tcoords will be passed to the
494  // VBO even if the mapper knows of no texture maps
495  // normally tcoords are only added to the VBO if the
496  // mapper has identified a texture map as well.
498 
499  virtual void BuildCellTextures(
500  vtkRenderer* ren, vtkActor*, vtkCellArray* prims[4], int representation);
501 
502  void AppendCellTextures(vtkRenderer* ren, vtkActor*, vtkCellArray* prims[4], int representation,
503  std::vector<unsigned char>& colors, std::vector<float>& normals, vtkPolyData* pd,
505 
512 
515  std::vector<unsigned char> EdgeValues;
517 
518  // additional picking indirection
523 
525  {
526  public:
531  };
532  std::map<std::string, ExtraAttributeValue> ExtraAttributes;
533 
534  // Store shader properties on this class by legacy shader replacement functions
535  // This should disappear when the functions are deprecated
536  // VTK_DEPRECATED_IN_9_0_0("legacy support functions")
538  // VTK_DEPRECATED_IN_9_0_0("legacy support functions")
540 
542 
543  // are we currently drawing spheres/tubes
544  bool DrawingSpheres(vtkOpenGLHelper& cellBO, vtkActor* actor);
545  bool DrawingTubes(vtkOpenGLHelper& cellBO, vtkActor* actor);
547 
548  // get which opengl mode to use to draw the primitive
549  int GetOpenGLMode(int representation, int primType);
550 
551  // get how big to make the points when doing point picking
552  // typically 2 for points, 4 for lines, 6 for surface
553  int GetPointPickingPrimitiveSize(int primType);
554 
555  // used to occasionally invoke timers
556  unsigned int TimerQueryCounter;
557 
558  // stores the mapping from vtk cells to gl_PrimitiveId
560 
561  // compute and set the maximum point and cell ID used in selection
562  virtual void UpdateMaximumPointCellIds(vtkRenderer* ren, vtkActor* actor);
563 
564  void AddPointIdsToSelectionPrimitives(vtkPolyData* poly, const char* arrayName,
565  unsigned int processId, unsigned int compositeIndex, vtkIdType selectedId);
566  void AddCellIdsToSelectionPrimitives(vtkPolyData* poly, const char* arrayName,
567  unsigned int processId, unsigned int compositeIndex, vtkIdType selectedId);
568 
569  vtkNew<vtkCellArray> SelectionArrays[4];
570 
571 private:
573  void operator=(const vtkOpenGLPolyDataMapper&) = delete;
574 };
575 
576 #endif
abstract class specifies interface to map data
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
object to represent cell connectivity
Definition: vtkCellArray.h:181
a simple class to control print indentation
Definition: vtkIndent.h:34
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:34
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:36
OpenGL buffer object.
OpenGL rendering utility functions.
PolyDataMapper using OpenGL to render.
virtual void BuildSelectionCache(const char *arrayName, bool selectingPoints, vtkPolyData *poly)
Build the selection cache, used to map value ids to indices values.
void MapDataArrayToMultiTextureAttribute(const char *tname, const char *dataArrayName, int fieldAssociation, int componentno=-1) override
virtual void ReplaceShaderRenderPass(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act, bool prePass)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
virtual void SetLightingShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Set the shader parameteres related to lighting, called by UpdateShader.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
virtual void ReplaceShaderPrimID(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
virtual std::vector< std::pair< vtkTexture *, std::string > > GetTextures(vtkActor *actor)
virtual void GetShaderTemplate(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Create the basic shaders before replacement.
std::map< const vtkOpenGLHelper *, primitiveInfo > PrimitiveInfo
virtual bool GetNeedToRebuildShaders(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Does the shader source need to be recomputed.
bool DrawingTubes(vtkOpenGLHelper &cellBO, vtkActor *actor)
vtkOpenGLBufferObject * CellScalarBuffer
virtual void RenderPieceStart(vtkRenderer *ren, vtkActor *act)
Implemented by sub classes.
virtual void SetPauseShiftScale(bool pauseShiftScale)
Pause per-render updates to VBO shift+scale parameters.
void RenderPiece(vtkRenderer *ren, vtkActor *act) override
Implemented by sub classes.
void ComputeBounds() override
Called in GetBounds().
std::string GetTextureCoordinateName(const char *tname)
vtkOpenGLRenderTimer * TimerQuery
virtual void BuildIBO(vtkRenderer *ren, vtkActor *act, vtkPolyData *poly)
Build the IBO, called by BuildBufferObjects.
virtual void ReplaceShaderCustomUniforms(std::map< vtkShader::Type, vtkShader * > shaders, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
bool DrawingTubesOrSpheres(vtkOpenGLHelper &cellBO, vtkActor *actor)
virtual void ReplaceShaderTCoord(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
virtual void UpdateShaders(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Make sure appropriate shaders are defined, compiled and bound.
virtual void ReplaceShaderLight(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
virtual void ReplaceShaderCoincidentOffset(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
void AddPointIdsToSelectionPrimitives(vtkPolyData *poly, const char *arrayName, unsigned int processId, unsigned int compositeIndex, vtkIdType selectedId)
vtkTextureObject * CellScalarTexture
virtual void SetCustomUniforms(vtkOpenGLHelper &cellBO, vtkActor *actor)
Set the value of user-defined uniform variables, called by UpdateShader.
virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Set the shader parameteres related to the Camera, called by UpdateShader.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ReplaceShaderValues(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates.
virtual bool GetNeedToRebuildBufferObjects(vtkRenderer *ren, vtkActor *act)
Does the VBO/IBO need to be rebuilt.
virtual void SetPropertyShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Set the shader parameteres related to the property, called by UpdateShader.
virtual void ReplaceShaderEdges(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
virtual bool HaveWideLines(vtkRenderer *, vtkActor *)
virtual void BuildShaders(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Build the shader source code, called by UpdateShader.
void AppendCellTextures(vtkRenderer *ren, vtkActor *, vtkCellArray *prims[4], int representation, std::vector< unsigned char > &colors, std::vector< float > &normals, vtkPolyData *pd, vtkOpenGLCellToVTKCellMap *ccmap)
vtkSmartPointer< vtkOpenGLShaderProperty > LegacyShaderProperty
static vtkOpenGLPolyDataMapper * New()
vtkTextureObject * CellNormalTexture
virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Set the shader parameters related to the mapper/input data, called by UpdateShader.
vtkMTimeType GetRenderPassStageMTime(vtkActor *actor, const vtkOpenGLHelper *cellBO)
virtual void UpdateMaximumPointCellIds(vtkRenderer *ren, vtkActor *actor)
bool GetSupportsSelection() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
bool DrawingSpheres(vtkOpenGLHelper &cellBO, vtkActor *actor)
vtkNew< vtkOpenGLCellToVTKCellMap > CellCellMap
virtual void RenderPieceFinish(vtkRenderer *ren, vtkActor *act)
Implemented by sub classes.
virtual void ReplaceShaderDepth(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
vtkOpenGLTexture * InternalColorTexture
virtual void ReplaceShaderClip(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
int GetPointPickingPrimitiveSize(int primType)
vtkOpenGLBufferObject * CellNormalBuffer
virtual void BuildSelectionIBO(vtkPolyData *poly, std::vector< unsigned int >(&indices)[4], vtkIdType offset)
Build the selection IBO, called by UpdateBufferObjects.
std::vector< unsigned char > EdgeValues
std::map< std::string, ExtraAttributeValue > ExtraAttributes
virtual void RenderPieceDraw(vtkRenderer *ren, vtkActor *act)
Implemented by sub classes.
vtkOpenGLBufferObject * EdgeBuffer
vtkOpenGLShaderProperty * GetLegacyShaderProperty()
virtual void UpdateCameraShiftScale(vtkRenderer *ren, vtkActor *actor)
virtual unsigned int GetNumberOfTextures(vtkActor *actor)
void ProcessSelectorPixelBuffers(vtkHardwareSelector *sel, std::vector< unsigned int > &pixeloffsets, vtkProp *prop) override
allows a mapper to update a selections color buffers Called from a prop which in turn is called from ...
virtual void ReplaceShaderPositionVC(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
virtual void ReplaceShaderNormal(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
vtkNew< vtkTransform > VBOInverseTransform
vtkOpenGLVertexBufferObjectGroup * VBOs
void MapDataArray(const char *vertexAttributeName, const char *dataArrayName, const char *texturename, int fieldAssociation, int componentno)
virtual bool DrawingEdges(vtkRenderer *, vtkActor *)
vtkNew< vtkMatrix4x4 > VBOShiftScale
virtual void BuildBufferObjects(vtkRenderer *ren, vtkActor *act)
Build the VBO/IBO, called by UpdateBufferObjects.
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
void RemoveVertexAttributeMapping(const char *vertexAttributeName) override
Remove a vertex attribute mapping.
void MapDataArrayToVertexAttribute(const char *vertexAttributeName, const char *dataArrayName, int fieldAssociation, int componentno=-1) override
Select a data array from the point/cell data and map it to a generic vertex attribute.
virtual void ReplaceShaderPicking(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
void GetCoincidentParameters(vtkRenderer *ren, vtkActor *actor, float &factor, float &offset)
helper function to get the appropriate coincident params
virtual bool HaveTCoords(vtkPolyData *poly)
int GetOpenGLMode(int representation, int primType)
virtual void ReplaceShaderColor(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
void RemoveAllVertexAttributeMappings() override
Remove all vertex attributes.
~vtkOpenGLPolyDataMapper() override
std::map< std::tuple< unsigned int, unsigned int, vtkIdType >, std::vector< vtkIdType > > SelectionCache
virtual bool HaveTextures(vtkActor *actor)
virtual void UpdateBufferObjects(vtkRenderer *ren, vtkActor *act)
Update the VBO/IBO to be current.
virtual void BuildCellTextures(vtkRenderer *ren, vtkActor *, vtkCellArray *prims[4], int representation)
void AddCellIdsToSelectionPrimitives(vtkPolyData *poly, const char *arrayName, unsigned int processId, unsigned int compositeIndex, vtkIdType selectedId)
Asynchronously measures GPU execution time for a single event.
represent GPU shader properties
OpenGL texture map.
manage vertex buffer objects shared within a mapper
represent and manipulate 3D points
Definition: vtkPoints.h:34
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
abstract specification for renderers
Definition: vtkRenderer.h:64
Vertex or Fragment shader, combined into a ShaderProgram.
Definition: vtkShader.h:38
Class to make storing and comparing state quick and easy.
abstracts an OpenGL texture object.
handles properties associated with a texture map
Definition: vtkTexture.h:66
record modification and/or execution time
Definition: vtkTimeStamp.h:33
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
@ offset
Definition: vtkX3D.h:444
@ string
Definition: vtkX3D.h:496
#define VTK_DEPRECATED_IN_9_0_0(reason)
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287