Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The base class of DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements. More...
#include <DrawCall.hpp>
Public Member Functions | |
DrawCall () | |
Constructor. More... | |
DrawCall & | operator= (const DrawCall &other) |
Assignment operator. More... | |
void | setPrimitiveType (EPrimitiveType type) |
Sets the draw call's primitive type. More... | |
EPrimitiveType | primitiveType () const |
Returns the draw call's primitive type. More... | |
virtual void | render (bool use_bo=true) const =0 |
Executes the draw call. More... | |
virtual ref< DrawCall > | clone () const =0 |
Returns a clone of the draw call. More... | |
virtual void | updateDirtyBufferObject (EBufferObjectUpdateMode)=0 |
Updates the index buffer's BufferObject if marked as dirty. More... | |
virtual void | deleteBufferObject ()=0 |
Deletes the index buffer's BufferObject. More... | |
void | setEnabled (bool enable) |
Enables/disables the draw call. More... | |
bool | isEnabled () const |
True if the draw call is enabled. More... | |
virtual TriangleIterator | triangleIterator () const =0 |
Returns a TriangleIterator used to iterate through the triangles of a DrawCall. More... | |
virtual IndexIterator | indexIterator () const =0 |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall. More... | |
u32 | countIndices () const |
Counts the number of virtual indices of a DrawCall., i.e. More... | |
u32 | countTriangles () const |
Counts the number of virtual triangles of a DrawCall., i.e. More... | |
virtual int | instances () const |
Returns the number of instances for this set of primitives. More... | |
virtual bool | primitiveRestartEnabled () const |
Returns whether the primitive-restart functionality is enabled or not. More... | |
virtual unsigned int | primitiveRestartIndex () |
Returns the primitive restart index used by the draw call or 0 if primitive restart is not supported. More... | |
void | setPatchParameter (PatchParameter *patch_param) |
Attach a PatchParameter to a DrawCall to be used when using primitive-type PT_PATCHES. More... | |
PatchParameter * | patchParameter () |
The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES. More... | |
const PatchParameter * | patchParameter () const |
The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES. More... | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Member Functions | |
void | applyPatchParameters () const |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Protected Attributes | |
ref< PatchParameter > | mPatchParameter |
EPrimitiveType | mType |
bool | mEnabled |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
The base class of DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements.
which are used by Geometry to define a set of primitives to be rendered (see also Geometry::drawCalls()).
vl::DrawArrays wraps:
Supports:
vl::DrawElements wraps:
Supports:
vl::DrawRangeElements wraps:
Supports:
vl::MultiDrawElements wraps:
Supports:
DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements are used by Geometry to define a set of primitives to be rendered.
Definition at line 90 of file DrawCall.hpp.
|
inline |
Constructor.
Definition at line 96 of file DrawCall.hpp.
|
inlineprotected |
Definition at line 178 of file DrawCall.hpp.
References mPatchParameter, mType, vl::PT_PATCHES, and vl::Log::warning().
Referenced by vl::DrawArrays::render(), vl::MultiDrawElements< ArrayUShort1 >::render(), vl::DrawElements< ArrayUShort1 >::render(), and vl::DrawRangeElements< ArrayUShort1 >::render().
Returns a clone of the draw call.
Implemented in vl::DrawRangeElements< arr_type >, vl::DrawRangeElements< ArrayUInt1 >, vl::DrawRangeElements< ArrayUByte1 >, vl::DrawRangeElements< ArrayUShort1 >, vl::DrawElements< arr_type >, vl::DrawElements< ArrayUInt1 >, vl::DrawElements< ArrayUByte1 >, vl::DrawElements< ArrayUShort1 >, vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, vl::MultiDrawElements< ArrayUShort1 >, and vl::DrawArrays.
Referenced by primitiveType().
|
inline |
Counts the number of virtual indices of a DrawCall., i.e.
the number of indices you would retrieve by iterating over the iterator returned by indexIterator().
Definition at line 142 of file DrawCall.hpp.
References vl::IndexIterator::hasNext(), and indexIterator().
Referenced by vl::AdjacencyExtractor::extract().
|
inline |
Counts the number of virtual triangles of a DrawCall., i.e.
the number of triangles you would retrieve by iterating over the iterator returned by triangleIterator().
Definition at line 151 of file DrawCall.hpp.
References vl::TriangleIterator::hasNext(), and triangleIterator().
Referenced by vl::Geometry::fixTriangleWinding(), vl::Geometry::mergeDrawCallsWithTriangles(), and vl::Geometry::triangulateDrawCalls().
|
pure virtual |
Deletes the index buffer's BufferObject.
Implemented in vl::DrawRangeElements< arr_type >, vl::DrawRangeElements< ArrayUInt1 >, vl::DrawRangeElements< ArrayUByte1 >, vl::DrawRangeElements< ArrayUShort1 >, vl::DrawElements< arr_type >, vl::DrawElements< ArrayUInt1 >, vl::DrawElements< ArrayUByte1 >, vl::DrawElements< ArrayUShort1 >, vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, vl::MultiDrawElements< ArrayUShort1 >, and vl::DrawArrays.
Referenced by primitiveType().
|
pure virtual |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall.
This
Implemented in vl::DrawElements< arr_type >, vl::DrawElements< ArrayUInt1 >, vl::DrawElements< ArrayUByte1 >, vl::DrawElements< ArrayUShort1 >, vl::DrawRangeElements< arr_type >, vl::DrawRangeElements< ArrayUInt1 >, vl::DrawRangeElements< ArrayUByte1 >, vl::DrawRangeElements< ArrayUShort1 >, vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, vl::MultiDrawElements< ArrayUShort1 >, and vl::DrawArrays.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::computeRange(), countIndices(), isEnabled(), and vl::Geometry::shrinkDrawCalls().
|
inlinevirtual |
Returns the number of instances for this set of primitives.
Reimplemented in vl::DrawArrays, and vl::DrawElementsBase.
Definition at line 160 of file DrawCall.hpp.
Referenced by vl::Geometry::shrinkDrawCalls(), and vl::Geometry::triangulateDrawCalls().
|
inline |
True if the draw call is enabled.
Definition at line 128 of file DrawCall.hpp.
References indexIterator(), mEnabled, and triangleIterator().
Referenced by vlX::VLXClassWrapper_DrawCall::exportDrawCallBase().
|
inline |
The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES.
Definition at line 172 of file DrawCall.hpp.
References mPatchParameter.
Referenced by vlX::VLXClassWrapper_DrawCall::exportDrawCallBase().
|
inline |
The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES.
Definition at line 175 of file DrawCall.hpp.
References mPatchParameter.
|
inlinevirtual |
Returns whether the primitive-restart functionality is enabled or not.
See http://www.opengl.org/registry/specs/NV/primitive_restart.txt
Reimplemented in vl::DrawRangeElementsBase, vl::DrawElementsBase, and vl::MultiDrawElementsBase.
Definition at line 163 of file DrawCall.hpp.
Referenced by vl::Geometry::shrinkDrawCalls(), and vl::Geometry::sortVertices().
|
inlinevirtual |
Returns the primitive restart index used by the draw call or 0 if primitive restart is not supported.
Reimplemented in vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, vl::MultiDrawElements< ArrayUShort1 >, vl::DrawRangeElements< arr_type >, vl::DrawRangeElements< ArrayUInt1 >, vl::DrawRangeElements< ArrayUByte1 >, vl::DrawRangeElements< ArrayUShort1 >, vl::DrawElements< arr_type >, vl::DrawElements< ArrayUInt1 >, vl::DrawElements< ArrayUByte1 >, and vl::DrawElements< ArrayUShort1 >.
Definition at line 166 of file DrawCall.hpp.
Referenced by vl::Geometry::shrinkDrawCalls().
|
inline |
Returns the draw call's primitive type.
Definition at line 110 of file DrawCall.hpp.
References clone(), deleteBufferObject(), mType, render(), and updateDirtyBufferObject().
Referenced by vl::DrawArrays::clone(), vlX::VLXClassWrapper_DrawCall::exportDrawCallBase(), vl::AdjacencyExtractor::extract(), vl::Geometry::fixTriangleWinding(), vlX::VLXClassWrapper_DrawCall::importDrawCall(), vl::Geometry::makeGLESFriendly(), vl::Geometry::mergeDrawCallsWithTriangles(), vl::Geometry::mergeTriangleStrips(), vl::DrawArrays::render(), vl::MultiDrawElements< ArrayUShort1 >::render(), vl::DrawElements< ArrayUShort1 >::render(), vl::DrawRangeElements< ArrayUShort1 >::render(), vl::Geometry::shrinkDrawCalls(), vl::Geometry::sortVertices(), vl::DrawArrays::triangleIterator(), vl::MultiDrawElements< ArrayUShort1 >::triangleIterator(), vl::DrawRangeElements< ArrayUShort1 >::triangleIterator(), vl::DrawElements< ArrayUShort1 >::triangleIterator(), and vl::Geometry::triangulateDrawCalls().
|
pure virtual |
Executes the draw call.
Implemented in vl::DrawRangeElements< arr_type >, vl::DrawRangeElements< ArrayUInt1 >, vl::DrawRangeElements< ArrayUByte1 >, vl::DrawRangeElements< ArrayUShort1 >, vl::DrawElements< arr_type >, vl::DrawElements< ArrayUInt1 >, vl::DrawElements< ArrayUByte1 >, vl::DrawElements< ArrayUShort1 >, vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, vl::MultiDrawElements< ArrayUShort1 >, and vl::DrawArrays.
Referenced by primitiveType().
|
inline |
Enables/disables the draw call.
Definition at line 125 of file DrawCall.hpp.
References mEnabled.
Referenced by vlX::VLXClassWrapper_DrawCall::importDrawCall(), and vl::Geometry::makeGLESFriendly().
|
inline |
Attach a PatchParameter to a DrawCall to be used when using primitive-type PT_PATCHES.
Definition at line 169 of file DrawCall.hpp.
References mPatchParameter.
|
inline |
Sets the draw call's primitive type.
Definition at line 107 of file DrawCall.hpp.
References mType.
Referenced by vlX::VLXClassWrapper_DrawCall::importDrawCall().
|
pure virtual |
Returns a TriangleIterator used to iterate through the triangles of a DrawCall.
Basically the iterator tesselates in triangles any DrawCall of type: PT_TRIANGLES, PT_TRIANGLE_STRIP PT_TRIANGLE_FAN, PT_POLYGON, PT_QUADS, PT_QUAD_STRIP.
Implemented in vl::DrawElements< arr_type >, vl::DrawElements< ArrayUInt1 >, vl::DrawElements< ArrayUByte1 >, vl::DrawElements< ArrayUShort1 >, vl::DrawRangeElements< arr_type >, vl::DrawRangeElements< ArrayUInt1 >, vl::DrawRangeElements< ArrayUByte1 >, vl::DrawRangeElements< ArrayUShort1 >, vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, vl::MultiDrawElements< ArrayUShort1 >, and vl::DrawArrays.
Referenced by vl::Geometry::computeTangentSpace(), countTriangles(), vl::AdjacencyExtractor::extract(), vl::EdgeExtractor::extractEdges(), vl::RayIntersector::intersectGeometry(), isEnabled(), vl::MultiDrawElements< ArrayUShort1 >::render(), vl::PolygonSimplifier::simplify(), and vl::Geometry::triangulateDrawCalls().
|
pure virtual |
Updates the index buffer's BufferObject if marked as dirty.
Implemented in vl::DrawRangeElements< arr_type >, vl::DrawRangeElements< ArrayUInt1 >, vl::DrawRangeElements< ArrayUByte1 >, vl::DrawRangeElements< ArrayUShort1 >, vl::DrawElements< arr_type >, vl::DrawElements< ArrayUInt1 >, vl::DrawElements< ArrayUByte1 >, vl::DrawElements< ArrayUShort1 >, vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, vl::MultiDrawElements< ArrayUShort1 >, and vl::DrawArrays.
Referenced by primitiveType().
|
protected |
Definition at line 197 of file DrawCall.hpp.
Referenced by isEnabled(), operator=(), and setEnabled().
|
protected |
Definition at line 195 of file DrawCall.hpp.
Referenced by applyPatchParameters(), patchParameter(), and setPatchParameter().
|
protected |
Definition at line 196 of file DrawCall.hpp.
Referenced by applyPatchParameters(), vl::DrawArrays::DrawArrays(), vl::DrawElements< ArrayUShort1 >::DrawElements(), vl::DrawRangeElements< ArrayUShort1 >::DrawRangeElements(), vl::MultiDrawElements< ArrayUShort1 >::MultiDrawElements(), operator=(), primitiveType(), and setPrimitiveType().
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:07.
© Copyright Michele Bosi. All rights reserved.