arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

VolRenBase Class Reference

#include <VolRenBase.h>

Inheritance diagram for VolRenBase:

Renderable SimBase gutz::Counted AnalyticVolRen VolRenCube VolRenLit VolRenSlab List of all members.

Detailed Description

Forward Decl.

Also implements a simple slice based volume renderer

Definition at line 39 of file VolRenBase.h.

Algorithm

Set/Get the rendering algorithm, client strategy

virtual void setAlg (VolRenAlgBase *vrab)
virtual VolRenAlgBaseSP getAlg ()

Slicer

Set/Get the currrent Slicer, client strategy

virtual void setSlicer (VolSlicer *vslice)
virtual VolSlicerSP getSlicer ()

Set/Get sample spacing.

This is in volume model space, which is not the same as texture space.

virtual void setSampleSpace (float sampleSpace)
virtual float getSampleSpace ()

Serialize/un...

virtual std::ostream & saveSelf (std::ostream &os)
 serialize

virtual std::istream & readSelf (std::istream &is)
 unserialize


Draw on/off.

bool isOn () const
void setOn (bool yes)

Delete.

Does this object need to be removed from a render list? This means that the object is finished and anyone with a smart pointer to it needs to delete the smart pointer and stop using the renderable.

bool needsDelete () const
void setDelete (bool yes)

Interaction Functions

Return true if the event was for you.

By default interaction is forwarded to your protected manipulator (_manip). To use it just apply it in your draw function. However, if you don't add any events or call setManipEventsDefault(), you won't have any interaction. Override these functions in your base class to implement custom behaviors.

virtual bool key (unsigned char k, int x, int y)
virtual bool mouse (const gutz::MouseEvent &me)
virtual bool move (const gutz::MouseMoveEvent &mme)

Selected

Is this object currently selected?

virtual void setSelected (bool yes)
bool isSelected () const

Manipulator Interface

gutz::ManipgetManip () const
void setManip (gutz::Manip *const m)
void setManipEventsDefault ()
 you have to call this to enable default interaction, OR customize the manipulators events yourself.


Text object-name

from SimBase

std::string getObjName ()
std::string getName ()
void setName (std::string name)
void setName (const char *name)

Debug prints

from SimBase: These print the object name with the error, mostly for convenience, but they are compiled to inline-no-op if you build in release mode

void derr (const char *when, const char *where=0) const
template<class T> void derr (const char *when, const char *where, const T stuff) const

Modification, AKA "changed"

from SimBase: id based, you can capture the current id for comparison later, if the id's don't match the class has been changed

virtual int getChangeID ()
virtual int getChangeID () const
virtual void setChanged ()

Public Member Functions

 VolRenBase ()
virtual ~VolRenBase ()
virtual void init ()
 Init, to be called after Graphic context is valid.

void draw (const gutz::RenderEvent &re)
 Slice polytopes and render.

gutz::vec3f getCenter (const gutz::CameraEvent &ce) const
 Get the center of the volume rendered, given a specific camera.

void addLight (gutz::Light *lt)
 Light management, TODO: need a light class, yo.

gutz::LightgetLight (int i)
gutz::LightVec getLightVec ()
void setLightVec (gutz::LightVec &ltv)
unsigned int getNumLights ()
void enableLight (bool on)
 Lighting on/off.

void enableLTHA (bool on)
 Light transport using half angle on/off.

VolumeSP getVolume () const
void setVolume (Volume *v)

Protected Member Functions

virtual void drawDef (const gutz::RenderEvent &re)
virtual gutz::vec3f genSliceAxis (unsigned int light, gutz::vec3f volCtr)
 get the slice axis

virtual void preSlice (const gutz::RenderEvent &re)
 a couple of no-ops for sub-classes

virtual void postSlice (const gutz::RenderEvent &re)
virtual void rotateSampBuffs ()
 Rotate sample buffers, tripple buffered.

void err (char *when, float v=0.0f, char *where=0)
virtual void _incCount ()
 gutz::Counted interface, increment reference count by one.

virtual void _decCount ()
 gutz::Counted interface, decrement reference count by one.

virtual int _getCount () const
 gutz::Counted interface, get the current reference count.


Protected Attributes

VolRenAlgBaseSP _currentAlg
 Stratagies.

VolSlicerSP _currentSlicer
VolumeSP _v
 Member data.

VolytopeSP _vt
VolSamplesVec _vsv
int _vsBuff
gutz::LightVec _ltv
 which sample buffer are we about to render from?

gutz::vec3f _sliceDir
bool _lightOn
bool _lthaOn
bool _on
 is this renderable currently "render-able"?

bool _selected
 is this renderable selected?

bool _deleteMe
 does this object need to be deleted?

gutz::ManipSP _manip
 You get a manipulator free, no charge.

std::string _name_
 a text name for the object, SimBase

int _changed
 change id, incremented whenever setChanged is called, SimBase


Friends

class SmartPtr
class SmartPtrRef


Constructor & Destructor Documentation

VolRenBase::VolRenBase  ) 
 

Definition at line 44 of file VolRenBase.cpp.

References _vsv, and init().

VolRenBase::~VolRenBase  )  [virtual]
 

Definition at line 59 of file VolRenBase.cpp.

References _currentAlg.


Member Function Documentation

virtual void gutz::Counted::_decCount  )  [inline, protected, virtual, inherited]
 

gutz::Counted interface, decrement reference count by one.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr

Definition at line 54 of file smartptr.h.

Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax().

virtual int gutz::Counted::_getCount  )  const [inline, protected, virtual, inherited]
 

gutz::Counted interface, get the current reference count.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr.

Definition at line 58 of file smartptr.h.

virtual void gutz::Counted::_incCount  )  [inline, protected, virtual, inherited]
 

gutz::Counted interface, increment reference count by one.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr

Definition at line 48 of file smartptr.h.

Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax().

void VolRenBase::addLight gutz::Light lt  )  [inline]
 

Light management, TODO: need a light class, yo.

Definition at line 109 of file VolRenBase.h.

References _ltv.

template<class T>
void SimBase::derr const char *  when,
const char *  where,
const T  stuff
const [inline, inherited]
 

only prints in debug mode, -D_DEBUG

Definition at line 130 of file simBase.h.

References SimBase::_name_.

void SimBase::derr const char *  when,
const char *  where = 0
const [inline, inherited]
 

only prints in debug mode, -D_DEBUG

Definition at line 113 of file simBase.h.

References SimBase::_name_.

Referenced by AlgObj::addInput(), Key::addKey(), SourceObj::addOutput(), VolShader::bindBlend(), VolField::checkDims(), VolFieldVec::checkField(), VolFieldVec::checkFields(), AlgObj::checkInputs(), AlgObj::delInput(), Key::delKey(), Crank::delMP(), SourceObj::delOutput(), Crank::delTape(), TFGeneric::eval(), SourceObj::execDef(), ColorMapper::execDef(), AlgObj::execDef(), AlgObj::execute(), SourceObj::force(), AlgObj::force(), VolField::genTexture(), TFGeneric::get2DMap(), DataObj::getConsumer(), VolFieldVec::getField(), AlgObj::getInputN(), Key::getKey(), Crank::getMP(), Crank::getMPIdx(), SourceObj::getOutputN(), Crank::getTape(), AlgObj::inputsModified(), Crank::insertTape(), Crank::kindErr(), VolyCube::loadNrro(), VolyCube::readState(), Volytope::readState(), SourceObj::request(), DataObj::request_(), VolytopeVec::setField(), SourceObj::setForwardModified(), DataObj::setForwardModified(), TFGeneric::setImage(), AlgObj::setInputN(), Key::setKey(), Crank::setMP(), VolField::setNrro(), SourceObj::setOutputN(), Crank::setTape(), Volume::update(), SourceObj::updateOutputs(), Volume::updateRectLin(), Volume::updateVolytopesRL(), VolyCube::VolyCube(), and Volytope::writeState().

void VolRenBase::draw const gutz::RenderEvent re  )  [inline, virtual]
 

Slice polytopes and render.

Implements Renderable.

Definition at line 53 of file VolRenBase.h.

References drawDef(), and gutz::RenderEvent::picking().

Referenced by VolRenLit::drawDef(), and VolRenCube::drawDef().

void VolRenBase::drawDef const gutz::RenderEvent re  )  [protected, virtual]
 

generate the slice axis

tell the algorithm which way it is going

construct the model view matrix

get the sorted volytopes

Reimplemented in VolRenCube, and VolRenLit.

Definition at line 86 of file VolRenBase.cpp.

References _currentAlg, _currentSlicer, _lightOn, _lthaOn, _ltv, _sliceDir, _v, _vsBuff, _vsv, _vt, gutz::CameraSP, end, genSliceAxis(), gutz::CameraEvent::getCamera(), gutz::CameraEvent::getManip(), glErr(), glMultMatrixf(), glPopMatrix(), glPushMatrix(), gutz::SmartPtr< Volytope >::isNull(), gutz::ManipSP, gutz::mat4f, postSlice(), preSlice(), start, gutz::vec3f, and gutz::vec3f_neg_z.

Referenced by draw().

void VolRenBase::enableLight bool  on  )  [inline]
 

Lighting on/off.

Definition at line 115 of file VolRenBase.h.

References _lightOn.

void VolRenBase::enableLTHA bool  on  )  [inline]
 

Light transport using half angle on/off.

Definition at line 117 of file VolRenBase.h.

References _lthaOn.

void VolRenBase::err char *  when,
float  v = 0.0f,
char *  where = 0
[protected]
 

Definition at line 190 of file VolRenBase.cpp.

References v.

virtual gutz::vec3f VolRenBase::genSliceAxis unsigned int  light,
gutz::vec3f  volCtr
[inline, protected, virtual]
 

get the slice axis

Reimplemented in VolRenLit.

Definition at line 133 of file VolRenBase.h.

Referenced by drawDef().

virtual VolRenAlgBaseSP VolRenBase::getAlg  )  [inline, virtual]
 

Definition at line 70 of file VolRenBase.h.

References _currentAlg.

gutz::vec3f VolRenBase::getCenter const gutz::CameraEvent ce  )  const
 

Get the center of the volume rendered, given a specific camera.

Definition at line 165 of file VolRenBase.cpp.

References _v, gutz::CameraEvent::getCamera(), and gutz::CameraEvent::getManip().

virtual int SimBase::getChangeID  )  const [inline, virtual, inherited]
 

Definition at line 73 of file simBase.h.

References SimBase::_changed.

virtual int SimBase::getChangeID  )  [inline, virtual, inherited]
 

Reimplemented in TFGeneric, TFBaseSP, and TFEltSP.

Definition at line 72 of file simBase.h.

References SimBase::_changed.

Referenced by TFEltSP::getChangeID(), TFBaseSP::getChangeID(), and TFGeneric::getChangeID().

gutz::Light* VolRenBase::getLight int  i  )  [inline]
 

Definition at line 110 of file VolRenBase.h.

References _ltv.

gutz::LightVec VolRenBase::getLightVec  )  [inline]
 

Definition at line 111 of file VolRenBase.h.

References _ltv.

gutz::Manip* Renderable::getManip  )  const [inline, inherited]
 

Definition at line 184 of file Renderable.h.

References Renderable::_manip.

std::string SimBase::getName  )  [inline, inherited]
 

Definition at line 45 of file simBase.h.

References SimBase::_name_.

Referenced by MetaProg::operator<<().

unsigned int VolRenBase::getNumLights  )  [inline]
 

Definition at line 113 of file VolRenBase.h.

References _ltv.

std::string SimBase::getObjName  )  [inline, inherited]
 

Definition at line 44 of file simBase.h.

References string.

virtual float VolRenBase::getSampleSpace  )  [inline, virtual]
 

Definition at line 89 of file VolRenBase.h.

References _currentSlicer.

virtual VolSlicerSP VolRenBase::getSlicer  )  [inline, virtual]
 

Definition at line 78 of file VolRenBase.h.

References _currentSlicer.

VolumeSP VolRenBase::getVolume  )  const [inline]
 

Definition at line 119 of file VolRenBase.h.

References _v.

void VolRenBase::init  )  [virtual]
 

Init, to be called after Graphic context is valid.

Reimplemented in VolRenCube, and VolRenLit.

Definition at line 67 of file VolRenBase.cpp.

References _currentAlg, and _currentSlicer.

Referenced by VolRenLit::init(), VolRenCube::init(), and VolRenBase().

bool Renderable::isOn  )  const [inline, inherited]
 

Definition at line 141 of file Renderable.h.

References Renderable::_on.

bool Renderable::isSelected  )  const [inline, inherited]
 

Definition at line 177 of file Renderable.h.

References Renderable::_selected.

virtual bool Renderable::key unsigned char  k,
int  x,
int  y
[inline, virtual, inherited]
 

Definition at line 166 of file Renderable.h.

virtual bool Renderable::mouse const gutz::MouseEvent me  )  [inline, virtual, inherited]
 

Reimplemented in WidgetItem.

Definition at line 167 of file Renderable.h.

References Renderable::_manip.

virtual bool Renderable::move const gutz::MouseMoveEvent mme  )  [inline, virtual, inherited]
 

Reimplemented in WidgetItem.

Definition at line 168 of file Renderable.h.

References Renderable::_manip.

bool Renderable::needsDelete  )  const [inline, inherited]
 

Definition at line 152 of file Renderable.h.

References Renderable::_deleteMe.

virtual void VolRenBase::postSlice const gutz::RenderEvent re  )  [inline, protected, virtual]
 

Reimplemented in AnalyticVolRen, and VolRenSlab.

Definition at line 139 of file VolRenBase.h.

Referenced by drawDef().

virtual void VolRenBase::preSlice const gutz::RenderEvent re  )  [inline, protected, virtual]
 

a couple of no-ops for sub-classes

Reimplemented in VolRenSlab.

Definition at line 137 of file VolRenBase.h.

Referenced by drawDef().

virtual std::istream& VolRenBase::readSelf std::istream &  is  )  [inline, virtual]
 

unserialize

Reimplemented from SimBase.

Definition at line 101 of file VolRenBase.h.

virtual void VolRenBase::rotateSampBuffs  )  [inline, protected, virtual]
 

Rotate sample buffers, tripple buffered.

Definition at line 143 of file VolRenBase.h.

References _vsBuff.

virtual std::ostream& VolRenBase::saveSelf std::ostream &  os  )  [inline, virtual]
 

serialize

Reimplemented from SimBase.

Definition at line 99 of file VolRenBase.h.

void VolRenBase::setAlg VolRenAlgBase vrab  )  [virtual]
 

Definition at line 180 of file VolRenBase.cpp.

References _currentAlg.

virtual void SimBase::setChanged  )  [inline, virtual, inherited]
 

Definition at line 74 of file simBase.h.

References SimBase::_changed.

Referenced by TFEltSP::getChangeID(), TFBaseSP::getChangeID(), TFBaseSP::operator=(), and TFGeneric::update().

void Renderable::setDelete bool  yes  )  [inline, inherited]
 

Definition at line 153 of file Renderable.h.

References Renderable::_deleteMe, and Renderable::setOn().

void VolRenBase::setLightVec gutz::LightVec ltv  )  [inline]
 

Definition at line 112 of file VolRenBase.h.

References _ltv.

void Renderable::setManip gutz::Manip *const  m  )  [inline, inherited]
 

Definition at line 185 of file Renderable.h.

References Renderable::_manip.

void Renderable::setManipEventsDefault  )  [inline, inherited]
 

you have to call this to enable default interaction, OR customize the manipulators events yourself.

Definition at line 188 of file Renderable.h.

References Renderable::_manip.

void SimBase::setName const char *  name  )  [inline, inherited]
 

Definition at line 47 of file simBase.h.

References SimBase::_name_, and name.

void SimBase::setName std::string  name  )  [inline, inherited]
 

Reimplemented in Key.

Definition at line 46 of file simBase.h.

References SimBase::_name_, and name.

Referenced by EventData::EventData(), and GenDataObj_base< Nrro, gutz::SmartPtr< Nrro > >::GenDataObj_base().

void Renderable::setOn bool  yes  )  [inline, inherited]
 

Definition at line 142 of file Renderable.h.

References Renderable::_on.

Referenced by Renderable::setDelete().

virtual void VolRenBase::setSampleSpace float  sampleSpace  )  [inline, virtual]
 

Definition at line 87 of file VolRenBase.h.

References _currentSlicer.

virtual void Renderable::setSelected bool  yes  )  [inline, virtual, inherited]
 

Definition at line 176 of file Renderable.h.

References Renderable::_selected.

void VolRenBase::setSlicer VolSlicer vslice  )  [virtual]
 

Definition at line 185 of file VolRenBase.cpp.

References _currentSlicer.

void VolRenBase::setVolume Volume v  )  [inline]
 

Definition at line 120 of file VolRenBase.h.

References _v, and v.


Friends And Related Function Documentation

friend class SmartPtr [friend, inherited]
 

Definition at line 40 of file smartptr.h.

Referenced by Nrro::NrroIter< T >::NrroIter().

friend class SmartPtrRef [friend, inherited]
 

Definition at line 41 of file smartptr.h.


Member Data Documentation

int SimBase::_changed [protected, inherited]
 

change id, incremented whenever setChanged is called, SimBase

Definition at line 103 of file simBase.h.

Referenced by SimBase::getChangeID(), SimBase::setChanged(), and SimBase::SimBase().

VolRenAlgBaseSP VolRenBase::_currentAlg [protected]
 

Stratagies.

Definition at line 148 of file VolRenBase.h.

Referenced by drawDef(), getAlg(), init(), setAlg(), and ~VolRenBase().

VolSlicerSP VolRenBase::_currentSlicer [protected]
 

Definition at line 149 of file VolRenBase.h.

Referenced by drawDef(), getSampleSpace(), getSlicer(), init(), AnalyticVolRen::postSlice(), setSampleSpace(), and setSlicer().

bool Renderable::_deleteMe [protected, inherited]
 

does this object need to be deleted?

Definition at line 237 of file Renderable.h.

Referenced by Renderable::needsDelete(), Renderable::Renderable(), and Renderable::setDelete().

bool VolRenBase::_lightOn [protected]
 

Definition at line 166 of file VolRenBase.h.

Referenced by drawDef(), and enableLight().

bool VolRenBase::_lthaOn [protected]
 

Definition at line 166 of file VolRenBase.h.

Referenced by drawDef(), and enableLTHA().

gutz::LightVec VolRenBase::_ltv [protected]
 

which sample buffer are we about to render from?

Definition at line 162 of file VolRenBase.h.

Referenced by addLight(), drawDef(), VolRenLit::genSliceAxis(), getLight(), getLightVec(), getNumLights(), and setLightVec().

gutz::ManipSP Renderable::_manip [protected, inherited]
 

You get a manipulator free, no charge.

Definition at line 240 of file Renderable.h.

Referenced by FrameWidget::configureFrame(), GLUEdgeWidget::drawDef(), GLUNodeWidget::drawDef(), GLSurfaceWidget::drawQuad(), EdgeWidget::getEndPoint(), Renderable::getManip(), SurfaceWidget::getPoint(), NodeWidget::getPoint(), NodeWidget::getPointLocal(), EdgeWidget::getStartPoint(), SurfaceWidget::intersectPlane(), Renderable::mouse(), FrameWidget::mouseChild(), WidgetItem::mouseDef(), Renderable::move(), FrameWidget::moveChild(), WidgetItem::moveDef(), NodeWidget::NodeWidget(), Renderable::operator=(), Renderable::Renderable(), EdgeWidget::setEndPoint(), Renderable::setManip(), Renderable::setManipEventsDefault(), WidgetItem::setParent(), SurfaceWidget::setPoint(), NodeWidget::setPoint(), NodeWidget::setPointLocal(), EdgeWidget::setStartPoint(), and FrameWidget::updateManip().

std::string SimBase::_name_ [protected, inherited]
 

a text name for the object, SimBase

Definition at line 101 of file simBase.h.

Referenced by SimBase::derr(), SimBase::getName(), SimBase::setName(), and SimBase::SimBase().

bool Renderable::_on [protected, inherited]
 

is this renderable currently "render-able"?

Definition at line 235 of file Renderable.h.

Referenced by Renderable::isOn(), Renderable::operator=(), Renderable::Renderable(), and Renderable::setOn().

bool Renderable::_selected [protected, inherited]
 

is this renderable selected?

Definition at line 236 of file Renderable.h.

Referenced by Renderable::isSelected(), Renderable::Renderable(), and Renderable::setSelected().

gutz::vec3f VolRenBase::_sliceDir [protected]
 

Definition at line 164 of file VolRenBase.h.

Referenced by drawDef(), and AnalyticVolRen::postSlice().

VolumeSP VolRenBase::_v [protected]
 

Member data.

Definition at line 155 of file VolRenBase.h.

Referenced by drawDef(), getCenter(), getVolume(), and setVolume().

int VolRenBase::_vsBuff [protected]
 

Definition at line 160 of file VolRenBase.h.

Referenced by drawDef(), AnalyticVolRen::postSlice(), and rotateSampBuffs().

VolSamplesVec VolRenBase::_vsv [protected]
 

Definition at line 159 of file VolRenBase.h.

Referenced by drawDef(), AnalyticVolRen::postSlice(), and VolRenBase().

VolytopeSP VolRenBase::_vt [protected]
 

Definition at line 157 of file VolRenBase.h.

Referenced by drawDef(), and AnalyticVolRen::postSlice().


The documentation for this class was generated from the following files:
Send questions, comments, and bug reports to:
jmk