VTK
9.4.20241209
|
A base class for mappers or render responders that need to draw primitives via vertex-pulling. More...
#include <vtkDrawTexturedElements.h>
Public Types | |
enum | ElementShape { Point , Line , LineStrip , Triangle , TriangleStrip , TriangleFan , AbstractPatches } |
The type of primitive to output. More... | |
enum | PatchShape { PatchLine , PatchTriangle , PatchQuadrilateral } |
The type of primitive that abstract patches are tessellated into. More... | |
Public Member Functions | |
vtkDrawTexturedElements () | |
virtual | ~vtkDrawTexturedElements () |
vtkShader * | GetShader (vtkShader::Type shaderType) |
Return a shader of the given type (creating as needed). | |
void | BindArrayToTexture (vtkStringToken textureName, vtkDataArray *array, bool asScalars=false) |
Bind a data array to the given textureName (used in shader program texelFetch calls). | |
void | AppendArrayToTexture (vtkStringToken textureName, vtkDataArray *array, bool asScalars=false) |
bool | UnbindArray (vtkStringToken) |
vtkIdType | GetNumberOfInstances () |
Set/get the number of element instances to draw. | |
virtual bool | SetNumberOfInstances (vtkIdType numberOfInstances) |
vtkIdType | GetNumberOfElements () |
Set/get the number of elements (primitives) to draw per instance. | |
virtual bool | SetNumberOfElements (vtkIdType numberOfElements) |
void | DrawInstancedElements (vtkRenderer *ren, vtkActor *a, vtkMapper *mapper) |
Render geometry. | |
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. | |
vtkCollection * | GetGLSLModCollection () const |
Return the GLSL mods. | |
int | GetElementType () |
virtual bool | SetElementType (int elementType) |
int | GetPatchType () |
virtual bool | SetPatchType (int patchType) |
bool | GetIncludeColormap () |
virtual bool | SetIncludeColormap (bool includeColormap) |
Static Public Member Functions | |
static vtkIdType | PatchVertexCountFromPrimitive (int element) |
Return the number of vertices in the patch primitive. | |
Protected Types | |
using | ShaderMap = std::map< vtkShader::Type, vtkShader * > |
Protected Member Functions | |
void | SetCustomUniforms (vtkRenderer *ren, vtkActor *a) |
Set any custom uniforms provided by the actor. | |
void | ReadyShaderProgram (vtkRenderer *ren) |
void | ReportUnsupportedLineWidth (float width, float maxWidth, vtkMapper *mapper) |
void | PreDraw (vtkRenderer *ren, vtkActor *a, vtkMapper *mapper) |
void | DrawInstancedElementsImpl (vtkRenderer *ren, vtkActor *a, vtkMapper *mapper) |
void | PostDraw (vtkRenderer *ren, vtkActor *a, vtkMapper *mapper) |
Protected Attributes | |
Internal * | P { nullptr } |
Private data for this class. | |
vtkIdType | FirstVertexId { 0 } |
vtkIdType | NumberOfInstances { 1 } |
vtkIdType | NumberOfElements { 1 } |
int | ElementType { ElementShape::TriangleStrip } |
int | PatchType { PatchShape::PatchTriangle } |
bool | IncludeColormap { true } |
std::unordered_map< vtkStringToken, vtkOpenGLArrayTextureBufferAdapter > | Arrays |
ShaderMap | Shaders |
vtkSmartPointer< vtkShaderProgram > | ShaderProgram |
vtkNew< vtkOpenGLVertexArrayObject > | VAO |
vtkNew< vtkOpenGLTexture > | ColorTextureGL |
vtkNew< vtkCollection > | GLSLMods |
A base class for mappers or render responders that need to draw primitives via vertex-pulling.
Since this class is intended to be inherited by other classes that must also inherit a VTK mapper or responder class, it is not a subclass of vtkObject; instead, it provides methods your subclass can invoke during rendering.
This currently handles hexahedra and tetrahedra.
Definition at line 47 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 150 of file vtkDrawTexturedElements.h.
The type of primitive to output.
Definition at line 54 of file vtkDrawTexturedElements.h.
The type of primitive that abstract patches are tessellated into.
Definition at line 66 of file vtkDrawTexturedElements.h.
vtkDrawTexturedElements::vtkDrawTexturedElements | ( | ) |
|
virtual |
vtkShader * vtkDrawTexturedElements::GetShader | ( | vtkShader::Type | shaderType | ) |
Return a shader of the given type (creating as needed).
void vtkDrawTexturedElements::BindArrayToTexture | ( | vtkStringToken | textureName, |
vtkDataArray * | array, | ||
bool | asScalars = false |
||
) |
Bind a data array to the given textureName (used in shader program texelFetch calls).
If asScalars is false (the default), then the array's components are treated as components of single texture values. If asScalars is true, then a 2-d texture image is uploaded where each value is a scalar (row indices are tuple IDs, column indices are component IDs).
void vtkDrawTexturedElements::AppendArrayToTexture | ( | vtkStringToken | textureName, |
vtkDataArray * | array, | ||
bool | asScalars = false |
||
) |
bool vtkDrawTexturedElements::UnbindArray | ( | vtkStringToken | ) |
|
inline |
Set/get the number of element instances to draw.
Definition at line 88 of file vtkDrawTexturedElements.h.
|
virtual |
Reimplemented in vtkArrayRenderer.
|
inline |
Set/get the number of elements (primitives) to draw per instance.
Definition at line 92 of file vtkDrawTexturedElements.h.
|
virtual |
Reimplemented in vtkArrayRenderer.
|
inline |
Set/get the type of elements to draw.
This determines the number of vertices rendered per element. Values must come from the ElementShape enum; the default is ElementShape::TriangleStrip.
Definition at line 101 of file vtkDrawTexturedElements.h.
|
virtual |
Set/get the type of elements to draw.
This determines the number of vertices rendered per element. Values must come from the ElementShape enum; the default is ElementShape::TriangleStrip.
Reimplemented in vtkArrayRenderer.
|
inline |
Set/get the type of primitive an abstract patch gets tessellated into.
This determines the number of input patch vertices to the tessellation shaders. Values must come from the PatchShape enum; the default is PatchShape::Triangle.
Definition at line 111 of file vtkDrawTexturedElements.h.
|
virtual |
Set/get the type of primitive an abstract patch gets tessellated into.
This determines the number of input patch vertices to the tessellation shaders. Values must come from the PatchShape enum; the default is PatchShape::Triangle.
|
inline |
Set/get whether to upload a colormap texture.
If enabled (the default), then create (if needed) and upload a colormap texture image bound to a "color_map" uniform sampler.
Definition at line 120 of file vtkDrawTexturedElements.h.
|
virtual |
Set/get whether to upload a colormap texture.
If enabled (the default), then create (if needed) and upload a colormap texture image bound to a "color_map" uniform sampler.
void vtkDrawTexturedElements::DrawInstancedElements | ( | vtkRenderer * | ren, |
vtkActor * | a, | ||
vtkMapper * | mapper | ||
) |
Render geometry.
This just calls glDrawElementInstanced().
void vtkDrawTexturedElements::ReleaseResources | ( | vtkWindow * | window | ) |
Release any graphics resources associated with the window.
vtkShaderProgram * vtkDrawTexturedElements::GetShaderProgram | ( | ) |
Return the internal shader program so subclasses can create/replace shaders.
vtkCollection * vtkDrawTexturedElements::GetGLSLModCollection | ( | ) | const |
Return the GLSL mods.
|
static |
Return the number of vertices in the patch primitive.
|
protected |
Set any custom uniforms provided by the actor.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Private data for this class.
Definition at line 154 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 155 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 156 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 157 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 158 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 159 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 160 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 161 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 162 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 163 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 164 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 165 of file vtkDrawTexturedElements.h.
|
protected |
Definition at line 166 of file vtkDrawTexturedElements.h.