version 3.3

VRS::Switch Class Reference

#include <vrs/switch.h>

Inheritance diagram for VRS::Switch:

VRS::MonoAttribute VRS::Attribute VRS::RenderObj VRS::SharedObj VRS::Visitable VRS::LightSwitch VRS::MirroredSwitch VRS::ShadowCasterSwitch VRS::ShadowedSwitch

List of all members.

Public Member Functions

 Switch (Iterator< SO< PolyAttribute > > *attritr=0, Iterator< bool > *flagitr=0)
virtual ID target () const =0
virtual unsigned int size () const
 "size" returns the number of switched poly attributes in the switch.
virtual void add (PolyAttribute *attr, bool switchFlag)
 "add" is used to insert an attribute and the switch position into the switch.
virtual void remove (PolyAttribute *attr)
 "remove" is used to delete an attribute of the switch.
virtual unsigned int getIndex (PolyAttribute *attr) const
 "getIndex" is used to get the internal array-position of the attribute.
virtual void setAttribute (unsigned int index, PolyAttribute *)
 set attribute at position "index" to a new value
virtual PolyAttributegetAttribute (unsigned int index) const
 get attribute at position "index"
virtual void setFlag (unsigned int index, bool switchFlag)
 modify flag at position "index", i.e., whether the attribute at index is turned on or off
virtual bool getFlag (unsigned int index) const
 read flag at position "index", i.e. whether the attribute at index is turned on or off
virtual bool invertFlag (unsigned int index)
 inverts flag at position "index", i.e. whether the attribute at index is turned on or off
virtual void setAttribute (PolyAttribute *, PolyAttribute *)
virtual void setFlag (PolyAttribute *, bool switchFlag)
virtual bool getFlag (PolyAttribute *) const
virtual bool invertFlag (PolyAttribute *)
 VRS_TYPEINFO (Switch, MonoAttribute)
 VRS_SERIALIZABLE_ABSTRACT_CLASS (Switch)

Protected Member Functions

virtual void checkType (PolyAttribute *)


Detailed Description

VRS Switch A switch is used to turn a collection of poly attributes on or off. This mono attribute base class is abstract.

Constructor & Destructor Documentation

VRS::Switch::Switch ( Iterator< SO< PolyAttribute > > *  attritr = 0,
Iterator< bool > *  flagitr = 0 
)

The constructor expects an iterator containing polyattributes and an iterator containing boolean values indication the new setting. Both iterators must have the same number of arguments.


Member Function Documentation

virtual ID VRS::Switch::target (  )  const [pure virtual]

ID of the poly attributes which can be switched by the switch. A switch can only handle poly attributes of one category! This method has to be overwritten by subclasses.

Implemented in VRS::LightSwitch, VRS::MirroredSwitch, VRS::ShadowCasterSwitch, and VRS::ShadowedSwitch.

unsigned int VRS::Switch::size ( void   )  const [inline, virtual]

"size" returns the number of switched poly attributes in the switch.

virtual void VRS::Switch::add ( PolyAttribute attr,
bool  switchFlag 
) [virtual]

"add" is used to insert an attribute and the switch position into the switch.

virtual void VRS::Switch::remove ( PolyAttribute attr  )  [virtual]

"remove" is used to delete an attribute of the switch.

virtual unsigned int VRS::Switch::getIndex ( PolyAttribute attr  )  const [virtual]

"getIndex" is used to get the internal array-position of the attribute.

virtual void VRS::Switch::setAttribute ( unsigned int  index,
PolyAttribute  
) [virtual]

set attribute at position "index" to a new value

virtual PolyAttribute* VRS::Switch::getAttribute ( unsigned int  index  )  const [virtual]

get attribute at position "index"

virtual void VRS::Switch::setFlag ( unsigned int  index,
bool  switchFlag 
) [virtual]

modify flag at position "index", i.e., whether the attribute at index is turned on or off

virtual bool VRS::Switch::getFlag ( unsigned int  index  )  const [virtual]

read flag at position "index", i.e. whether the attribute at index is turned on or off

virtual bool VRS::Switch::invertFlag ( unsigned int  index  )  [virtual]

inverts flag at position "index", i.e. whether the attribute at index is turned on or off

virtual void VRS::Switch::setAttribute ( PolyAttribute ,
PolyAttribute  
) [virtual]

virtual void VRS::Switch::setFlag ( PolyAttribute ,
bool  switchFlag 
) [virtual]

virtual bool VRS::Switch::getFlag ( PolyAttribute  )  const [virtual]

virtual bool VRS::Switch::invertFlag ( PolyAttribute  )  [virtual]

Same methods again, this time using an attribute instead of an index to find out which Attribute/Flag to change. These methods are only present for convenience, as they are a short form for { unsigned int index=getIndex(AttributeToChange); MethodName(index, ?SecondArgumentWhenPresent?); }

VRS::Switch::VRS_TYPEINFO ( Switch  ,
MonoAttribute   
)

VRS::Switch::VRS_SERIALIZABLE_ABSTRACT_CLASS ( Switch   ) 

virtual void VRS::Switch::checkType ( PolyAttribute  )  [protected, virtual]


The documentation for this class was generated from the following file:

Generated on Wed May 23 06:00:30 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact