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

#include <World.h>

Inheritance diagram for vrecko::World:
vrecko::BaseClass

Classes

struct  AvatarEye
 Struct AvatarEye - represents avatar eye's camera parameters. More...
 
struct  AvatarView
 Struct for description of AvatarView. More...
 
struct  SG_CHANGE
 Struct that includes values of the operation parameters. More...
 

Public Types

enum  SG_OPERATION_TYPE {
  UNKNOWN, ADD_CHILD, ADD_EOCHILD, REMOVE_CHILD,
  REMOVE_EOCHILD, SET_STATESET, DELETE_STATESET, SET_TEXT
}
 Enum to describe scenegraph operation. More...
 
- Public Types inherited from vrecko::BaseClass
enum  NotificationTypes {
  NOTIFICATION_DELETE_CLASS = 1, NOTIFICATION_EO_REGISTERING = 2, NOTIFICATION_EO_UNREGISTERING = 4, NOTIFICATION_PROGRAM_TERMINATION = 8,
  NOTIFICATION_ALL = 0xFFFFFFFF
}
 

Public Member Functions

 World ()
 
 ~World ()
 
 World (const World &w)
 
void setViewerPtr (ViewerBase *pV)
 
ViewerBasegetViewerPtr ()
 
osg::Camera * getCamera (void)
 
osgShadow::ShadowedScene * getShadowedScenePtr ()
 
osg::LightSource * getShadowedSceneLight ()
 
void setDescription (const std::string &desc)
 Set description of the World. More...
 
const std::string & getDescription (void) const
 Return the description. More...
 
void setScenePtr (Scene *nScene)
 Set pointer to the Scene. More...
 
ScenegetScenePtr (void)
 Return pointer to the Scene. More...
 
AvatarViewgetActualAvatarView (void)
 Return pointer to actual AvatarView. More...
 
void setActualAvatarView (AvatarView *av)
 Set actual AvatarView. More...
 
bool removeAvatarView (AvatarView *av)
 Remove AvatarView with given pointer. More...
 
vrecko::AbilitycreateAbility (const std::string &plugin_name, const std::string &ability_name, BaseClass *_owner, const char *_overridingID=NULL)
 
void setDeviceManagerPtr (DeviceManager *ptr)
 
DeviceManagergetDeviceManagerPtr ()
 
void setEventDispatcherPtr (EventDispatcher *ptr)
 
EventDispatchergetEventDispatcherPtr ()
 
void setSchedulerPtr (Scheduler *sched)
 
SchedulergetSchedulerPtr ()
 
PersistentCachegetPersistentCache ()
 
bool getTerminationFlag ()
 
bool loadXMLParameters (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parametersNode)
 
void noticeLog (const char *notice="",...)
 
void warningLog (const char *warning="",...)
 
void errorLog (const char *error="",...)
 
void debugLog (const char *debugText="",...)
 
void debugFileLog (const char *debugText="",...)
 
bool addAbility (Ability *pAbility)
 Adds ability to EO. More...
 
bool removeAbility (Ability *pAbility)
 Removes ability from EO. More...
 
bool removeAbility (const std::string &ability_id)
 
AbilitygetAbility (const std::string &ab_id)
 Return pointer to ability with given ID. More...
 
std::map< std::string, Ability * > & getAbilityMap (void)
 Return map of the abilities in the EO. More...
 
bool reportEvent (const std::string &senderAndOutputString, VreckoMessage *pMessage, EventType eType=EXPRESS_EVENT)
 
bool reportEvent (BaseClass *receiver_ptr, const std::string &input_name, VreckoMessage *pMessage, EventType eType=EXPRESS_EVENT)
 
osg::ref_ptr< VreckoMessagerequest (const std::string &req_sender, VreckoMessage *pMessage)
 
osg::ref_ptr< VreckoMessagerequest (BaseClass *receiver_ptr, const std::string &request_name, VreckoMessage *pMessage)
 
unsigned long getFrameID ()
 
void incrementFrameID ()
 
bool getShowTimeWarnings ()
 
void setShowTimeWarnings (bool bNewValue)
 
unsigned long getTimeWarningsTime ()
 
void setTimeWarningsTime (unsigned long ulNewValue)
 
void SendTerminationNotifications ()
 
void setArgumens (int &count, char **arguments)
 
int getNumberOfArguments ()
 
char ** getArguments ()
 
- 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 void update (void)
 This method is called periodically in case this instance is registered in Scheduler. 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...
 
virtual const std::string & getSenderString (void)
 Returns the sender (or receiver) identification string. 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 void preInitialize (void)
 OBSOLETE METHOD, kept for backwards compatibility. More...
 
virtual void postInitialize (void)
 OBSOLETE METHOD, kept for backwards compatibility. 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

osg::ref_ptr
< osgShadow::ShadowedScene > 
shadowedScene
 
class {
AvatarEyes
 

Protected Attributes

std::string description
 Description string. More...
 
ScenepScene
 Pointer to the Scene. More...
 
std::vector< AvatarView * > avatar_view_vector
 Vector of AvatarViews. More...
 
ViewerBaseviewer
 
osg::ref_ptr< osg::LightSource > mainLightSource
 
AbilityDispatcherability_dispatcher
 Internal AbilityDispatcher that serves to maintain abilities in EO. More...
 
PersistentCachepersistentCache
 
- 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
 

Additional Inherited Members

- Protected Types inherited from vrecko::BaseClass
typedef std::map< std::string,
int > 
AttributeMap
 Attributes. More...
 
typedef std::vector
< osg::ref_ptr< IOPinBase > > 
PinList
 
- 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...
 

Member Enumeration Documentation

Enum to describe scenegraph operation.

Enumerator
UNKNOWN 
ADD_CHILD 
ADD_EOCHILD 
REMOVE_CHILD 
REMOVE_EOCHILD 
SET_STATESET 
DELETE_STATESET 
SET_TEXT 

Constructor & Destructor Documentation

vrecko::World::World ( )
vrecko::World::~World ( )
vrecko::World::World ( const World w)

Member Function Documentation

bool vrecko::World::addAbility ( Ability pAbility)
inline

Adds ability to EO.

vrecko::Ability * vrecko::World::createAbility ( const std::string &  plugin_name,
const std::string &  ability_name,
BaseClass _owner,
const char *  _overridingID = NULL 
)
void vrecko::World::debugFileLog ( const char *  debugText = "",
  ... 
)
void vrecko::World::debugLog ( const char *  debugText = "",
  ... 
)
void vrecko::World::errorLog ( const char *  error = "",
  ... 
)
Ability* vrecko::World::getAbility ( const std::string &  ab_id)
inline

Return pointer to ability with given ID.

std::map<std::string, Ability*>& vrecko::World::getAbilityMap ( void  )
inline

Return map of the abilities in the EO.

AvatarView* vrecko::World::getActualAvatarView ( void  )
inline

Return pointer to actual AvatarView.

char ** vrecko::World::getArguments ( )
osg::Camera* vrecko::World::getCamera ( void  )
inline
const std::string& vrecko::World::getDescription ( void  ) const
inline

Return the description.

DeviceManager* vrecko::World::getDeviceManagerPtr ( )
inline

Get DeviceManager pointer.

EventDispatcher* vrecko::World::getEventDispatcherPtr ( )
inline

Get EventDispatcher pointer.

unsigned long vrecko::World::getFrameID ( )
inline
int vrecko::World::getNumberOfArguments ( )
PersistentCache* vrecko::World::getPersistentCache ( )
inline
Scene* vrecko::World::getScenePtr ( void  )
inline

Return pointer to the Scene.

Scheduler* vrecko::World::getSchedulerPtr ( )
inline

Get Scheduler pointer

osg::LightSource* vrecko::World::getShadowedSceneLight ( )
inline
osgShadow::ShadowedScene* vrecko::World::getShadowedScenePtr ( )
inline
bool vrecko::World::getShowTimeWarnings ( )
inline
bool vrecko::World::getTerminationFlag ( )
inline

Get value of the termination flag.

unsigned long vrecko::World::getTimeWarningsTime ( )
inline
ViewerBase* vrecko::World::getViewerPtr ( )
inline
void vrecko::World::incrementFrameID ( )
inline
bool vrecko::World::loadXMLParameters ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode parametersNode)
virtual

Load parameters from xml file

Reimplemented from vrecko::BaseClass.

void vrecko::World::noticeLog ( const char *  notice = "",
  ... 
)
bool vrecko::World::removeAbility ( Ability pAbility)
inline

Removes ability from EO.

bool vrecko::World::removeAbility ( const std::string &  ability_id)
bool vrecko::World::removeAvatarView ( AvatarView av)

Remove AvatarView with given pointer.

bool vrecko::World::reportEvent ( const std::string &  senderAndOutputString,
VreckoMessage pMessage,
EventType  eType = EXPRESS_EVENT 
)
inline
bool vrecko::World::reportEvent ( BaseClass receiver_ptr,
const std::string &  input_name,
VreckoMessage pMessage,
EventType  eType = EXPRESS_EVENT 
)
inline
osg::ref_ptr<VreckoMessage> vrecko::World::request ( const std::string &  req_sender,
VreckoMessage pMessage 
)
inline
osg::ref_ptr<VreckoMessage> vrecko::World::request ( BaseClass receiver_ptr,
const std::string &  request_name,
VreckoMessage pMessage 
)
inline
void vrecko::World::SendTerminationNotifications ( )
inline
void vrecko::World::setActualAvatarView ( AvatarView av)
inline

Set actual AvatarView.

void vrecko::World::setArgumens ( int &  count,
char **  arguments 
)
void vrecko::World::setDescription ( const std::string &  desc)
inline

Set description of the World.

void vrecko::World::setDeviceManagerPtr ( DeviceManager ptr)
inline

Set DeviceManager pointer.

void vrecko::World::setEventDispatcherPtr ( EventDispatcher ptr)
inline

Set EventDispatcher pointer.

void vrecko::World::setScenePtr ( Scene nScene)

Set pointer to the Scene.

void vrecko::World::setSchedulerPtr ( Scheduler sched)
inline

Set Scheduler pointer

void vrecko::World::setShowTimeWarnings ( bool  bNewValue)
inline
void vrecko::World::setTimeWarningsTime ( unsigned long  ulNewValue)
inline
void vrecko::World::setViewerPtr ( vrecko::ViewerBase pV)
void vrecko::World::warningLog ( const char *  warning = "",
  ... 
)

Member Data Documentation

AbilityDispatcher* vrecko::World::ability_dispatcher
protected

Internal AbilityDispatcher that serves to maintain abilities in EO.

std::vector<AvatarView *> vrecko::World::avatar_view_vector
protected

Vector of AvatarViews.

class { ... } vrecko::World::AvatarEyes
std::string vrecko::World::description
protected

Description string.

osg::ref_ptr<osg::LightSource> vrecko::World::mainLightSource
protected
PersistentCache* vrecko::World::persistentCache
protected
Scene* vrecko::World::pScene
protected

Pointer to the Scene.

osg::ref_ptr<osgShadow::ShadowedScene> vrecko::World::shadowedScene
ViewerBase* vrecko::World::viewer
protected

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