Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
An abstract class that represents all the objects that can be rendered. More...
#include <Renderable.hpp>
Public Member Functions | |
Renderable () | |
Constructor. More... | |
virtual | ~Renderable () |
Destructor. More... | |
void | render (const Actor *actor, const Shader *shader, const Camera *camera, OpenGLContext *gl_context) |
Renders the Renderable and if necessary compiles the display list and updates the BufferObjects. More... | |
void | computeBounds () |
Recomputes the bounding box and bounding sphere of a Renderable. More... | |
long long | boundsUpdateTick () const |
Returns the bounds-update-tick which is a counter incremented every time the bounding box or bounding sphere is updated. More... | |
void | setBoundsDirty (bool dirty) |
Marks the bounding box and bounding sphere as dirty in order to be recomputed at the next rendering. More... | |
bool | boundsDirty () const |
Returns whether the bounding sphere or bounding box are "dirty", that is, meant to be recomputed. More... | |
void | setBoundingBox (const AABB &aabb) |
Sets the bounding box of a Renderable. More... | |
void | setBoundingSphere (const Sphere &sphere) |
Sets the bounding sphere of a Renderable. More... | |
const AABB & | boundingBox () const |
Returns the bounding box of a Renderable without recomputing the bounds if dirty. More... | |
const Sphere & | boundingSphere () const |
Returns the bounding sphere of a Renderable without recomputing the bounds if dirty. More... | |
const AABB & | boundingBox () |
Returns the bounding box of a Renderable recomputing the bounds if dirty. More... | |
const Sphere & | boundingSphere () |
Returns the bounding sphere of a Renderable recomputing the bounds if dirty. More... | |
unsigned int | displayList () const |
Returns the display list associated to a Renderable or 0 (zero) if no display list is associated. More... | |
void | setDisplayList (unsigned int disp_list) |
Manually assciates a display list to a Renderable (to be used with care). More... | |
bool | isDisplayListEnabled () const |
Returns true if display lists are enabled for a Renderable (disabled by default). More... | |
void | setDisplayListEnabled (bool enabled) |
Enable/disable display lists (disabled by default). More... | |
bool | displayListDirty () const |
Whether the display list associated to a Renderable should be recompiled at the next rendering. More... | |
void | setDisplayListDirty (bool dirty) |
Whether the display list associated to a Renderable should be recompiled at the next rendering. More... | |
bool | isBufferObjectEnabled () const |
Returns true if BufferObject (vertex buffer object) are enabled for a Renderable (enabled by default). More... | |
void | setBufferObjectEnabled (bool enabled) |
Enable/disable BufferObject (vertex buffer object) (enabled by default). More... | |
bool | isBufferObjectDirty () const |
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering. More... | |
void | setBufferObjectDirty (bool dirty=true) |
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering. More... | |
virtual void | updateDirtyBufferObject (EBufferObjectUpdateMode)=0 |
Uploads the data stored in the local buffers on the GPU memory. More... | |
virtual void | deleteBufferObject ()=0 |
Destroys the BufferObject (vertex buffer objects) associated to this a Renderable. More... | |
void | deleteDisplayList () |
Deletes the display list currently associated to a Renderable. 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 | |
Renderable & | operator= (const Renderable &)=default |
operator= More... | |
virtual void | computeBounds_Implementation ()=0 |
virtual void | render_Implementation (const Actor *actor, const Shader *shader, const Camera *camera, OpenGLContext *gl_context) const =0 |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Additional Inherited Members | |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
An abstract class that represents all the objects that can be rendered.
In order to render a Renderable you have to bind it to an Actor. An Actor glues together a Renderable, an Effect and eventually a Transform. Note that the same Renderable can be associated to more than one Actor.
Definition at line 58 of file Renderable.hpp.
|
inline |
Constructor.
Definition at line 73 of file Renderable.hpp.
|
inlinevirtual |
Destructor.
Definition at line 77 of file Renderable.hpp.
|
inline |
Returns the bounding box of a Renderable without recomputing the bounds if dirty.
Definition at line 155 of file Renderable.hpp.
References vl::Log::warning().
Referenced by vl::Actor::computeBounds(), vl::DistanceLODEvaluator::evaluate(), vl::PixelLODEvaluator::evaluate(), vlX::VLXClassWrapper_Renderable::exportRenderable(), vl::makeTeapot(), vl::OcclusionCullRenderer::render_pass2(), and vl::RenderQueue::sort().
|
inline |
Returns the bounding box of a Renderable recomputing the bounds if dirty.
Definition at line 171 of file Renderable.hpp.
|
inline |
Returns the bounding sphere of a Renderable without recomputing the bounds if dirty.
Definition at line 163 of file Renderable.hpp.
References vl::Log::warning().
Referenced by vlX::VLXClassWrapper_Renderable::exportRenderable().
|
inline |
Returns the bounding sphere of a Renderable recomputing the bounds if dirty.
Definition at line 179 of file Renderable.hpp.
|
inline |
Returns whether the bounding sphere or bounding box are "dirty", that is, meant to be recomputed.
Definition at line 130 of file Renderable.hpp.
Referenced by vl::Actor::boundsDirty(), vl::Actor::computeBounds(), and vlX::VLXClassWrapper_Renderable::exportRenderable().
|
inline |
Returns the bounds-update-tick which is a counter incremented every time the bounding box or bounding sphere is updated.
Definition at line 124 of file Renderable.hpp.
Referenced by vl::Actor::boundsDirty(), and vl::Actor::computeBounds().
|
inline |
Recomputes the bounding box and bounding sphere of a Renderable.
Definition at line 121 of file Renderable.hpp.
|
protectedpure virtual |
Implemented in vl::Geometry, vl::CoreText, vl::DrawPixels, vl::Text, and vl::Clear.
|
pure virtual |
Destroys the BufferObject (vertex buffer objects) associated to this a Renderable.
Implemented in vl::DrawPixels, vl::CoreText, vl::Text, vl::Geometry, and vl::Clear.
|
inline |
Deletes the display list currently associated to a Renderable.
Definition at line 225 of file Renderable.hpp.
|
inline |
Returns the display list associated to a Renderable or 0 (zero) if no display list is associated.
Definition at line 187 of file Renderable.hpp.
|
inline |
Whether the display list associated to a Renderable should be recompiled at the next rendering.
Definition at line 199 of file Renderable.hpp.
|
inline |
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering.
Definition at line 211 of file Renderable.hpp.
|
inline |
Returns true
if BufferObject (vertex buffer object) are enabled for a Renderable (enabled by default).
Definition at line 205 of file Renderable.hpp.
Referenced by vlX::VLXClassWrapper_Renderable::exportRenderable(), and vl::Geometry::render_Implementation().
|
inline |
Returns true
if display lists are enabled for a Renderable (disabled by default).
Definition at line 193 of file Renderable.hpp.
Referenced by vlX::VLXClassWrapper_Renderable::exportRenderable(), and vl::Geometry::render_Implementation().
|
protecteddefault |
operator=
|
inline |
Renders the Renderable and if necessary compiles the display list and updates the BufferObjects.
Definition at line 80 of file Renderable.hpp.
References vl::BUM_KeepRamBuffer, VL_CHECK, and VL_CHECK_OGL.
Referenced by vl::Renderer::renderRaw(), and vl::EdgeRenderer::renderSolids().
|
protectedpure virtual |
Implemented in vl::Geometry, vl::CoreText, vl::DrawPixels, vl::Text, and vl::Clear.
|
inline |
Sets the bounding box of a Renderable.
Definition at line 133 of file Renderable.hpp.
Referenced by vl::Geometry::computeBounds_Implementation(), vlX::VLXClassWrapper_Renderable::importRenderable(), and vl::Terrain::init().
|
inline |
Sets the bounding sphere of a Renderable.
Definition at line 144 of file Renderable.hpp.
Referenced by vl::Geometry::computeBounds_Implementation(), vlX::VLXClassWrapper_Renderable::importRenderable(), and vl::Terrain::init().
|
inline |
Marks the bounding box and bounding sphere as dirty in order to be recomputed at the next rendering.
Definition at line 127 of file Renderable.hpp.
Referenced by vl::TrackballManipulator::adjustView(), and vl::Terrain::init().
|
inline |
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering.
Definition at line 214 of file Renderable.hpp.
Referenced by vl::Geometry::clearArrays(), and vl::DepthSortCallback::onActorRenderStarted().
|
inline |
Enable/disable BufferObject (vertex buffer object) (enabled by default).
Definition at line 208 of file Renderable.hpp.
Referenced by vl::EdgeExtractor::generateEdgeGeometry(), vlX::VLXClassWrapper_Renderable::importRenderable(), and vl::VolumePlot::setupLabels().
|
inline |
Manually assciates a display list to a Renderable (to be used with care).
Definition at line 190 of file Renderable.hpp.
|
inline |
Whether the display list associated to a Renderable should be recompiled at the next rendering.
Definition at line 202 of file Renderable.hpp.
Referenced by vl::DepthSortCallback::onActorRenderStarted().
|
inline |
Enable/disable display lists (disabled by default).
Definition at line 196 of file Renderable.hpp.
Referenced by vlX::VLXClassWrapper_Renderable::importRenderable(), and vl::VolumePlot::setupLabels().
|
pure virtual |
Uploads the data stored in the local buffers on the GPU memory.
If 'discard_local_data' is set to true
the memory used by the local buffers is released.
Implemented in vl::DrawPixels, vl::CoreText, vl::Text, vl::Geometry, and vl::Clear.
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:53.
© Copyright Michele Bosi. All rights reserved.