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

VolField Class Reference

#include <VolField.h>

Inheritance diagram for VolField:

gutz::Counted SimBase List of all members.

Detailed Description

VolField, a single field.

An elaborate container for a simian data field. see VolFieldVec below for a description of a collection of fields TODO: needs major cleanup for handling Nrro images and not just 4D volumes... working on it, jeez!

Definition at line 36 of file VolField.h.

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

enum  {
  BEST = SIMT_BEST, BYTE = SIMT_8BIT, SHORT = SIMT_16FIXED, HALF = SIMT_16FLOAT,
  FLOAT = SIMT_32FLOAT, QUALITY_LAST
}
 texture qualities, these are repeated from "simTexture.h", see for complete list of available qualities More...


Public Member Functions

 VolField ()
 Construct.

 VolField (Nrro *n)
 VolField (NrroSP n)
virtual ~VolField ()
unsigned int numNrro ()
 Nrros: ----------------------------------- data is stored in Nrrd Objects, if there are more than 1 nrros then you probably have bricked data, but you should check.

NrroSP getNrro (unsigned int n=0)
void setNrro (NrroSP nrro, unsigned int n=0)
bool isActive ()
 is this field active for rendering ?

void setActive (bool on_off)
bool isBricked ()
 Bricking: -------------------------------- if bricked the 0th nrro is the original data.

void setBricked (bool bricked)
 set as bricked or not bricked

NrroSP getBrick (unsigned int i)
 get a Nrro brick

unsigned int numBricks ()
 how many bricks?

void brick (gutz::vec3i maxBrickDims)
 create bricks no bigger than maxBrickDims (insures pow2)

NrroSP genBrick (gutz::vec3i pos, gutz::vec3i size, NrroSP nin)
 create a single brick

void nukeBricks ()
 remove all bricks

bool getUpdate ()
 a flag informing of changes to field

void setUpdate (bool up)
virtual void update ()
 Update Field.

int getTexQuality ()
void setTexQuality (int tq)
glift::SingleTexSP genTexture (unsigned int n=0)
 Textures for rendering.

glift::SingleTexSP genBrickTexture (unsigned int n=0)
 Generate Brick Texture.

void clearTex ()
bool checkDims (gutz::SmartPtr< VolField > f)
 validate the dimensions of this field against another field, are the data and all bricks the same dimension?

int getTexUnit () const
 texture unit to bind this field to, uses [0-N] range

void setTexUnit (int tu)

Protected Member Functions

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 _on
bool _up
bool _bricked
glift::SingleTexSPVec _tex
int _texquality
int _texUnit
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

anonymous enum
 

texture qualities, these are repeated from "simTexture.h", see for complete list of available qualities

Enumeration values:
BEST 
BYTE  best fit given the native field quality (default)
SHORT  8 bit fixed
HALF  16 bit fixed
FLOAT  16 bit float
QUALITY_LAST  32 bit float

Definition at line 89 of file VolField.h.


Constructor & Destructor Documentation

VolField::VolField  ) 
 

Construct.

Definition at line 37 of file VolField.cpp.

References NrroSPVec.

VolField::VolField Nrro n  ) 
 

Definition at line 47 of file VolField.cpp.

References n, and NrroSPVec.

VolField::VolField NrroSP  n  ) 
 

Definition at line 57 of file VolField.cpp.

References n, and NrroSPVec.

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

Definition at line 46 of file VolField.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 VolField::brick gutz::vec3i  bdim  ) 
 

create bricks no bigger than maxBrickDims (insures pow2)

generate bricks along z

generate bricks along y

generate bricks along x

we have a remainder

how many bricks will we need? if the original volume is smaller than the maxBrick dim, we will generate exactly one brick! it will be padded to the right power of 2

TODO: this is wrong, you need on voxel of overlap, which we have, but, that means the remainder is wrong, we loose a voxel off the end for each brick we have!

Definition at line 255 of file VolField.cpp.

References genBrick(), getNextPow2(), getNrro(), getUpdate(), isBricked(), n, setBricked(), update(), gutz::vec3i, x, y, and z.

bool VolField::checkDims gutz::SmartPtr< VolField f  ) 
 

validate the dimensions of this field against another field, are the data and all bricks the same dimension?

check to see if our dimensions match another's exactly

check every brick

error checking abounds

check to make sure they are the same dimension

check each axis

Definition at line 143 of file VolField.cpp.

References SimBase::derr(), getNrro(), gutz::SmartPtr< Nrro >::isNull(), and size.

void VolField::clearTex  )  [inline]
 

Definition at line 104 of file VolField.h.

References _tex.

Referenced by update().

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

NrroSP VolField::genBrick gutz::vec3i  pos,
gutz::vec3i  size,
NrroSP  nin
 

create a single brick

set up the arrays we need for nrro croping

crop that sucker

check if we have a remainder to pad out ?

arrays we need for nrro padding

pad out to brick size

Definition at line 221 of file VolField.cpp.

References Nrro::BLEED, gutz::g_min(), gutz::SmartPtr< Nrro >::isNull(), and size.

Referenced by brick().

glift::SingleTexSP VolField::genBrickTexture unsigned int  n = 0  ) 
 

Generate Brick Texture.

Definition at line 132 of file VolField.cpp.

References genTexture(), isBricked(), and n.

SingleTexSP VolField::genTexture unsigned int  n = 0  ) 
 

Textures for rendering.

texture still not valid!!! badness

Definition at line 99 of file VolField.cpp.

References _tex, _texquality, SimBase::derr(), gutz::g_max(), gutz::SmartPtr< Nrro >::isNull(), loadNrroTexture(), and n.

Referenced by genBrickTexture().

NrroSP VolField::getBrick unsigned int  i  ) 
 

get a Nrro brick

I don't know if this is reasonable! but I just don't want to crash!

Definition at line 173 of file VolField.cpp.

References getNrro(), isBricked(), and size.

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

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

Definition at line 45 of file simBase.h.

References SimBase::_name_.

Referenced by MetaProg::operator<<().

NrroSP VolField::getNrro unsigned int  n = 0  )  [inline]
 

Definition at line 54 of file VolField.h.

References n.

Referenced by brick(), checkDims(), and getBrick().

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

Definition at line 44 of file simBase.h.

References string.

int VolField::getTexQuality  )  [inline]
 

Definition at line 97 of file VolField.h.

References _texquality.

int VolField::getTexUnit  )  const [inline]
 

texture unit to bind this field to, uses [0-N] range

Definition at line 115 of file VolField.h.

References _texUnit.

bool VolField::getUpdate  )  [inline]
 

a flag informing of changes to field

Definition at line 81 of file VolField.h.

References _up.

Referenced by brick(), and update().

bool VolField::isActive  )  [inline]
 

is this field active for rendering ?

Definition at line 59 of file VolField.h.

References _on.

bool VolField::isBricked  )  [inline]
 

Bricking: -------------------------------- if bricked the 0th nrro is the original data.

Definition at line 65 of file VolField.h.

References _bricked.

Referenced by brick(), genBrickTexture(), getBrick(), nukeBricks(), numBricks(), and update().

void VolField::nukeBricks  ) 
 

remove all bricks

not bricked, nothing to do

reset bricked

pop off all nrro bricks leave 0, that's the original data

Definition at line 202 of file VolField.cpp.

References isBricked(), setBricked(), and size.

Referenced by update().

unsigned int VolField::numBricks  ) 
 

how many bricks?

Definition at line 187 of file VolField.cpp.

References isBricked(), and size.

unsigned int VolField::numNrro  )  [inline]
 

Nrros: ----------------------------------- data is stored in Nrrd Objects, if there are more than 1 nrros then you probably have bricked data, but you should check.

Definition at line 53 of file VolField.h.

References size.

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 VolField::setActive bool  on_off  )  [inline]
 

Definition at line 60 of file VolField.h.

References _on.

void VolField::setBricked bool  bricked  )  [inline]
 

set as bricked or not bricked

Definition at line 67 of file VolField.h.

References _bricked.

Referenced by brick(), and nukeBricks().

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 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 VolField::setNrro NrroSP  nrro,
unsigned int  n = 0
 

Definition at line 67 of file VolField.cpp.

References SimBase::derr(), n, NrroSP, and size.

void VolField::setTexQuality int  tq  )  [inline]
 

Definition at line 98 of file VolField.h.

References _texquality, and setUpdate().

void VolField::setTexUnit int  tu  )  [inline]
 

Definition at line 116 of file VolField.h.

References _texUnit.

void VolField::setUpdate bool  up  )  [inline]
 

Definition at line 82 of file VolField.h.

References _up.

Referenced by setTexQuality(), and update().

void VolField::update  )  [virtual]
 

Update Field.

nothing changed? nothing to do

reset everything

update reset

Definition at line 80 of file VolField.cpp.

References clearTex(), getUpdate(), isBricked(), nukeBricks(), and setUpdate().

Referenced by brick().


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

bool VolField::_bricked [protected]
 

Definition at line 122 of file VolField.h.

Referenced by isBricked(), and setBricked().

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

bool VolField::_on [protected]
 

Definition at line 120 of file VolField.h.

Referenced by isActive(), and setActive().

glift::SingleTexSPVec VolField::_tex [protected]
 

Definition at line 123 of file VolField.h.

Referenced by clearTex(), and genTexture().

int VolField::_texquality [protected]
 

Definition at line 124 of file VolField.h.

Referenced by genTexture(), getTexQuality(), and setTexQuality().

int VolField::_texUnit [protected]
 

Definition at line 125 of file VolField.h.

Referenced by getTexUnit(), and setTexUnit().

bool VolField::_up [protected]
 

Definition at line 121 of file VolField.h.

Referenced by getUpdate(), and setUpdate().


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