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

GrinderKeys Class Reference

#include <GrinderKeys.h>

Inheritance diagram for GrinderKeys:

Key SimBase gutz::Counted List of all members.

Detailed Description

Grinder specific key type, still just regular keys underneath, this class just adds some useful functionality as a toplevel key/symbol table.

Definition at line 30 of file GrinderKeys.h.

Text object-name

from SimBase

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

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

typedef gutz::SmartPtr< KeyKeySP
 the key map

typedef std::map< GKeyType,
KeySP, __KeyMapCmp__
KeySPMap
typedef KeySPMap::iterator KeySPMapIter
typedef gutz::vec4d DVEC_TYPE
 data type for double 4 vectors

typedef gutz::vec4i IVEC_TYPE
 data type for integral 4 vectors

enum  KEY_TYPES {
  UNKNOWN = 0, DEFINE = 1<<0, VALUE = 1<<1, VARIABLE = 1<<2,
  CONSTANT = 1<<3, FUNCTION = 1<<4, SCOPE = 1<<5, KEY_LAST = 1<<6
}
 feel free to invent your own types, start after KEY_LAST More...


Public Member Functions

 GrinderKeys ()
 GrinderKeys (const std::string &name, int type, const KeyPair *subKeys=0, int nSubKeys=0)
virtual GrinderKey ()
KeySP env () const
 environment keys

KeySP val () const
 data value keys

KeySP pos () const
 data position keys

KeySP pconst () const
 program constants

KeySP addPConst (const GKeyType kn, const KeySP pconstKey)
 add pconst

KeySP addPConst (const KeyPair pckp)
int pconstID (const KeySP pconstKey)
 get the program local parameter id of a key this is just stored in the IVec[0] of the key...

int pconstID (GKeyType kn)
 pconst id

void setTexture (int i, glift::SingleTexSP tex)
 textures set a texture, inserts null textures if it has to.

int addTexture (glift::SingleTexSP tex)
 add returns the texture's index

glift::SingleTexSP getTexture (int i)
 get returns a null sp if index is out of bounds

int numTextures ()
 size of texture vector

glift::SingleTexSPVec getTextureVec () const
 get the whole vector of textures!

std::string getName () const
 the key's name isn't the same as it's index into the key map.

void setName (std::string name)
std::string getText () const
 text, may not always be valid

void setText (std::string text)
int getType () const
void setType (int type)
virtual DVEC_TYPE getDVec () const
 for comparisons

virtual void setDVec (DVEC_TYPE vec)
virtual IVEC_TYPE getIVec () const
 for comparisons

virtual void setIVec (IVEC_TYPE vec)
KeySPMap getAllKeys () const
 these accessors will be null if there was an error, or un-found key, ie.

KeySP getKey (const GKeyType kn) const
 get a specific key, returns Null key if not found

KeySP setKey (const GKeyType kn, const KeySP key)
 set a specific key, returns Null if key not found

KeySP addKey (const GKeyType kn, const KeySP key)
 add a key

KeySP addKey (const KeyPair kp)
KeySP delKey (const GKeyType kn)
 delete a key, returns Null if key not found

bool hasKey (const GKeyType kn) const
 test if a key exists

int getOp () const
 operators, used for felt and sudo compiling

void setOp (int op)
int size ()
 size of subKey map


Public Attributes

const DVEC_TYPE DVEC_UNUSED
const IVEC_TYPE IVEC_UNUSED

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

glift::SingleTexSPVec _textures
std::string _name
std::string _text
int _type
int _op
KeySPMap _keys
DVEC_TYPE _dv
IVEC_TYPE _iv
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 gutz::vec4d Key::DVEC_TYPE [inherited]
 

data type for double 4 vectors

Definition at line 94 of file Keys.h.

Referenced by Key::getDVec().

typedef gutz::vec4i Key::IVEC_TYPE [inherited]
 

data type for integral 4 vectors

Definition at line 101 of file Keys.h.

Referenced by addPConst(), and Key::getIVec().

typedef gutz::SmartPtr<Key> Key::KeySP [inherited]
 

the key map

Definition at line 60 of file Keys.h.

Referenced by Key::delKey(), Key::getKey(), Key::Key(), and Key::setKey().

typedef std::map<GKeyType, KeySP, __KeyMapCmp__> Key::KeySPMap [inherited]
 

Definition at line 61 of file Keys.h.

Referenced by Key::getAllKeys().

typedef KeySPMap::iterator Key::KeySPMapIter [inherited]
 

Definition at line 62 of file Keys.h.

Referenced by Key::addKey(), Key::delKey(), and Key::setKey().


Member Enumeration Documentation

enum Key::KEY_TYPES [inherited]
 

feel free to invent your own types, start after KEY_LAST

Enumeration values:
UNKNOWN 
DEFINE 
VALUE 
VARIABLE 
CONSTANT 
FUNCTION 
SCOPE 
KEY_LAST 

Definition at line 79 of file Keys.h.


Constructor & Destructor Documentation

GrinderKeys::GrinderKeys  )  [inline]
 

Definition at line 32 of file GrinderKeys.h.

GrinderKeys::GrinderKeys const std::string name,
int  type,
const KeyPair subKeys = 0,
int  nSubKeys = 0
[inline]
 

Definition at line 33 of file GrinderKeys.h.

References name, and type.


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

KeySP Key::addKey const KeyPair  kp  )  [inherited]
 

Definition at line 105 of file Keys.cpp.

References Key::addKey(), KeyPair::key, Key::Key(), and KeyPair::kn.

KeySP Key::addKey const GKeyType  kn,
const KeySP  key
[inherited]
 

add a key

Definition at line 92 of file Keys.cpp.

References Key::_keys, SimBase::derr(), and Key::KeySPMapIter.

Referenced by Key::addKey(), and Key::Key().

KeySP GrinderKeys::addPConst const KeyPair  pckp  ) 
 

Definition at line 72 of file GrinderKeys.cpp.

References addPConst(), KeyPair::key, Key::Key(), and KeyPair::kn.

KeySP GrinderKeys::addPConst const GKeyType  kn,
const KeySP  pconstKey
 

add pconst

Definition at line 65 of file GrinderKeys.cpp.

References Key::IVEC_TYPE, pconst(), and Key::size().

Referenced by addPConst().

int GrinderKeys::addTexture glift::SingleTexSP  tex  ) 
 

add returns the texture's index

Definition at line 117 of file GrinderKeys.cpp.

References _textures.

KeySP Key::delKey const GKeyType  kn  )  [inherited]
 

delete a key, returns Null if key not found

Definition at line 114 of file Keys.cpp.

References Key::_keys, SimBase::derr(), Key::KeySP, and Key::KeySPMapIter.

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

KeySP GrinderKeys::env  )  const
 

environment keys

environment keys

Definition at line 30 of file GrinderKeys.cpp.

References EnvKey, Key::getKey(), and KeyPair::kn.

KeySPMap Key::getAllKeys  )  const [inline, inherited]
 

these accessors will be null if there was an error, or un-found key, ie.

retKey.isNull() == true a key may have sub keys, get them...

Definition at line 110 of file Keys.h.

References Key::_keys, and Key::KeySPMap.

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

virtual DVEC_TYPE Key::getDVec  )  const [inline, virtual, inherited]
 

for comparisons

Definition at line 97 of file Keys.h.

References Key::_dv, and Key::DVEC_TYPE.

virtual IVEC_TYPE Key::getIVec  )  const [inline, virtual, inherited]
 

for comparisons

Definition at line 104 of file Keys.h.

References Key::_iv, and Key::IVEC_TYPE.

KeySP Key::getKey const GKeyType  kn  )  const [inherited]
 

get a specific key, returns Null key if not found

Definition at line 61 of file Keys.cpp.

References Key::_keys, SimBase::derr(), and Key::KeySP.

Referenced by env(), pconst(), pos(), and val().

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

Definition at line 45 of file simBase.h.

References SimBase::_name_.

Referenced by MetaProg::operator<<().

std::string Key::getName  )  const [inline, inherited]
 

the key's name isn't the same as it's index into the key map.

Definition at line 70 of file Keys.h.

References Key::_name.

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

Definition at line 44 of file simBase.h.

References string.

int Key::getOp  )  const [inline, inherited]
 

operators, used for felt and sudo compiling

Definition at line 124 of file Keys.h.

References Key::_op.

std::string Key::getText  )  const [inline, inherited]
 

text, may not always be valid

Definition at line 74 of file Keys.h.

References Key::_text.

glift::SingleTexSP GrinderKeys::getTexture int  i  ) 
 

get returns a null sp if index is out of bounds

Definition at line 127 of file GrinderKeys.cpp.

References _textures, and glift::SingleTexSP.

glift::SingleTexSPVec GrinderKeys::getTextureVec  )  const [inline]
 

get the whole vector of textures!

Definition at line 70 of file GrinderKeys.h.

References _textures.

int Key::getType  )  const [inline, inherited]
 

Definition at line 90 of file Keys.h.

References Key::_type.

virtual GrinderKeys::GrinderKey  )  [inline, virtual]
 

Definition at line 39 of file GrinderKeys.h.

bool Key::hasKey const GKeyType  kn  )  const [inherited]
 

test if a key exists

Definition at line 130 of file Keys.cpp.

References Key::_keys.

int GrinderKeys::numTextures  ) 
 

size of texture vector

Definition at line 139 of file GrinderKeys.cpp.

References _textures.

KeySP GrinderKeys::pconst  )  const
 

program constants

program constants

Definition at line 57 of file GrinderKeys.cpp.

References Key::getKey(), KeyPair::kn, and PConstKey.

Referenced by addPConst(), and pconstID().

int GrinderKeys::pconstID GKeyType  kn  ) 
 

pconst id

Definition at line 80 of file GrinderKeys.cpp.

References gutz::SmartPtr< T >::isNull(), and pconst().

int GrinderKeys::pconstID const KeySP  pconstKey  )  [inline]
 

get the program local parameter id of a key this is just stored in the IVec[0] of the key...

Definition at line 56 of file GrinderKeys.h.

KeySP GrinderKeys::pos  )  const
 

data position keys

data position keys

Definition at line 48 of file GrinderKeys.cpp.

References Key::getKey(), KeyPair::kn, and TexCKey.

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

virtual void Key::setDVec DVEC_TYPE  vec  )  [inline, virtual, inherited]
 

Definition at line 98 of file Keys.h.

References Key::_dv.

virtual void Key::setIVec IVEC_TYPE  vec  )  [inline, virtual, inherited]
 

Definition at line 105 of file Keys.h.

References Key::_iv.

KeySP Key::setKey const GKeyType  kn,
const KeySP  key
[inherited]
 

set a specific key, returns Null if key not found

Definition at line 76 of file Keys.cpp.

References Key::_keys, SimBase::derr(), Key::KeySP, and Key::KeySPMapIter.

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

Definition at line 47 of file simBase.h.

References SimBase::_name_, and name.

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

Reimplemented from SimBase.

Definition at line 71 of file Keys.h.

References Key::_name, and name.

void Key::setOp int  op  )  [inline, inherited]
 

Definition at line 125 of file Keys.h.

References Key::_op.

void Key::setText std::string  text  )  [inline, inherited]
 

Definition at line 75 of file Keys.h.

References Key::_text.

void GrinderKeys::setTexture int  i,
glift::SingleTexSP  tex
 

textures set a texture, inserts null textures if it has to.

Definition at line 96 of file GrinderKeys.cpp.

References _textures.

void Key::setType int  type  )  [inline, inherited]
 

Definition at line 91 of file Keys.h.

References Key::_type, and type.

int Key::size  )  [inline, inherited]
 

size of subKey map

Definition at line 128 of file Keys.h.

References Key::_keys.

Referenced by addPConst().

KeySP GrinderKeys::val  )  const
 

data value keys

data value keys

Definition at line 39 of file GrinderKeys.cpp.

References DataValKey, Key::getKey(), and KeyPair::kn.


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

DVEC_TYPE Key::_dv [protected, inherited]
 

Definition at line 137 of file Keys.h.

Referenced by Key::getDVec(), and Key::setDVec().

IVEC_TYPE Key::_iv [protected, inherited]
 

Definition at line 138 of file Keys.h.

Referenced by Key::getIVec(), and Key::setIVec().

KeySPMap Key::_keys [protected, inherited]
 

Definition at line 135 of file Keys.h.

Referenced by Key::addKey(), Key::delKey(), Key::getAllKeys(), Key::getKey(), Key::hasKey(), Key::setKey(), and Key::size().

std::string Key::_name [protected, inherited]
 

Definition at line 131 of file Keys.h.

Referenced by Key::getName(), and Key::setName().

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

int Key::_op [protected, inherited]
 

Definition at line 134 of file Keys.h.

Referenced by Key::getOp(), and Key::setOp().

std::string Key::_text [protected, inherited]
 

Definition at line 132 of file Keys.h.

Referenced by Key::getText(), and Key::setText().

glift::SingleTexSPVec GrinderKeys::_textures [protected]
 

Definition at line 73 of file GrinderKeys.h.

Referenced by addTexture(), getTexture(), getTextureVec(), numTextures(), and setTexture().

int Key::_type [protected, inherited]
 

Definition at line 133 of file Keys.h.

Referenced by Key::getType(), and Key::setType().

const DVEC_TYPE Key::DVEC_UNUSED [inherited]
 

Definition at line 95 of file Keys.h.

const IVEC_TYPE Key::IVEC_UNUSED [inherited]
 

Definition at line 102 of file Keys.h.


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