vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
APDYNAMICART::Attractor Class Referenceabstract

#include <Attractor.h>

Inheritance diagram for APDYNAMICART::Attractor:
APDYNAMICART::PoA vrecko::EnvironmentObject vrecko::BaseClass APDYNAMICART::JuliaAttractor APDYNAMICART::NullAttractor APDYNAMICART::OrdinaryAttractor

Public Member Functions

virtual std::string createMenuStructure (void) const
 
virtual int load (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *PoANode)
 Load configuration of PoA from .XML node. More...
 
virtual void GUIItemClicked (const char *itemID)
 Called when user click on some item of PoA context menu. More...
 
virtual void GUISliderChanged (const char *sliderID, float sliderPos)
 Called when user moves with slider on some item of menu. More...
 
virtual void pointed (bool pointed)
 Called when user point with cursor (hand) to this PoA. More...
 
virtual void setColor (osg::Vec4 newColour)
 
virtual void update ()
 Update of PoA - e.g. re-rendering. More...
 
void generate ()
 
virtual void init ()
 
virtual void compute ()=0
 
ParametersgetParameters ()
 
- Public Member Functions inherited from APDYNAMICART::PoA
 PoA (Controller *contr)
 
 ~PoA ()
 
virtual void createMenuStructure (osg::ref_ptr< vreckoUtils::MenuBase > parentMenu) const =0
 Creates structure of menu items for this PoA. More...
 
PoAUpdateType getUpdateFlag ()
 
virtual osg::Vec3 getLeftHandPosition () const
 Get actual position of left hand from DAEnvironment. More...
 
virtual osg::Quat getLeftHandOrientation () const
 Get actual orientation of left hand from DAEnvironment. More...
 
virtual osg::Vec3 getRightHandPosition () const
 Get actual position of right hand from DAEnvironment. More...
 
virtual osg::Quat getRightHandOrientation () const
 Get actual orientation of right hand from DAEnvironment. More...
 
virtual void save (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *Document, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *poaNode)=0
 Save current state of PoA to .XML node. More...
 
void setUpdateFlag (PoAUpdateType newType)
 Set type of updates, add (or remove) PoA to (from) scheduler. More...
 
 DECLARE_INPUT (Colour, MessageVec4)
 
- Public Member Functions inherited from vrecko::EnvironmentObject
 EnvironmentObject ()
 
 ~EnvironmentObject ()
 
 EnvironmentObject (EnvironmentObject &eo)
 
virtual bool initialize (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parameters=NULL)
 Core initialization. More...
 
void setID (unsigned long new_id)
 Set the ID of the object. More...
 
const unsigned long getID () const
 Returns the ID of the object. More...
 
void setName (const std::string &n)
 Sets the name of the object. More...
 
const std::string & getName (void) const
 Returns the name of the object. More...
 
bool loadGeometry (const char *filename, bool bOutputErrors=true)
 Loads geometry (usually a 3D model) from a file. More...
 
bool setGeometry (osg::Geode *new_geomtetry, long int k=1, long int l=100000)
 Adds a new geometry to the EO. More...
 
void setModelFileName (const std::string mfn)
 Sets the filename for the model. More...
 
const std::string & getModelFileName (void) const
 Returns the model filename. More...
 
bool addAbility (Ability *ability, bool bCreateNewIdIfColliding=true)
 Adds an ability to the EO. Use World::createAbility() instead. More...
 
bool removeAbility (Ability *pAbility)
 Remove ability from the EO, but DO NOT deallocate it. WARNING - Currently it is not sure if this method is safe to use. More...
 
bool removeAbility (const std::string &ability_id)
 Remove ability from the EO, but DO NOT deallocate it. WARNING - Currently it is not sure if this method is safe to use. More...
 
bool removeAllAbilities ()
 "Unregisters" and deallocates all abilities of an object. More...
 
AbilitygetAbility (const std::string &ab_id)
 Returns ability with a specified ID. More...
 
AbilitygetAbility (const std::string &pluginName, const std::string &abilityName)
 Returns ability of a given type. More...
 
AbilitygetAbilityWithInput (const std::string &input_name)
 Returns ability with a given input. More...
 
AbilitygetAbilityWithOutput (const std::string &output_name)
 Returns ability with a given output. More...
 
std::map< std::string, Ability * > & getAbilityMap (void)
 Returns map of the abilities in the EO. More...
 
osg::Matrix & getWorldTransformation (void)
 Returns the transformation matrix of the EO in world coordinate system. More...
 
osg::Vec3 getWorldPosition (void)
 Returns just the position (translation) in the world coordinates. More...
 
osg::Matrix getWorldRotation (void)
 Returns the rotation of the EO in world coordinates. More...
 
void setIdentityTransformation (void)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. Sets the identity transformation. More...
 
void setPosition (const osg::Vec3 &coords)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. Sets the position of the EO. More...
 
void setPosition (float x, float y, float z)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. More...
 
osg::Vec3 & getPosition ()
 BECOMING OBSOLETE - Please use the getMatrix() method instead. Returns the position of the EO. More...
 
void setRotation (float angle, float x, float y, float z)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. Set rotation of the EO. More...
 
void setRotation (const osg::Vec3 &angles)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. More...
 
void setRotation (const osg::Matrix &new_matrix)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. More...
 
void setRotation (const osg::Quat &quat)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. More...
 
osg::Matrix & getRotation (void)
 BECOMING OBSOLETE - Please use the getMatrix() method instead. Return the rotation matrix. More...
 
void setScale (const osg::Vec3 &new_scale)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. More...
 
void setScale (float x, float y, float z)
 BECOMING OBSOLETE - Please use the setMatrix() method instead. More...
 
osg::Vec3 & getScale (void)
 BECOMING OBSOLETE - Please use the getMatrix() method instead. More...
 
void setOSGAdapter (std::vector< esg::OSGAdapter * > new_osga)
 (OBSOLETE) Sets the vector of OSGAdapters. Currently not useful. More...
 
std::vector< esg::OSGAdapter * > * getOSGAdapter (void)
 (OBSOLETE) Returns the vector of OSGAdapters. Currently not useful. More...
 
EnvironmentObjectgetParentEO (void)
 Return the nearest parental EO from the scene hierarchy. More...
 
bool addEOChild (EnvironmentObject *new_EO)
 Add EnvironmentObject child. More...
 
bool removeEOChild (EnvironmentObject *new_EO)
 Removes and EO from the current object. More...
 
void addUserData (const std::string &nlabel, void *npointer, UserData_Type ntype)
 Adds an user data with a label. If old data with the same name exists, it will be dallocated. More...
 
bool removeUserData (const std::string &label)
 Removes an user data with the label. DOES NOT DEALLOCATE THE DATA. More...
 
UserDatagetUserData (const std::string &label)
 Returns an user data with given label. More...
 
std::map< std::string, UserData * > getUserDataMap (void)
 Returns an user data map. More...
 
void setTransparency (float transp)
 Sets the transparency in interval <0;1> More...
 
float getTransparency (void)
 Returns the current transparency. More...
 
void show ()
 Make the object visible after hiding it with hide(). More...
 
void hide ()
 Hides the object. More...
 
bool isVisible ()
 Returns true if the object is current visible (use hide() / show() methods to change the visibility). More...
 
bool isCollisionFree ()
 Returns true if the object has some geometry loaded. More...
 
void setCastShadows (bool cast)
 Set whether the objects should cast shadows or not. 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 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...
 
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 (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *)
 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...
 

Static Public Member Functions

static AttractorPtr createInstance (std::string attName, Controller *controller)
 
static AttractorNames getAvailableAttractors ()
 

Protected Member Functions

 Attractor (Controller *controller)
 
void setSliderParameter (const char *sliderID, float sliderPos)
 
bool valueChanged (float sliderPos)
 
IMenuComponentPtr createParameterSubMenu () const
 

Protected Attributes

Parameters _params
 
float _size
 
- Protected Attributes inherited from APDYNAMICART::PoA
DAEnvironment_daEnvironment
 Pointer to DA environment. More...
 
const Controller_controller
 Pointer to controller of this PoA. More...
 
PoAUpdateType _updateFlag
 What type of update this PoA actualy need. More...
 
- Protected Attributes inherited from vrecko::EnvironmentObject
unsigned long id
 Identification number. More...
 
std::string name
 Name of the EO. More...
 
std::string modelFileName
 Filename of the geometry. More...
 
AbilityDispatcher ability_dispatcher
 Internal AbilityDispatcher that serve to maintain abilities in EO. More...
 
osg::Matrix tempTransformMatrix
 
osg::Vec3 trans_vec
 Translation vector. More...
 
osg::Matrix rotation_matrix
 Rotation matrix. More...
 
osg::Vec3 scale_vec
 Scale vector. More...
 
float transparency
 Transparency of geometry. More...
 
bool bVisible
 
bool bCollisionFree
 
std::vector< esg::OSGAdapter * > osgadapter_vector
 Vector of the OSGAdapters. More...
 
std::map< std::string, UserData * > user_data
 User data map. 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
 

Additional Inherited Members

- Public Types inherited from vrecko::EnvironmentObject
enum  UserData_Type {
  UD_UNKNOWN = 0, UD_BOOL, UD_INT, UD_LONG_INT,
  UD_FLOAT, UD_DOUBLE, UD_STRING, UD_VEC2,
  UD_VEC3, UD_VEC4, UD_MATRIX, UD_QUAT,
  UD_POINTER, UD_USER
}
 Types of the UserData. 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

APDYNAMICART::Attractor::Attractor ( Controller controller)
inlineprotected

Constructors

Member Function Documentation

virtual void APDYNAMICART::Attractor::compute ( )
pure virtual
AttractorPtr APDYNAMICART::Attractor::createInstance ( std::string  attName,
Controller controller 
)
static

Static methods

virtual std::string APDYNAMICART::Attractor::createMenuStructure ( void  ) const
inlinevirtual

Inherited virtual methods

IMenuComponentPtr APDYNAMICART::Attractor::createParameterSubMenu ( ) const
protected
void APDYNAMICART::Attractor::generate ( )

Algorithm methods

AttractorNames APDYNAMICART::Attractor::getAvailableAttractors ( )
static
Parameters& APDYNAMICART::Attractor::getParameters ( )
inline

Helper methods

virtual void APDYNAMICART::Attractor::GUIItemClicked ( const char *  itemID)
inlinevirtual

Called when user click on some item of PoA context menu.

Parameters
itemIDcontains 'name' of menu item.

Implements APDYNAMICART::PoA.

Reimplemented in APDYNAMICART::OrdinaryAttractor, and APDYNAMICART::JuliaAttractor.

virtual void APDYNAMICART::Attractor::GUISliderChanged ( const char *  sliderID,
float  sliderPos 
)
inlinevirtual

Called when user moves with slider on some item of menu.

Parameters
sliderIDcontains 'name' of menu item
valuecontains current value of slider

Implements APDYNAMICART::PoA.

Reimplemented in APDYNAMICART::OrdinaryAttractor, and APDYNAMICART::JuliaAttractor.

virtual void APDYNAMICART::Attractor::init ( void  )
inlinevirtual
virtual int APDYNAMICART::Attractor::load ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  PoANode)
inlinevirtual

Load configuration of PoA from .XML node.

Parameters
PoANodepointer to node containing info about this PoA
Returns
error code.
  • 0 - OK
  • 1 - parameter node is missing
  • 2... other errors

Implements APDYNAMICART::PoA.

Reimplemented in APDYNAMICART::OrdinaryAttractor.

virtual void APDYNAMICART::Attractor::pointed ( bool  pointed)
inlinevirtual

Called when user point with cursor (hand) to this PoA.

Implements APDYNAMICART::PoA.

virtual void APDYNAMICART::Attractor::setColor ( osg::Vec4  newColour)
inlinevirtual
void APDYNAMICART::Attractor::setSliderParameter ( const char *  sliderID,
float  sliderPos 
)
protected

Helper methods

virtual void APDYNAMICART::Attractor::update ( )
inlinevirtual

Update of PoA - e.g. re-rendering.

Implements APDYNAMICART::PoA.

Reimplemented in APDYNAMICART::OrdinaryAttractor, and APDYNAMICART::JuliaAttractor.

bool APDYNAMICART::Attractor::valueChanged ( float  sliderPos)
protected

Member Data Documentation

Parameters APDYNAMICART::Attractor::_params
protected

Attributes

float APDYNAMICART::Attractor::_size
protected

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