vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
APMenu::DynamicMenu Class Reference

#include <DynamicMenu.h>

Inheritance diagram for APMenu::DynamicMenu:
vrecko::Ability vrecko::BaseClass

Public Member Functions

 DynamicMenu ()
 
virtual ~DynamicMenu ()
 
EnvironmentObjectgetOwner ()
 
EnvironmentObjectgetMainObject ()
 
virtual void preInitialize ()
 called as the first initialization method, before loadXMLParameters More...
 
virtual void postInitialize ()
 called as the last initialization method, after loadXMLParameters More...
 
virtual bool loadXMLParameters (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode)
 loads XML parameters from given node More...
 
virtual void update ()
 called by the VRECKO scheduler at specified frequency More...
 
bool setMenuString (const char *newMenuString)
 
bool addMenuItem (MenuItem *parentItem, MenuItem *itemToAdd)
 
bool insertMenuItem (MenuItem *parentItem, MenuItem *prevSibling, MenuItem *itemToAdd)
 
bool deleteMenuItem (MenuItem *item)
 
bool registerNewItemType (MenuItem *itemTemplate)
 
MenuType getMenuType ()
 
void setAttribute (const std::string &name, float value)
 
float getAttribute (const std::string &name)
 
void setSign (const std::string &name, const std::string &value)
 
osg::Node * getSignObject (const std::string &name)
 
bool isMainButtonPressed ()
 
bool isSelectionLocked ()
 
bool showMenu (osg::Vec3 *_menuPos)
 
void hideMenu ()
 
osg::Vec3 & getProjPointerPos ()
 
osg::Vec3 & getLastPointerPos ()
 
void sendToClickedOutput (char *eventValue)
 
- Public Member Functions inherited from vrecko::Ability
virtual ~Ability ()
 copy constructor More...
 
const std::string & getName () const
 Returns the ability name. More...
 
void setPluginName (const char *pName)
 Sets the plugin name. More...
 
const std::string & getPluginName (void) const
 Returns the plugin name. More...
 
const std::string & getID (void) const
 Returns ability the identification string. More...
 
void setID (const char *pID)
 (Internal usage, most people should not need to use it.) Sets the ability ID. More...
 
virtual void clean (void)
 
void setOwner (BaseClass *owner)
 (Internal usage, most people should not need to use it.) Sets ability owner. *l This method is called automatically in World::createAbility(), so one would (almost?) never want to use it directly. More...
 
BaseClassgetOwner (void)
 Returns the ability owner. More...
 
virtual ParameterVectorgetParameterVector (void)
 Return vector of the parameter description. More...
 
bool isUpdated (void)
 Set update flag. More...
 
virtual const std::string & getSenderString (void)
 Returns the identification string of sender. More...
 
- Public Member Functions inherited from vrecko::BaseClass
 BaseClass (const char *startingSenderString)
 The main constructor. More...
 
 BaseClass (BaseClass &bc)
 Copy constructor. Probably not really used. More...
 
virtual ~BaseClass ()
 Destructor. More...
 
virtual bool initialize (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parameters=NULL)
 Core initialization. More...
 
virtual bool initializeFromString (const char *xmlString)
 Helper method that allows to initialize ability from a XML-formatted string. More...
 
virtual
XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode
saveXMLParameters (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *)
 Save current setting into a XML node. More...
 
bool inputPresent (const std::string &name)
 Returns true if input pin (not request inputpin ) with given name is present. More...
 
bool outputPresent (const std::string &name)
 Returns true if output pin (not request output pin) with given name is present. More...
 
void addInputPin (InputPinBase *pin)
 Adds an input pin. More...
 
void removeInputPin (InputPinBase *pin)
 Removes an input pin. More...
 
void addOutputPin (OutputPinBase *pin)
 Adds an output pin. More...
 
void removeOutputPin (OutputPinBase *pin)
 Removes and output pin. More...
 
void addRequestInputPin (RequestInputPinBase *pin)
 Adds a request input pin. More...
 
void removeRequestInputPin (RequestInputPinBase *pin)
 Removes a request input pin. More...
 
void addRequestOutputPin (RequestOutputPinBase *pin)
 Adds a request output pin. More...
 
void removeRequestOutputPin (RequestOutputPinBase *pin)
 Removes a request output pin. More...
 
bool addNotification (BaseClass *receiver, unsigned long notificationTypes)
 Registers an observer that will be notified if a specific change occurs. More...
 
bool removeNotification (BaseClass *receiver, unsigned long notificationTypes=NOTIFICATION_ALL)
 Unregisters a previously registered observer. More...
 
virtual void processEvent (const std::string &input_name, VreckoMessage *pMessage)
 Internal method for processing the events. More...
 
virtual VreckoMessageprocessRequest (const std::string &request_input_name, VreckoMessage *pMessage)
 Internal method for processing the requests. More...
 
void reportError (const std::string &error)
 Print error message. More...
 
void setPriority (long int pr)
 Sets the priority. (Possible problems - read the full description for more info) More...
 
long int getPriority (void) const
 Returns current object priority. More...
 
void setAttribute (const std::string &attr_name, int attr_value)
 Sets an attribute value. More...
 
int getAttribute (const std::string &attr_name)
 Returns attribute value. More...
 
int getAttribute (const char *attr_name)
 Returns attribute value. More...
 
void deleteAttribute (const std::string &attr_name)
 Delete an attribute. More...
 
void setSceneFile (const std::string &sceneFileName)
 Set the name of the file this component was in (and possibly will be saved to). More...
 
const std::string & getSceneFile () const
 Get the name of the file this component was in. More...
 
virtual bool loadXMLParameters (const char *xmlString)
 OBSOLETE METHOD, kept for backwards compatibility. More...
 
InputPinBasegetInputPin (const char *strName)
 Returns pointer to an input pin with specified name. More...
 
OutputPinBasegetOutputPin (const char *strName)
 Returns pointer to an output pin with specified name. More...
 
RequestInputPinBasegetRequestInputPin (const char *strName)
 Returns pointer to an request input pin with specified name. More...
 
RequestOutputPinBasegetRequestOutputPin (const char *strName)
 Returns pointer to an input pin with specified name. More...
 

Public Attributes

DynamicTree< MenuItemitemTree
 

Protected Member Functions

bool mainButtonPressed ()
 
bool mainButtonReleased ()
 
bool showChildMenu (MenuItem *parentItem, bool bSetNewRoot)
 
void hideChildMenu (MenuItem *parentItem=NULL, bool bIncludeSubMenus=true)
 
bool isVisible ()
 
bool showMainMenuObject ()
 
void hideMainMenuObject ()
 
void updatePointerPosition ()
 
void updateMainObjectTransformation ()
 
void updateInverseCalc ()
 
bool pointerMoved (osg::Vec3 *pointerPos)
 
bool viewMoved ()
 
bool pointerViewMovedHelper ()
 
bool createMenuFromString ()
 
bool createMenuFromNode (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *paramNode)
 
bool loadMenuStructureFromNode (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *paramNode)
 
bool loadSignsFromXML (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *attribsNode)
 
bool loadAttributes (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *attribsNode)
 
bool loadMenuItems (MenuItem *parentItem, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parentNode)
 
void destroyMenuStructure ()
 
bool createMainObjects ()
 
void destroyMainObjects ()
 
bool createPointerTrail ()
 
void destroyPointerTrail ()
 
void showPointerTrail ()
 
void hidePointerTrail ()
 
bool pointerUnselectItem (bool bLeaveSelectedIfLocked=true)
 
bool pointerSelectItem (MenuItem *item)
 
bool solvePointerSelection ()
 
MenuItemgetPointedItemRecursive (MenuItem *parent, int *depth)
 
bool expandItem (MenuItem *item)
 
bool collapseItem (MenuItem *item)
 
bool collapseSiblings (MenuItem *item)
 
void itemClicked (MenuItem *item)
 
void confirmAnimationEnded ()
 
void resetBaseValues ()
 
void initStandardSignSet ()
 
void changeToStructureOccured ()
 
bool unselectItem ()
 
void menuGrid_getSize (int *columns, int *rows)
 
 DECLARE_INPUT (Create, MessageString)
 
 DECLARE_INPUT (ButtonPress, MessageBool)
 
 DECLARE_INPUT (ConfirmAnimationEnded, MessageBool)
 
 DECLARE_OUTPUT (Clicked, MessageString)
 
 DECLARE_OUTPUT (HidingMenu, MessageBool)
 
 DECLARE_REQUEST_INPUT (ActivePointerID, MessageInt, MessageInt)
 
 DECLARE_REQUEST_OUTPUT (PointerPosition, MessageInt, MessageVec3)
 
- Protected Member Functions inherited from vrecko::Ability
 Ability (const char *theAbilityName)
 
- Protected Member Functions inherited from vrecko::BaseClass
bool sendNotifications (unsigned long notificationType, void *notificationData)
 
virtual int processNotification (BaseClass *sender, unsigned long notificationType, void *notificationData)
 Process an incoming notification. More...
 
IOPinBasefindPinInList (const char *strName, PinList *pinList)
 Internal method to find a given pin in a given list. More...
 

Protected Attributes

EnvironmentObjectowner
 
std::string baseDirectory
 
int activePointerID
 
osg::Vec3 origMenuPos
 
osg::Vec3 origViewPos
 
osg::Vec3 origViewUp
 
osg::Vec3 origViewLookAt
 
osg::Vec3 autoMoveShift
 
osg::ref_ptr< EnvironmentObjectmainObject
 
osg::ref_ptr< EnvironmentObjectshadowEO
 
osg::ref_ptr< EnvironmentObjectdispEO
 
osg::Matrix inverseTransformMatrix
 
osg::Vec3 lastPointerPos
 
osg::Vec3 lastViewPos
 
osg::Vec3 transPointerPos
 
osg::Vec3 projPointerPos
 
osg::Vec3 transViewPos
 
bool bMainButtonPressed
 
bool bAllowSelectOnRelease
 
DynamicArray< MenuItem * > registeredItemTypes
 
std::string menuString
 
std::map< std::string, float > attributes
 
std::map< std::string,
DynamicMenuSign * > 
signs
 
MenuType menuType
 
MenuItempointerSelected
 
MenuItemvisibleMenuRoot
 
MenuItemselectedItem
 
osg::ref_ptr
< osg::MatrixTransform > 
osgPointerTrailTransform
 
osg::ref_ptr< osg::Geode > osgPointerTrailGeode
 
osg::ref_ptr< osg::Cylinder > osgPointerTrail
 
osg::ref_ptr< osg::ShapeDrawable > osgPointerTrailDrawable
 
int menuGrid_columnsCached
 
int menuGrid_rowsCached
 
- Protected Attributes inherited from vrecko::Ability
BaseClasspOwner
 Pointer to the owner of this ability. (Almost?) always an EnvironmentObject class. More...
 
std::vector< std::string > parameterString
 
bool updated
 Update flag. It is used for save. More...
 
- Protected Attributes inherited from vrecko::BaseClass
AttributeMap attribute
 
MTReadWriteLock attributeLock
 
std::string senderString
 
MTLock notificationsLock
 
std::vector
< NOTIFICATION_DESCRIPTION
notifications
 
long int priority
 
const std::string * sceneFile
 
PinList inputPinsList
 
PinList outputPinsList
 
PinList requestInputPinsList
 
PinList requestOutputPinsList
 

Friends

class MenuItem
 

Additional Inherited Members

- Public Types inherited from vrecko::Ability
typedef std::vector
< ParameterStruct
ParameterVector
 Vector of the description of parameters. More...
 
- Protected Types inherited from vrecko::BaseClass
typedef std::map< std::string,
int > 
AttributeMap
 Attributes. More...
 
typedef std::vector
< osg::ref_ptr< IOPinBase > > 
PinList
 

Constructor & Destructor Documentation

APMenu::DynamicMenu::DynamicMenu ( )
APMenu::DynamicMenu::~DynamicMenu ( )
virtual

Member Function Documentation

bool APMenu::DynamicMenu::addMenuItem ( MenuItem parentItem,
MenuItem itemToAdd 
)
void APMenu::DynamicMenu::changeToStructureOccured ( )
protected
bool APMenu::DynamicMenu::collapseItem ( MenuItem item)
protected
bool APMenu::DynamicMenu::collapseSiblings ( MenuItem item)
protected
void APMenu::DynamicMenu::confirmAnimationEnded ( )
protected
bool APMenu::DynamicMenu::createMainObjects ( )
protected
bool APMenu::DynamicMenu::createMenuFromNode ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  paramNode)
protected
bool APMenu::DynamicMenu::createMenuFromString ( void  )
protected
bool APMenu::DynamicMenu::createPointerTrail ( )
protected
APMenu::DynamicMenu::DECLARE_INPUT ( Create  ,
MessageString   
)
protected
APMenu::DynamicMenu::DECLARE_INPUT ( ButtonPress  ,
MessageBool   
)
protected
APMenu::DynamicMenu::DECLARE_INPUT ( ConfirmAnimationEnded  ,
MessageBool   
)
protected
APMenu::DynamicMenu::DECLARE_OUTPUT ( Clicked  ,
MessageString   
)
protected
APMenu::DynamicMenu::DECLARE_OUTPUT ( HidingMenu  ,
MessageBool   
)
protected
APMenu::DynamicMenu::DECLARE_REQUEST_INPUT ( ActivePointerID  ,
MessageInt  ,
MessageInt   
)
protected
APMenu::DynamicMenu::DECLARE_REQUEST_OUTPUT ( PointerPosition  ,
MessageInt  ,
MessageVec3   
)
protected
bool APMenu::DynamicMenu::deleteMenuItem ( MenuItem item)
void APMenu::DynamicMenu::destroyMainObjects ( )
protected
void APMenu::DynamicMenu::destroyMenuStructure ( )
protected
void APMenu::DynamicMenu::destroyPointerTrail ( )
protected
bool APMenu::DynamicMenu::expandItem ( MenuItem item)
protected
float APMenu::DynamicMenu::getAttribute ( const std::string &  name)
inline
osg::Vec3& APMenu::DynamicMenu::getLastPointerPos ( )
inline
EnvironmentObject* APMenu::DynamicMenu::getMainObject ( )
inline
MenuType APMenu::DynamicMenu::getMenuType ( )
inline
EnvironmentObject* APMenu::DynamicMenu::getOwner ( void  )
inline
MenuItem * APMenu::DynamicMenu::getPointedItemRecursive ( MenuItem parent,
int *  depth 
)
protected
osg::Vec3& APMenu::DynamicMenu::getProjPointerPos ( )
inline
osg::Node * APMenu::DynamicMenu::getSignObject ( const std::string &  name)
void APMenu::DynamicMenu::hideChildMenu ( MenuItem parentItem = NULL,
bool  bIncludeSubMenus = true 
)
protected
void APMenu::DynamicMenu::hideMainMenuObject ( )
protected
void APMenu::DynamicMenu::hideMenu ( )
void APMenu::DynamicMenu::hidePointerTrail ( )
protected
void APMenu::DynamicMenu::initStandardSignSet ( )
protected
bool APMenu::DynamicMenu::insertMenuItem ( MenuItem parentItem,
MenuItem prevSibling,
MenuItem itemToAdd 
)
bool APMenu::DynamicMenu::isMainButtonPressed ( )
inline
bool APMenu::DynamicMenu::isSelectionLocked ( )
inline
bool APMenu::DynamicMenu::isVisible ( )
protected
void APMenu::DynamicMenu::itemClicked ( MenuItem item)
protected
bool APMenu::DynamicMenu::loadAttributes ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  attribsNode)
protected
bool APMenu::DynamicMenu::loadMenuItems ( MenuItem parentItem,
XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  parentNode 
)
protected
bool APMenu::DynamicMenu::loadMenuStructureFromNode ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  paramNode)
protected
bool APMenu::DynamicMenu::loadSignsFromXML ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  attribsNode)
protected
bool APMenu::DynamicMenu::loadXMLParameters ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  pParametersNode)
virtual

loads XML parameters from given node

Reimplemented from vrecko::BaseClass.

bool APMenu::DynamicMenu::mainButtonPressed ( )
protected
bool APMenu::DynamicMenu::mainButtonReleased ( )
protected
void APMenu::DynamicMenu::menuGrid_getSize ( int *  columns,
int *  rows 
)
protected
bool APMenu::DynamicMenu::pointerMoved ( osg::Vec3 *  pointerPos)
protected
bool APMenu::DynamicMenu::pointerSelectItem ( MenuItem item)
protected
bool APMenu::DynamicMenu::pointerUnselectItem ( bool  bLeaveSelectedIfLocked = true)
protected
bool APMenu::DynamicMenu::pointerViewMovedHelper ( )
protected
void APMenu::DynamicMenu::postInitialize ( void  )
virtual

called as the last initialization method, after loadXMLParameters

Reimplemented from vrecko::BaseClass.

void APMenu::DynamicMenu::preInitialize ( void  )
virtual

called as the first initialization method, before loadXMLParameters

Reimplemented from vrecko::BaseClass.

bool APMenu::DynamicMenu::registerNewItemType ( MenuItem itemTemplate)
void APMenu::DynamicMenu::resetBaseValues ( )
protected
void APMenu::DynamicMenu::sendToClickedOutput ( char *  eventValue)
void APMenu::DynamicMenu::setAttribute ( const std::string &  name,
float  value 
)
inline
bool APMenu::DynamicMenu::setMenuString ( const char *  newMenuString)
void APMenu::DynamicMenu::setSign ( const std::string &  name,
const std::string &  value 
)
bool APMenu::DynamicMenu::showChildMenu ( MenuItem parentItem,
bool  bSetNewRoot 
)
protected
bool APMenu::DynamicMenu::showMainMenuObject ( )
protected
bool APMenu::DynamicMenu::showMenu ( osg::Vec3 *  _menuPos)
void APMenu::DynamicMenu::showPointerTrail ( )
protected
bool APMenu::DynamicMenu::solvePointerSelection ( )
protected
bool APMenu::DynamicMenu::unselectItem ( )
protected
void APMenu::DynamicMenu::update ( void  )
virtual

called by the VRECKO scheduler at specified frequency

Reimplemented from vrecko::BaseClass.

void APMenu::DynamicMenu::updateInverseCalc ( )
protected
void APMenu::DynamicMenu::updateMainObjectTransformation ( )
protected
void APMenu::DynamicMenu::updatePointerPosition ( )
protected
bool APMenu::DynamicMenu::viewMoved ( )
protected

Friends And Related Function Documentation

friend class MenuItem
friend

Member Data Documentation

int APMenu::DynamicMenu::activePointerID
protected
std::map<std::string, float> APMenu::DynamicMenu::attributes
protected
osg::Vec3 APMenu::DynamicMenu::autoMoveShift
protected
bool APMenu::DynamicMenu::bAllowSelectOnRelease
protected
std::string APMenu::DynamicMenu::baseDirectory
protected
bool APMenu::DynamicMenu::bMainButtonPressed
protected
osg::ref_ptr<EnvironmentObject> APMenu::DynamicMenu::dispEO
protected
osg::Matrix APMenu::DynamicMenu::inverseTransformMatrix
protected
DynamicTree<MenuItem> APMenu::DynamicMenu::itemTree
osg::Vec3 APMenu::DynamicMenu::lastPointerPos
protected
osg::Vec3 APMenu::DynamicMenu::lastViewPos
protected
osg::ref_ptr<EnvironmentObject> APMenu::DynamicMenu::mainObject
protected
int APMenu::DynamicMenu::menuGrid_columnsCached
protected
int APMenu::DynamicMenu::menuGrid_rowsCached
protected
std::string APMenu::DynamicMenu::menuString
protected
MenuType APMenu::DynamicMenu::menuType
protected
osg::Vec3 APMenu::DynamicMenu::origMenuPos
protected
osg::Vec3 APMenu::DynamicMenu::origViewLookAt
protected
osg::Vec3 APMenu::DynamicMenu::origViewPos
protected
osg::Vec3 APMenu::DynamicMenu::origViewUp
protected
osg::ref_ptr<osg::Cylinder> APMenu::DynamicMenu::osgPointerTrail
protected
osg::ref_ptr<osg::ShapeDrawable> APMenu::DynamicMenu::osgPointerTrailDrawable
protected
osg::ref_ptr<osg::Geode> APMenu::DynamicMenu::osgPointerTrailGeode
protected
osg::ref_ptr<osg::MatrixTransform> APMenu::DynamicMenu::osgPointerTrailTransform
protected
EnvironmentObject* APMenu::DynamicMenu::owner
protected
MenuItem* APMenu::DynamicMenu::pointerSelected
protected
osg::Vec3 APMenu::DynamicMenu::projPointerPos
protected
DynamicArray<MenuItem*> APMenu::DynamicMenu::registeredItemTypes
protected
MenuItem* APMenu::DynamicMenu::selectedItem
protected
osg::ref_ptr<EnvironmentObject> APMenu::DynamicMenu::shadowEO
protected
std::map<std::string, DynamicMenuSign*> APMenu::DynamicMenu::signs
protected
osg::Vec3 APMenu::DynamicMenu::transPointerPos
protected
osg::Vec3 APMenu::DynamicMenu::transViewPos
protected
MenuItem* APMenu::DynamicMenu::visibleMenuRoot
protected

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