15#ifndef vtkDrawTexturedElements_h
16#define vtkDrawTexturedElements_h
18#include "vtkRenderingOpenGL2Module.h"
28#include <unordered_map>
30VTK_ABI_NAMESPACE_BEGIN
34class vtkGLSLRuntimeModBase;
150 using ShaderMap = std::map<vtkShader::Type, vtkShader*>;
154 Internal* P{
nullptr };
158 int ElementType{ ElementShape::TriangleStrip };
159 int PatchType{ PatchShape::PatchTriangle };
160 bool IncludeColormap{
true };
161 std::unordered_map<vtkStringToken, vtkOpenGLArrayTextureBufferAdapter>
Arrays;
represents an object (geometry & properties) in a rendered scene
create and manipulate ordered lists of objects
abstract superclass for arrays of numeric data
A base class for mappers or render responders that need to draw primitives via vertex-pulling.
virtual ~vtkDrawTexturedElements()
vtkNew< vtkOpenGLTexture > ColorTextureGL
virtual bool SetPatchType(int patchType)
void PostDraw(vtkRenderer *ren, vtkActor *a, vtkMapper *mapper)
vtkNew< vtkOpenGLVertexArrayObject > VAO
void DrawInstancedElementsImpl(vtkRenderer *ren, vtkActor *a, vtkMapper *mapper)
PatchShape
The type of primitive that abstract patches are tessellated into.
@ PatchQuadrilateral
Input to the essellation control shader is a quadrilateral.
@ PatchLine
Input to the essellation control shader is a line segment.
@ PatchTriangle
Input to the essellation control shader is a triangle.
void ReadyShaderProgram(vtkRenderer *ren)
vtkIdType GetNumberOfInstances()
Set/get the number of element instances to draw.
vtkCollection * GetGLSLModCollection() const
Return the GLSL mods.
ElementShape
The type of primitive to output.
@ Triangle
Send triangles to the shader.
@ TriangleStrip
Send triangles to the shader (moving window of 3 vertices).
@ TriangleFan
Send triangle fans to the shader (first vertex is constant).
@ Line
Send line segments to the shader.
@ LineStrip
Send line segments to the shader.
@ Point
Send points to the shader.
vtkSmartPointer< vtkShaderProgram > ShaderProgram
void BindArrayToTexture(vtkStringToken textureName, vtkDataArray *array, bool asScalars=false)
Bind a data array to the given textureName (used in shader program texelFetch calls).
vtkIdType GetNumberOfElements()
Set/get the number of elements (primitives) to draw per instance.
bool GetIncludeColormap()
virtual bool SetNumberOfInstances(vtkIdType numberOfInstances)
void DrawInstancedElements(vtkRenderer *ren, vtkActor *a, vtkMapper *mapper)
Render geometry.
virtual bool SetElementType(int elementType)
bool UnbindArray(vtkStringToken)
vtkShader * GetShader(vtkShader::Type shaderType)
Return a shader of the given type (creating as needed).
vtkDrawTexturedElements()
void AppendArrayToTexture(vtkStringToken textureName, vtkDataArray *array, bool asScalars=false)
std::unordered_map< vtkStringToken, vtkOpenGLArrayTextureBufferAdapter > Arrays
void ReleaseResources(vtkWindow *window)
Release any graphics resources associated with the window.
vtkShaderProgram * GetShaderProgram()
Return the internal shader program so subclasses can create/replace shaders.
void ReportUnsupportedLineWidth(float width, float maxWidth, vtkMapper *mapper)
void PreDraw(vtkRenderer *ren, vtkActor *a, vtkMapper *mapper)
vtkNew< vtkCollection > GLSLMods
void SetCustomUniforms(vtkRenderer *ren, vtkActor *a)
Set any custom uniforms provided by the actor.
std::map< vtkShader::Type, vtkShader * > ShaderMap
virtual bool SetNumberOfElements(vtkIdType numberOfElements)
static vtkIdType PatchVertexCountFromPrimitive(int element)
Return the number of vertices in the patch primitive.
virtual bool SetIncludeColormap(bool includeColormap)
abstract class specifies interface to map data to graphics primitives
represent and manipulate 3x3 transformation matrices
represent and manipulate 4x4 transformation matrices
Allocate and hold a VTK object.
The VertexArrayObject class uses, or emulates, vertex array objects.
abstract specification for renderers
Superclass for mapping scalar values to colors.
The ShaderProgram uses one or more Shader objects.
Vertex or Fragment shader, combined into a ShaderProgram.
Type
Available shader types.
Hold a reference to a vtkObjectBase instance.
Represent a string by its integer hash.
abstracts an OpenGL texture object.
window superclass for vtkRenderWindow