Class to render a cylinder in OpenGL. Height of the cone is along the Z-axis where the tip is at (0, 0, 0).
More...
|
enum | EVertexMember : VertexMember { vmPosition = 1 << 0
, vmNormal = 1 << 1
, vmColor = 1 << 2
, vmTexCoord = 1 << 3
} |
| Possible member of a vertex structure. Where the position can not be omitted as part of the vertex. More...
|
|
enum | EDrawMode { dmDrawArrays
, dmDrawElements
} |
| Drawing mode of by the template. More...
|
|
enum | ERenderOption : int { roNone = 0
, roWires = 1 << 0
, roNormals = 1 << 1
} |
| Render options. More...
|
|
typedef unsigned | VertexMember |
| Type used to describe vertex structure members.
|
|
typedef TVector< std::pair< vector3f, vector3f > > | NormalsDataType |
| Type for extracting normals from all used vertices.
|
|
static const Color & | getDefaultColor () |
| Gets the default color used by the vertex structures when not set by the derived class. Created to have a single location for the default color.
An example how it is used:
|
|
static void | setDefaultColor (const QColor &color) |
| Sets the default color used by the vertex structures when not set by the derived class.
|
|
using | Vertex = std::conditional_t< VertexMembers==vmPosition, VT_Position, std::conditional_t< VertexMembers==(vmPosition|vmColor), VT_PositionColor, std::conditional_t< VertexMembers==(vmPosition|vmNormal), VT_PositionNormal, std::conditional_t< VertexMembers==(vmPosition|vmNormal|vmColor), VT_PositionNormalColor, std::conditional_t< VertexMembers==(vmPosition|vmTexCoord), VT_PositionTexture, std::conditional_t< VertexMembers==(vmPosition|vmNormal|vmTexCoord), VT_PositionNormalTexture, std::conditional_t< VertexMembers==(vmPosition|vmNormal|vmColor|vmTexCoord), VT_PositionNormalColorTexture, void > > > > > > > |
| Conditional vertex structure type. Used for memory locations.
|
|
typedef TVector< GLuint > | IndexVectorType |
| Type definition for storing indices.
|
|
bool | setup () override |
| Sets up the vertex array for the OpenGL context.
|
|
void | setupLayout () |
| Sets up the layout of the Vertex structure for OpenGL.
|
|
void | setAttribPointer (ShaderProgram::Attribute sa, size_t offset) |
| Makes a call to setVertexAttribPointer().
|
|
void | callModifyContext (const ModeRange &mr, bool before, bool draw, size_t mode_index) |
| Calls the function modifyContext when overridden.
|
|
bool | checkData () const |
| Check the data integrity of indices to vertices,.
|
|
bool | callGenerate () |
| Makes a call to virtual function generate() when the #_generateFlag is set using triggerGenerate().
|
|
virtual void | modifyContext (bool before, bool draw, size_t mode_index) |
| Allows modifying the OpenGL context before and after drawing.
|
|
bool | isTriggered () const |
| Gets the flag if data is to be (re-)generated. Flag is set to True initially.
|
|
TVector< Vertex > | _vertices |
| Holds the data of the vertices before being copied to OpenGL memory.
|
|
IndexVectorType | _indices |
| Holds the data of the indices for solid and wire drawing.
|
|
TVector< ModeRange > | _modes |
| Modes to call glDrawArrays() or glDrawElements() depending on the _indices member not being empty.
|
|
Class to render a cylinder in OpenGL. Height of the cone is along the Z-axis where the tip is at (0, 0, 0).