Public Member Functions | Friends

Fiber::BBoxExpander Class Reference

ingroup BaseOp A field fragment iterator that computes or expand a bounding box. More...

#include <ExpandBBox.hpp>

List of all members.

Public Member Functions

Friends


Detailed Description

ingroup BaseOp A field fragment iterator that computes or expand a bounding box.


Constructor & Destructor Documentation

Fiber::BBoxExpander::BBoxExpander ( const RefPtr< Field > &  Coords  ) 

Computational constructor, computes the bounding box of the given field that is supposed to stored coordinates.

If it was successful, then the BBox member is set, and the bounding box is added as an interface to the given field. On a subsequent call, this interface is used as a cache instead of recomputing the bounding box.

References expand().


Member Function Documentation

bool Fiber::BBoxExpander::apply ( const RefPtr< FragmentID > &  f,
const RefPtr< CreativeArrayBase > &  CAB 
) [virtual]

The iterator's callback function.

Note that

                   BBox->updateBall();

has to be called after iteration.

Implements Fiber::FragmentIterator.

bool Fiber::BBoxExpander::expand ( const RefPtr< Field > &  Coords,
RefPtr< BoundingBox > &  theBox 
)

Expand the given current bounding box by the given coordinate field.

           bool VObject::update(VRequest&Context, double)
           {
           RefPtr<Representation> CartesianVertices = ...;
           BBoxExpander BBE;
                BBE.expand( CartesianVertices->Positions() );
                setBoundingBall( Context, BBE.BBox );
           }
Note:
This function will cache the bounding box of the given field as an Interface to the Field. On subsequent calls, no data will be touched, created, loaded. Consequently, if the numerical values of the Field are changed for whatever reason, this Interface<BoundingBox> needs to be removed as well such that it will be re-created on the next call.
Todo:
Think about generalization to treatment of BoundingBalls instead. For now this is not done, as BoundingBoxes are used in most practical cases, and various operations can be done more efficient on them. Need also to revise the API to add and merge bounding boxes and bounding balls then.

Referenced by BBoxExpander().


Friends And Related Function Documentation

gridop_API bool expandBoundingBox ( RefPtr< BoundingBox > &  theBox,
const RefPtr< Field > &  Coords 
) [friend]

Expand the given bounding box by the bounding box as determined by the Field.

Note that the bounding box on the Field itself will be cached there.

This version is just another order of parameters, but does the same as the above function of the same name. It is just provider here for convenience.

gridop_API bool expandBoundingBox ( const RefPtr< Field > &  Coords,
RefPtr< BoundingBox > &  theBox 
) [friend]

Expand the given bounding box by the bounding box as determined by the Field.

Note that the bounding box on the Field itself will be cached there.