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

Volume Class Reference

#include <Volume.h>

Inheritance diagram for Volume:

gutz::Counted SimBase List of all members.

Detailed Description

Volume, basic container for multi-channel volume data contains VolFields and Volytopes, see these class definitions for for more functionality.

Notes:

Add data to the fields using the fieldvec: vol->fields->addNrro(myNrro);

Call vol->update() when you have added all of the fields you want. update calls update on all the fields and creates the volytopes that you will need for rendering the volume.

Definition at line 45 of file Volume.h.

Types of volumes supported

enum  VOLUME_KIND { RECTLIN, CURVLIN, VOLYTOPE, UNSTRUCT }
int getVolType () const
void setVolType (int vtype)

Field & Volytope: Public data and accesors

We have public data, since the interface to it throught this class would have to duplicate their interface, exactly.

So what's the point?
Set/Get provided for symetry.

TODO: this class really shouldn't own these objects!

VolFieldVec getFields () const
void setFields (const VolFieldVec &vfv)
VolytopeVec getVolytopes () const
void setVolytopes (const VolytopeVec &vtv)
VolFieldVec fields
VolytopeVec volys

Default texture qualities

from simTexture.h

int getTexQual () const
void setTexQual (int tq=SIMT_BEST)

Bricking info

default brick size set to {128,128,128}

gutz::vec3i getBrickDims () const
void setBrickDims (gutz::vec3i bd)

Set/Get size of volume.

-1 means that the size isn't set, and you are using the volytopes native size, setting the size scales the volytopes so that collectively they are no larger than the size along any axis need to call "update()" for this to take effect

float getSize () const
void setSize (float size=-1)
 Set Size.


toggle centering on and off,

need to call "update()" for this to take effect

bool getCentered () const
void setCentered (bool onoff)

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 ()

Serialization:

from SimBase You MUST override these pure virtual functions, they "should" do something usefull.

It is also nice if you declare a static std::istream &create(std::istream &is) const; function, to create a class from a stream. This is done on a per-concrete class basis.

These aren't pure virutal yet, but will be soon!

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

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


Public Types


Public Member Functions

 Volume ()
 Construction.

virtual ~Volume ()
bool isValid () const
 is this object good to go?
if not, needs update (most likely), or it is mis-configured

virtual void update ()
 Update the Volume if something changes.


Protected Member Functions

void clearVolytopes ()
 Clear Volytopes.

void updateVolytopesRL ()
 Update Volytopes.

void updateRectLin ()
 rectilinear volytopes

void setDefault ()
 Set Default, what to do if we have an invalid volume.

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

bool _valid
 is the volume valid?

int _vtype
 what type of volume is this?

gutz::vec3i _brickDims
int _texqual
float _size
bool _centered
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


Member Enumeration Documentation

enum Volume::VOLUME_KIND
 

Enumeration values:
RECTLIN 
CURVLIN 
VOLYTOPE 
UNSTRUCT 

Definition at line 81 of file Volume.h.


Constructor & Destructor Documentation

Volume::Volume  ) 
 

Construction.

Definition at line 28 of file Volume.cpp.

References SIMT_BEST, and update().

virtual Volume::~Volume  )  [inline, virtual]
 

Definition at line 51 of file Volume.h.


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 Volume::clearVolytopes  )  [protected]
 

Clear Volytopes.

Definition at line 112 of file Volume.cpp.

References volys.

Referenced by updateRectLin().

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(), update(), SourceObj::updateOutputs(), updateRectLin(), updateVolytopesRL(), VolyCube::VolyCube(), and Volytope::writeState().

gutz::vec3i Volume::getBrickDims  )  const [inline]
 

Definition at line 108 of file Volume.h.

References _brickDims.

bool Volume::getCentered  )  const [inline]
 

Definition at line 129 of file Volume.h.

References _centered.

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().

VolFieldVec Volume::getFields  )  const [inline]
 

Definition at line 63 of file Volume.h.

References fields.

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

Definition at line 45 of file simBase.h.

References SimBase::_name_.

Referenced by MetaProg::operator<<().

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

Definition at line 44 of file simBase.h.

References string.

float Volume::getSize  )  const [inline]
 

Definition at line 121 of file Volume.h.

References _size.

int Volume::getTexQual  )  const [inline]
 

Definition at line 96 of file Volume.h.

References _texqual.

int Volume::getVolType  )  const [inline]
 

Definition at line 87 of file Volume.h.

References _vtype.

VolytopeVec Volume::getVolytopes  )  const [inline]
 

Definition at line 67 of file Volume.h.

References volys.

bool Volume::isValid  )  const [inline]
 

is this object good to go?
if not, needs update (most likely), or it is mis-configured

Definition at line 76 of file Volume.h.

References _valid.

Referenced by updateRectLin().

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

unserialize

Reimplemented in SimCore, and VolRenBase.

Definition at line 94 of file simBase.h.

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

serialize

Reimplemented in SimCore, and VolRenBase.

Definition at line 92 of file simBase.h.

void Volume::setBrickDims gutz::vec3i  bd  )  [inline]
 

Definition at line 109 of file Volume.h.

References _brickDims.

void Volume::setCentered bool  onoff  )  [inline]
 

Definition at line 130 of file Volume.h.

References _centered, and _valid.

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 Volume::setDefault  )  [protected]
 

Set Default, what to do if we have an invalid volume.

yep, creat one

still not setup properly

Definition at line 152 of file Volume.cpp.

References _valid, volys, and VolytopeSP.

Referenced by updateRectLin(), and updateVolytopesRL().

void Volume::setFields const VolFieldVec vfv  )  [inline]
 

Definition at line 64 of file Volume.h.

References fields.

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 Volume::setSize float  size = -1  ) 
 

Set Size.

Definition at line 164 of file Volume.cpp.

References _size, _valid, and size.

void Volume::setTexQual int  tq = SIMT_BEST  )  [inline]
 

Definition at line 97 of file Volume.h.

References _texqual.

void Volume::setVolType int  vtype  )  [inline]
 

Definition at line 88 of file Volume.h.

References _vtype.

void Volume::setVolytopes const VolytopeVec vtv  )  [inline]
 

Definition at line 68 of file Volume.h.

References volys.

void Volume::update  )  [virtual]
 

Update the Volume if something changes.

Definition at line 43 of file Volume.cpp.

References _vtype, SimBase::derr(), RECTLIN, and updateRectLin().

Referenced by Volume().

void Volume::updateRectLin  )  [protected]
 

rectilinear volytopes

need to create a default volytope?

we don't want to crash.

nothing to do???

make sure the fields are valid

made it this far must be good!

only for un-configured volumes, this is just a convenience thing, so we don't crash when we forget to set the volume.

ditch old setup if previously un-configured or something changed

Definition at line 58 of file Volume.cpp.

References _brickDims, _centered, _size, _valid, VolFieldVec::brickData(), VolytopeVec::center(), VolFieldVec::checkFields(), clearVolytopes(), SimBase::derr(), fields, isValid(), VolFieldVec::needUpdate(), setDefault(), VolytopeVec::setSize(), VolFieldVec::update(), updateVolytopesRL(), and volys.

Referenced by update().

void Volume::updateVolytopesRL  )  [protected]
 

Update Volytopes.

um they should be!

initiallize it using the first field

for each additional field, add it's data to the volytopes

Definition at line 120 of file Volume.cpp.

References SimBase::derr(), fields, genVolyCubes(), VolFieldVec::getField(), setDefault(), VolytopeVec::setField(), and volys.

Referenced by updateRectLin().


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

gutz::vec3i Volume::_brickDims [protected]
 

Definition at line 144 of file Volume.h.

Referenced by getBrickDims(), setBrickDims(), and updateRectLin().

bool Volume::_centered [protected]
 

Definition at line 148 of file Volume.h.

Referenced by getCentered(), setCentered(), and updateRectLin().

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().

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().

float Volume::_size [protected]
 

Definition at line 147 of file Volume.h.

Referenced by getSize(), setSize(), and updateRectLin().

int Volume::_texqual [protected]
 

Definition at line 145 of file Volume.h.

Referenced by getTexQual(), and setTexQual().

bool Volume::_valid [protected]
 

is the volume valid?

Definition at line 142 of file Volume.h.

Referenced by isValid(), setCentered(), setDefault(), setSize(), and updateRectLin().

int Volume::_vtype [protected]
 

what type of volume is this?

Definition at line 143 of file Volume.h.

Referenced by getVolType(), setVolType(), and update().

VolFieldVec Volume::fields
 

Definition at line 62 of file Volume.h.

Referenced by getFields(), setFields(), updateRectLin(), and updateVolytopesRL().

VolytopeVec Volume::volys
 

Definition at line 66 of file Volume.h.

Referenced by clearVolytopes(), getVolytopes(), setDefault(), setVolytopes(), updateRectLin(), and updateVolytopesRL().


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