VISH  0.2
Public Member Functions | Public Attributes
Wizt::VRenderObject Class Reference

Base class for objects that implement a drawing routine. More...

#include </home/werner/origo/vish/ocean/Anemonia/VRenderObject.hpp>

List of all members.

Public Member Functions

Public Attributes


Detailed Description

Base class for objects that implement a drawing routine.

Child classes are supposed to override the render() member function. Note that this member function is not allowed to modify the object itself during rendering. This is to enable multithreaded rendering. All information that may be influenced by the rendering process must be stored in the VRenderContext.

Note:
The bounding box retrieval interface is not yet finished as open questions remain. In particular, as the bounding box of an object may be relative to a local context, the question is how to compute it, if it depends on other input object. At the moment, this issue is left to the virtual getBoundings() procedure, but it might make sense to employ the standard request() operation here. But if so, we also need to make sure that the update() function is called when an input is younger with respect to the bounding box computation. This "with respect to" requirement is the complex aspect here, because it would require to make all Age() variables of a VObject to be dependent on a Request's tasklist. Which maybe is a good idea, maybe not. In any case, it will complicate things.
Examples:

ComputeGridStreamLines.cpp, ComputeMultiStreamLines.cpp, DemoSphere.cpp, and PointSprite.cpp.


Member Function Documentation

void Wizt::VRenderObject::closeBBox ( const RefPtr< ValuePool > &  VP) const

When new points have been added to a bounding box and the process of expansion is finished (such as after some rendering), then the bounding box has to be "closed" which means to do some computations of internal values.

These internal values are used to speed of some operations on bounding boxes, in particular, it will compute the corresponding bounding ball.

void Wizt::VRenderObject::embrace ( const RefPtr< ValuePool > &  VP,
const point_t crd 
) const

Include a certain coordinate point to the current bounding box, i.e.

the current bounding box will be enlarged to cover this point. Note that before adding points, the bounding box needs to be reset first if it eventually was set by some former, independent rendering.

RefPtr< BoundingBall > Wizt::VRenderObject::getBoundingBall ( const RefPtr< ValuePool > &  VP) const [virtual]

Retrieve the bounding volume of the object.

By default, it reads out the interface of the local VObject::State object.

Reimplemented from Wizt::RenderAble.

bool Wizt::VRenderObject::resetBBox ( const RefPtr< ValuePool > &  S) const

Set the bounding box of the current object to an empty state, i.e.

it is undefined yet.

Note:
In general, it is much more efficient to set the bounding box directly using setBoundingBall(), if it is known. However, if that is not the case and the bounding volume has to be computed anyway, this can be done by adding specific points to the current state. A possible approach is to do so during rendering, i.e. feeding all glVertex() calls to the embrace() function. However, while this were exact, it is not a recommended practice, because the embrace() function costs performance. It should be called only for few, but key points. A disadvantage of calling embrace() during rendering of glVertex() is that the first rendering might not yet have the correct bounding box, only subsequent ones.
void Wizt::VRenderObject::setBoundingBall ( const RefPtr< ValuePool > &  VP,
const RefPtr< BoundingBall > &  BS 
) const

Set a bounding volume to the object's local context-relative state in a manner such that it can be retrieved by the default implementation of getBoundingBall().

If getBoundingBall() was overridden in a child class, this function might be useless.


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