Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::MeshDrawerGL Class Reference
+ Inheritance diagram for inviwo::MeshDrawerGL:

Classes

class  DrawObject
 This class provides functionality for efficient, subsequent drawing of a mesh. The buffers of the mesh will be bound once this class is instantiated. More...
 

Public Types

enum class  DrawMode {
  NotSpecified = 0 , Points , Lines , LineStrip ,
  LineLoop , LinesAdjacency , LineStripAdjacency , Triangles ,
  TriangleStrip , TriangleFan , TrianglesAdjacency , TriangleStripAdjacency ,
  NumberOfDrawModes
}
 

Public Member Functions

 MeshDrawerGL (const Mesh *mesh)
 
 MeshDrawerGL (const MeshDrawerGL &rhs)=default
 
 MeshDrawerGL (MeshDrawerGL &&other)=default
 
MeshDrawerGLoperator= (const MeshDrawerGL &other)=default
 
MeshDrawerGLoperator= (MeshDrawerGL &&rhs)=default
 
DrawObject getDrawObject () const
 
virtual void draw () override
 draws the mesh using its mesh info. If index buffers are present, the mesh will be rendered with glDrawElements() using those index buffers and the associated draw modes. Otherwise, the entire mesh is rendered using glDrawArrays with the default draw mode returned by Mesh::getDefaultMeshInfo().
 
virtual void draw (DrawMode drawMode)
 draws the mesh with the specified draw mode. If index buffers are present, the mesh will be rendered with glDrawElements() using those index buffers. Otherwise, the entire mesh is rendered using glDrawArrays.
 
virtual const MeshgetMesh () const override
 
- Public Member Functions inherited from inviwo::MeshDrawer

Static Public Member Functions

static DrawObject getDrawObject (const Mesh *mesh)
 
static DrawMode getDrawMode (DrawType, ConnectivityType)
 
static DrawMode getDrawMode (Mesh::MeshInfo meshInfo)
 
static GLenum getGLDrawMode (DrawMode)
 
static GLenum getGLDrawMode (Mesh::MeshInfo meshInfo)
 

Protected Member Functions

virtual MeshDrawercreate (const Mesh *geom) const override
 
virtual bool canDraw (const Mesh *geom) const override
 
- Protected Member Functions inherited from inviwo::MeshDrawer

Protected Attributes

const MeshmeshToDraw_
 

Member Function Documentation

◆ canDraw()

virtual bool inviwo::MeshDrawerGL::canDraw ( const Mesh * geom) const
inlineoverrideprotectedvirtual

Determine if the renderer can render geometry.

Parameters
geomThe Geometry to draw
Returns
Return true if able to render the Geometry, otherwise false.

Implements inviwo::MeshDrawer.

◆ create()

virtual MeshDrawer * inviwo::MeshDrawerGL::create ( const Mesh * geom) const
inlineoverrideprotectedvirtual

Return a new object of the derived class.

Note
The MeshDrawer does not take ownership of the Geometry.
Parameters
geomThe geometry to render. This will always be of a type that canDraw return true for.
Returns
A new renderer.

Implements inviwo::MeshDrawer.

◆ draw() [1/2]

virtual void inviwo::MeshDrawerGL::draw ( )
overridevirtual

draws the mesh using its mesh info. If index buffers are present, the mesh will be rendered with glDrawElements() using those index buffers and the associated draw modes. Otherwise, the entire mesh is rendered using glDrawArrays with the default draw mode returned by Mesh::getDefaultMeshInfo().

See also
Mesh, Mesh::MeshInfo

Implements inviwo::MeshDrawer.

◆ draw() [2/2]

virtual void inviwo::MeshDrawerGL::draw ( DrawMode drawMode)
virtual

draws the mesh with the specified draw mode. If index buffers are present, the mesh will be rendered with glDrawElements() using those index buffers. Otherwise, the entire mesh is rendered using glDrawArrays.

See also
Mesh, DrawMode
Parameters
drawModedraw mode used to render the mesh

◆ getMesh()

virtual const Mesh * inviwo::MeshDrawerGL::getMesh ( ) const
inlineoverridevirtual

Get the geometry to render.

Returns

Implements inviwo::MeshDrawer.


The documentation for this class was generated from the following file: