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

TFGeneric Class Reference

#include <TFBase.h>

Inheritance diagram for TFGeneric:

SimBase gutz::Counted List of all members.

Detailed Description

a generic ND transfer function.

Handles basic TFElement management and various TF generation methods.

Definition at line 39 of file TFBase.h.

Evaluate

Evaluate the transfer function at some arbitrary position

virtual ValType eval (const PosType &tfpos)
 eval


Domain

virtual int sizeDomain () const
 dimension of transfer function domain how many axies does the transfer function have???

virtual PosType getDomainRes () const
 how many bins will discrete TF maps have? default is 256 for all TF domain axes.

virtual void setDomainRes (const PosType &res)
 notice that you are passing a gutz::vec, so you can have a different number of bins for each axis


Range

dimension of transfer function range, ex.

4 is probably standard for RGBA output

virtual int sizeRange () const

Volume stuff

virtual void setVolume (VolumeSP v)
virtual VolumeSP getVolume () const

Transfer function elements

TFElementListSP getTFElts () const
void setTFElts (TFElementListSP _tfe)
void addTFElt (TFEltSP tfelt)
void addTFElement (TFElement *tfelt)

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

typedef STF::tfDomainType PosType
typedef STF::tfRangeType ValType

Public Member Functions

 TFGeneric ()
 TFGeneric (VolumeSP vol)
virtual ~TFGeneric ()
virtual int getChangeID ()
 reimplemented from SimBase, needed since changes are dependent on sub-objects like TFElements

TFImageSP get2DMap (gutz::vec2i axesIdx, const gutz::vec2i size=gutz::vec2i_neg_one, int type=Nrro::UCHAR, int kind=STF::TF_RGBA)
 Generate a 2D tf image (map) from a pair of axies (axiesIdx) of the tfdomain ...


Protected Member Functions

virtual void update ()
 update the transfer function, checks to see if any of the elements changed and updates if it needs to.

TFImageSP getImage (const gutz::vec2i &ai)
 getImage

void setImage (const TFImageSP im)
 setImage

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

VolumeSP _vol
TFElementListSP _elts
PosType _res
TFImageSPMap _images
 cache generated tf images...

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 Typedef Documentation

typedef STF::tfDomainType TFGeneric::PosType
 

Definition at line 41 of file TFBase.h.

typedef STF::tfRangeType TFGeneric::ValType
 

Definition at line 42 of file TFBase.h.


Constructor & Destructor Documentation

TFGeneric::TFGeneric  ) 
 

Definition at line 31 of file TFBase.cpp.

TFGeneric::TFGeneric VolumeSP  vol  ) 
 

Definition at line 40 of file TFBase.cpp.

TFGeneric::~TFGeneric  )  [virtual]
 

Definition at line 49 of file TFBase.cpp.

References _elts, _vol, and gutz::SmartPtr< TFElementList >::isNull().


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 TFGeneric::addTFElement TFElement tfelt  )  [inline]
 

Definition at line 97 of file TFBase.h.

References addTFElt().

void TFGeneric::addTFElt TFEltSP  tfelt  )  [inline]
 

Definition at line 96 of file TFBase.h.

References _elts.

Referenced by addTFElement().

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(), eval(), SourceObj::execDef(), ColorMapper::execDef(), AlgObj::execDef(), AlgObj::execute(), SourceObj::force(), AlgObj::force(), VolField::genTexture(), 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(), 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().

TFGeneric::ValType TFGeneric::eval const PosType tfpos  )  [virtual]
 

eval

Definition at line 89 of file TFBase.cpp.

References _elts, SimBase::derr(), gutz::SmartPtr< TFElementList >::isNull(), TFElementListIter, and v.

TFImageSP TFGeneric::get2DMap gutz::vec2i  axesIdx,
const gutz::vec2i  size = gutz::vec2i_neg_one,
int  type = Nrro::UCHAR,
int  kind = STF::TF_RGBA
 

Generate a 2D tf image (map) from a pair of axies (axiesIdx) of the tfdomain ...

... with some size, type, specific values in your choice of order, ... and your choice of how many values (channels) it should have kind is from STF::TF_4MAP_KINDS type is from Nrro::NRRO_TYPES

Parameters:
size  idicies of domain axes
type  size of map
kind  what data type?

Definition at line 120 of file TFBase.cpp.

References _elts, SimBase::derr(), size, TFElementListIter, type, gutz::vec2i, and gutz::vec2i_neg_one.

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

Definition at line 73 of file simBase.h.

References SimBase::_changed.

int TFGeneric::getChangeID  )  [virtual]
 

reimplemented from SimBase, needed since changes are dependent on sub-objects like TFElements

see if any of the elments changed

update if anything changed

Reimplemented from SimBase.

Definition at line 72 of file TFBase.cpp.

References _elts, SimBase::getChangeID(), and update().

virtual PosType TFGeneric::getDomainRes  )  const [inline, virtual]
 

how many bins will discrete TF maps have? default is 256 for all TF domain axes.

Definition at line 67 of file TFBase.h.

References _res.

TFImageSP TFGeneric::getImage const gutz::vec2i ai  )  [protected]
 

getImage

Definition at line 177 of file TFBase.cpp.

References _images, and TFImageSPMapIter.

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.

TFElementListSP TFGeneric::getTFElts  )  const [inline]
 

Definition at line 94 of file TFBase.h.

References _elts.

virtual VolumeSP TFGeneric::getVolume  )  const [inline, virtual]
 

Definition at line 88 of file TFBase.h.

References _vol.

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.

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

virtual void TFGeneric::setDomainRes const PosType res  )  [inline, virtual]
 

notice that you are passing a gutz::vec, so you can have a different number of bins for each axis

Definition at line 70 of file TFBase.h.

References _res, and res.

void TFGeneric::setImage const TFImageSP  im  )  [protected]
 

setImage

Definition at line 188 of file TFBase.cpp.

References _images, and SimBase::derr().

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 TFGeneric::setTFElts TFElementListSP  _tfe  )  [inline]
 

Definition at line 95 of file TFBase.h.

References _elts.

virtual void TFGeneric::setVolume VolumeSP  v  )  [inline, virtual]
 

Definition at line 87 of file TFBase.h.

References _vol, and v.

virtual int TFGeneric::sizeDomain  )  const [inline, virtual]
 

dimension of transfer function domain how many axies does the transfer function have???

Definition at line 62 of file TFBase.h.

virtual int TFGeneric::sizeRange  )  const [inline, virtual]
 

Definition at line 81 of file TFBase.h.

void TFGeneric::update  )  [protected, virtual]
 

update the transfer function, checks to see if any of the elements changed and updates if it needs to.

You can call this whenever you want.

Definition at line 59 of file TFBase.cpp.

References _elts, and SimBase::setChanged().

Referenced by getChangeID().


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

TFElementListSP TFGeneric::_elts [protected]
 

Definition at line 130 of file TFBase.h.

Referenced by addTFElt(), eval(), get2DMap(), getChangeID(), getTFElts(), setTFElts(), update(), and ~TFGeneric().

TFImageSPMap TFGeneric::_images [protected]
 

cache generated tf images...

Definition at line 135 of file TFBase.h.

Referenced by getImage(), and setImage().

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

PosType TFGeneric::_res [protected]
 

Definition at line 132 of file TFBase.h.

Referenced by getDomainRes(), and setDomainRes().

VolumeSP TFGeneric::_vol [protected]
 

Definition at line 129 of file TFBase.h.

Referenced by getVolume(), setVolume(), and ~TFGeneric().


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