User Class Reference

#include <User.h>

Collaboration diagram for User:

List of all members.


Classes

class  CursorTransConverterToV1_0a4
class  UserConverterToV1_0a4
class  UserTransConverterToV1_0a4

Public Member Functions

 User ()
 User (UserSetupData *setupData)
 ~User ()
bool loadConfig (std::string userCfgFilePath)
void pickUpEntity (Entity *entity, TransformationData offset)
bool dropEntity (unsigned int entityId)
void setCursorTransformationModel (std::string modelName, ArgumentVector *arguments)
void setUserTransformationModel (std::string modelName, ArgumentVector *arguments)
void setHeadTransformation (TransformationData head)
void setHandTransformation (TransformationData hand)
void setSensorTransformation (unsigned short sensorIndex, TransformationData transformation)
void setNavigatedTransformation (TransformationData navigated)
void setCursorTransformation (TransformationData &trans)
void setMoving (bool moving)
void setNetworkId (NetworkIdentification *netId)
unsigned getId ()
std::string getName ()
std::string getAvatarConfigFile ()
CursorTransformationModelgetCursorTransformationModel ()
ArgumentVectorgetCursorTransformationModelArguments ()
UserTransformationModelgetUserTransformationModel ()
ArgumentVectorgetUserTransformationModelArguments ()
TransformationData getNavigatedTransformation ()
TransformationData getCursorTransformation ()
TransformationData getWorldHeadTransformation ()
TransformationData getWorldHandTransformation ()
TransformationData getWorldSensorTransformation (unsigned short index)
TransformationData getWorldUserTransformation ()
TransformationData getTrackedHandTransformation ()
TransformationData getTrackedHeadTransformation ()
TransformationData getTrackedSensorTransformation (unsigned short index)
TransformationData getTrackedUserTransformation ()
TransformationData getUserHeadTransformation ()
TransformationData getUserHandTransformation ()
TransformationData getUserSensorTransformation (unsigned short index)
AvatarInterfacegetAvatar ()
CursorRepresentationInterfacegetCursor ()
CameraTransformationgetCamera ()
unsigned getNumberOfAssociatedEntities ()
EntitygetAssociatedEntity (unsigned int entityId)
EntitygetAssociatedEntityByIndex (unsigned index)
TransformationData getAssociatedEntityOffset (unsigned int entityId)
NetworkIdentification getNetworkId ()
bool isMoving ()

Static Public Member Functions

static void cleanup ()
static void registerCursorTransformationModelFactory (CursorTransformationModelFactory *factory)
static void registerUserTransformationModelFactory (UserTransformationModelFactory *factory)

Protected Member Functions

void commonInit (UserSetupData *setupData)
void updateUserTransformation ()
void attachCursorRepresentation ()
void detachCursorRepresentation ()
void updateCursor (float dt)

Protected Attributes

std::string name
std::string avatarConfigFile
std::string cursorRepresentationConfigFile
bool moving
unsigned id
NetworkIdentification networkId
std::vector< AssociatedEntity * > associatedEntities
CameraTransformationcamera
AvatarInterfaceavatar
CursorRepresentationInterfacecursor
TransformationData sensorTransformation [MAX_NUM_SENSORS]
TransformationData userTransformation
TransformationData navigatedTransformation
TransformationData cursorTransformation
CursorTransformationModelcursorTransformationModel
ArgumentVectorcursorTransformationModelArguments
UserTransformationModeluserTransformationModel
ArgumentVectoruserTransformationModelArguments

Static Protected Attributes

static std::vector
< CursorTransformationModelFactory * > 
cursorTransformationModelFactories
static std::vector
< UserTransformationModelFactory * > 
userTransformationModelFactories

Static Private Member Functions

static bool loadCursorTransformationModelConfig (std::string configFile, User *user)
static bool loadUserTransformationModelConfig (std::string configFile, User *user)

Static Private Attributes

static XmlConfigurationLoader userXmlConfigLoader
static XmlConfigurationLoader cursorTransXmlConfigLoader
static XmlConfigurationLoader userTransXmlConfigLoader

Friends

class UserDatabase

Constructor & Destructor Documentation

User::User (  ) 

The constructor creates a new UserSetupData, initializes the Id of the user with a random number and calls the commonInit-method

User::User ( UserSetupData setupData  ) 

The constructor calls the commonInit-method

Parameters:
setupData UserSetupData to initializes the class with

User::~User (  ) 

The destructor deletes the CameraTransformation-object, calls the removeAvatar-method from the WorldDatabase, deletes the avatar and deletes all associatedEntities-entries in the associatedEntities-list.


Member Function Documentation

void User::attachCursorRepresentation (  )  [protected]

void User::cleanup (  )  [static]

The method deletes all registered CursorTransformationModelFactories for static data

void User::commonInit ( UserSetupData setupData  )  [protected]

The method initializes the class with the passed data. If the avatar-configuration file is set in the setupData then it calls the loadAvatar-method from the WorldDatabase. It initializes all transformations, calls the setCursorTransformationModel-method to set the CursorTransformationModel and creates a new CursorRepresentation-object.

void User::detachCursorRepresentation (  )  [protected]

bool User::dropEntity ( unsigned int  entityId  ) 

The method removes the Entity with the passed entityId from the list of associated Entities. The passed Id has to be the typeBasedId of the Entity!!!

Parameters:
entityId typeBasedId of the Entity which should be released
Returns:
true if the Entity with the Id was found in the associatedEntities-list, false otherwise

Entity * User::getAssociatedEntity ( unsigned int  entityId  ) 

The method returns the Entity with the passed entityId if it is found in the associatedEntity-list. The passed Id has to be equal to the typeBasedId of the Entity.

Parameters:
entityId typeBasedId of the searched Entity
Returns:
the Entity with the passed Id if found in the associatedEntities-list, NULL otherwise

Entity * User::getAssociatedEntityByIndex ( unsigned  index  ) 

The method returns the Entity at a certain position in the associatedEntity -list.

Parameters:
index the position of the Entity to be returned
Returns:
the Entity with the passed Id if found in the associatedEntities-list, NULL otherwise

TransformationData User::getAssociatedEntityOffset ( unsigned int  entityId  ) 

The method returns the picking-offset of the Entity with the passed Id if it is in the associatedEntities-list. The passed Id has to be the typeBasedId of the Entity

Parameters:
entityId typeBasedId of the Entity
Returns:
picking offset of the picked Entity if found, identityTransformation if not found

AvatarInterface * User::getAvatar (  ) 

The method returns a pointer to the User's avatar

Returns:
pointer to the User's avatar

std::string User::getAvatarConfigFile (  ) 

The method returns the URL of the configuration-file of the Avatar

Returns:
URL of the configuration-file of the Avatar

CameraTransformation * User::getCamera (  ) 

The method returns the CameraTransformation-object which stores the transformation of the User's camera

Returns:
CameraTransformation of the User's camera

CursorRepresentationInterface * User::getCursor (  ) 

The method returns the used CursorRepresentation

Returns:
CursorRepresentation which is used

TransformationData User::getCursorTransformation (  ) 

The method returns the transformation of the User's cursor in world coordinates. The transformation is calculated from the CursorTransformationModel.

Returns:
transformation of the User's cursor in world coordinates

CursorTransformationModel * User::getCursorTransformationModel (  ) 

The method returns the used CursorTransformationModel

Returns:
the used CursorTransformationModel

ArgumentVector * User::getCursorTransformationModelArguments (  ) 

The method returns the arguments which are used for the used CursorTransformationModel

Returns:
a list of model-specific arguments

unsigned User::getId (  ) 

The method returns the Id of the User

Returns:
Id of the User

std::string User::getName (  ) 

The method returns the name of the User

Returns:
name of the User

TransformationData User::getNavigatedTransformation (  ) 

Returns the scale factor from physical units to world units The method returns the navigated transformation of the User in world coordinates.

Returns:
navigated transformation of the User in world coordinates

NetworkIdentification User::getNetworkId (  ) 

The method returns the NetworkIdentification of the user

Returns:
The netID

unsigned User::getNumberOfAssociatedEntities (  ) 

The method returns the ammount of Entities currently associated with the user.

Returns:
the amount of Entities

TransformationData User::getTrackedHandTransformation (  ) 

The method returns the hand transformation relative to the navigatedTransformation. If you use a tracking system this transformation is equal to the data of your wand sensor converted into world coordinates (by multiplication with physicalToWorldScale).

Returns:
hand transformation of the User relative to the navigatedTransformation

TransformationData User::getTrackedHeadTransformation (  ) 

The method returns the head transformation relative to the navigatedTransformation. If you use a tracking system this transformation is equal to the data of your head sensor converted into world coordinates (by multiplication with physicalToWorldScale).

Returns:
head transformation of the User relative to the navigatedTransformation

TransformationData User::getTrackedSensorTransformation ( unsigned short  index  ) 

The method returns the transformation of the sensor with the passed index relative to the center point of your tracking system in world coordinates (= scaled by physicalToWorldScale).

Parameters:
index index of the requested sensor
Returns:
transformation of the sensor relative to the tracking system center

TransformationData User::getTrackedUserTransformation (  ) 

The method returns the transformation of the user relative to the center point of your tracking system in world coordinates (= scaled by physicalToWorldScale). This value is calculated by the UserTransformationModel.

Returns:
transformation of the user relative to the tracking system center

TransformationData User::getUserHandTransformation (  ) 

The method returns the transformation of the user's hand relative to the user's transformation. The user's transformation is therefore calculated by the UserTransformationModel.

Returns:
hand transformation relative to the user transformation

TransformationData User::getUserHeadTransformation (  ) 

The method returns the transformation of the user's head relative to the user's transformation. The user's transformation is therefore calculated by the UserTransformationModel.

Returns:
head transformation relative to the user transformation

TransformationData User::getUserSensorTransformation ( unsigned short  index  ) 

The method returns the transformation of the sensor with the passed index relative to the user's transformation. The user's transformation is therefore calculated by the UserTransformationModel.

Parameters:
index index of the requested sensor
Returns:
sensor transformation relative to the user transformation

UserTransformationModel * User::getUserTransformationModel (  ) 

The method returns the used UserTransformationModel

Returns:
the used UserTransformationModel

ArgumentVector * User::getUserTransformationModelArguments (  ) 

The method returns the arguments which are used for the used UserTransformationModel

Returns:
a list of model-specific arguments

TransformationData User::getWorldHandTransformation (  ) 

The method returns the transformation of the User's hand in world coordinates. (navigated * tracked hand transformation)

Returns:
transformation of the User's hand in world coordinates

TransformationData User::getWorldHeadTransformation (  ) 

The method returns the transformation of the User's head in world coordinates. (navigated * tracked head transformation)

Returns:
transformation of the User's head in world coordinates

TransformationData User::getWorldSensorTransformation ( unsigned short  index  ) 

The method returns the transformation of the user's sensor with the passed index in world coordinates. (navigated * tracked sensor transformation)

Parameters:
index index of the requested sensor
Returns:
transformation of the sensor in world coordinates

TransformationData User::getWorldUserTransformation (  ) 

The method returns the transformation of the User in world coordinates (navigated * tracked user transformation). The needed tracked user transformation is therefore calculated by the UserTransformationModel, even if no tracking sensor is measuring the user's transformation. This transformation is usually used to display the user's avatar.

Returns:
the User's transformation in world coordinates

bool User::isMoving (  ) 

The method returns wether the User is moving or not

Returns:
true if the user if moving currently, false otherwise

bool User::loadConfig ( std::string  userCfgFilePath  ) 

The method loads the configuration of the User object from the passed config file. It parses the URL of the config-files for each module and calls the loadConfig-method of these modules to initialize them. It also parses the URL of the avatar config file and calls the WorldDatabase::loadAvatar-method and reads the name of the used CursorTransformationModel and calls the setCursorTransformationModel-method.

Parameters:
configFile URL of the User-config file
Returns:
true if the config-file parsing was successfull, false otherwise

bool User::loadCursorTransformationModelConfig ( std::string  configFile,
User user 
) [static, private]

bool User::loadUserTransformationModelConfig ( std::string  configFile,
User user 
) [static, private]

void User::pickUpEntity ( Entity entity,
TransformationData  offset 
)

The method adds the passed Entity with the passed picking-offset to the list of associated Entities.

Parameters:
entity Entity that should be associated to the User
offset offset of the picking point to the center of the Entity

void User::registerCursorTransformationModelFactory ( CursorTransformationModelFactory factory  )  [static]

The method registers a CursorTransformationModelFactory to create the CursorTransformationModel configured in the User config-file

Parameters:
factory CursorTransformationModelFactory for the desired CursorTransformationModel

void User::registerUserTransformationModelFactory ( UserTransformationModelFactory factory  )  [static]

The method registers a UserTransformationModelFactory to create the UserTransformationModel configured in the User config-file.

Parameters:
factory UserTransformationModelFactory for the desired UserTransformationModel

void User::setCursorTransformation ( TransformationData trans  ) 

The method sets the transformation of the User's cursor in world-coordinates.

Parameters:
trans transformation of the User's cursor in world coordinates

void User::setCursorTransformationModel ( std::string  modelName,
ArgumentVector arguments 
)

The method creates the CursorTransformationModel with the passed name. It therefore iterates over every registered CursorTransformationModelFactory and calls their create-method which returns NULL if it cannot create the Model or the new Model if the factory matches to the Model. If there is already a CursorTransformationModel created then this one will be deleted and replaced by the new one. If the new Model could not be created an Error-message is printed.

Parameters:
modelName name of the desired CursorTransformationModel

void User::setHandTransformation ( TransformationData  hand  ) 

The method sets the transformation of the User's hand relative to the navigatedTransformation of the User. If an avatar is registered then the method also calls the setHandTransformation-method of the Avatar with the return-value of the getUserHandTransformation-method as parameter.

Parameters:
hand transformation of the User's hand relative to the User's position

void User::setHeadTransformation ( TransformationData  head  ) 

The method sets the transformation of the User's head relative to the navigatedTransformation of the User. If you have a tracking system then this transformation is equal to the value of the head-sensor.

Parameters:
head transformation of the User's head relative to the navigatedTransformation of the User

void User::setMoving ( bool  moving  ) 

Sets the scale factor from physical units to world units The method sets if the User is currently moving or not

Parameters:
moving true if the User is currently moving, false otherwise

void User::setNavigatedTransformation ( TransformationData  navigated  ) 

The method sets the navigated transformation of the User in world coordinates. This transformation can be used to setthe camera if a tracking system is used.

Parameters:
navigatedTrans navigated transformation of the user

void User::setNetworkId ( NetworkIdentification netId  ) 

void User::setSensorTransformation ( unsigned short  sensorIndex,
TransformationData  transformation 
)

The method sets the transformation of the user's sensor with the passed index. By default index 0 corresponds to the Head-sensor and index 1 to the Hand-sensor.

Parameters:
sensorIndex index of the passed sensor
transformation transformation value of the sensor

void User::setUserTransformationModel ( std::string  modelName,
ArgumentVector arguments 
)

The method creates the UserTransformationModel with the passed name. It therefore iterates over every registered UserTransformationModelFactory and calls their create-method which returns NULL if it cannot create the Model or the new Model if the factory matches to the Model. If there is already a UserTransformationModel created then this one will be deleted and replaced by the new one. If the new Model could not be created an Error-message is printed.

Parameters:
modelName name of the desired UserTransformationModel

void User::updateCursor ( float  dt  )  [protected]

void User::updateUserTransformation (  )  [protected]

The method updates the user-transformation which is the transformation of the user relative to the center point of the tracking system.


Friends And Related Function Documentation

friend class UserDatabase [friend]


Member Data Documentation

std::vector<AssociatedEntity*> User::associatedEntities [protected]

std::string User::avatarConfigFile [protected]

std::string User::cursorRepresentationConfigFile [protected]

unsigned User::id [protected]

bool User::moving [protected]

std::string User::name [protected]


The documentation for this class was generated from the following files:
  • src/inVRs/SystemCore/UserDatabase/User.h
  • src/inVRs/SystemCore/UserDatabase/User.cpp

Generated on Wed Oct 20 16:12:02 2010 for inVRs by doxygen 1.5.8