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

#include <Cable.h>

Inheritance diagram for AP_CableEditor::Cable:
vrecko::Ability vrecko::BaseClass

Public Member Functions

 Cable ()
 
virtual ~Cable ()
 
virtual void preInitialize ()
 OBSOLETE METHOD, kept for backwards compatibility. More...
 
virtual void postInitialize ()
 OBSOLETE METHOD, kept for backwards compatibility. More...
 
void setCableID (string ID)
 
string getCableID ()
 
void setShape (osg::ref_ptr< osg::Vec3Array > points)
 
osg::ref_ptr< osg::Vec3Array > getShape ()
 
void setInterpolation (unsigned int type, unsigned int num)
 
void getInterpolation (unsigned int *type, unsigned int *num)
 
void setRadius (float radius)
 
float getRadius ()
 
void setControlSpheresRadiusAdjust (float radius)
 
float getControlSpheresRadiusAdjust ()
 
void updateControlSpheresRadius ()
 
void setCableColor (osg::Vec4f color)
 
osg::Vec4f getCableColor ()
 
void setControlSpheresColor (osg::Vec4f color)
 
osg::Vec4f ControlSpheresColor ()
 
void setShapeRotate (float angle)
 
float getShapeRotate ()
 
void setEoWrapper (EnvironmentObject *wrapper)
 
EnvironmentObjectgetEoWrapper ()
 
osg::Node * getCableWrapperNode ()
 
void setControlPoints (osg::ref_ptr< osg::Vec3Array > points)
 
osg::ref_ptr< osg::Vec3Array > getControlPoints ()
 
osg::ref_ptr< osg::Vec3Array > getIntepolatedPoints ()
 
void addControlPoint (osg::Vec3f position)
 
void addControlPoint (unsigned int position, osg::Vec3f point)
 
void addControlPointBetweenLine (osg::Vec3f position)
 
osg::Vec3f getInterpolatedPoint (osg::Vec3 p0, osg::Vec3 p1, osg::Vec3 p2, osg::Vec3 p3, double t=0.5) const
 
EnvironmentObjectcreateSphere (osg::Vec3f center, float radius=0.25)
 
EnvironmentObjectcreateSphere (osg::Vec3f center, osg::Vec4f color, float radius=0.25)
 
void interpolate ()
 
osg::ref_ptr< osg::Vec3Array > interpolateCatPerSegment (osg::ref_ptr< osg::Vec3Array > inputPoints, unsigned int pointsPerSegment) const
 
osg::ref_ptr< osg::Vec3Array > interpolateCatIterate (osg::ref_ptr< osg::Vec3Array > inputPoints, unsigned int numIterations) const
 
void wrapCable ()
 
void setUpdate (bool state)
 
bool getUpdate ()
 
virtual void update ()
 This method is called periodically in case this instance is registered in Scheduler. More...
 
int computeRMF (osg::Vec3Array *points, osg::Vec3Array *tangents, osg::Vec3Array *normals, osg::Vec3Array *binormals)
 
osg::Vec3Array * transformVectors (osg::Vec3Array *vectors, osg::Vec3f point, osg::Vec3f tangent, osg::Vec3f normal, osg::Vec3f binormal, float scale=1)
 
osg::ref_ptr< osg::Geode > wrap (osg::Vec3Array *shapeVectors, osg::Vec3Array *points, osg::Vec3Array *tangents, osg::Vec3Array *normals, osg::Vec3Array *binormals, float scale=1, unsigned int wrapFrom=1, unsigned int wrapNum=0)
 
void visualizeVectors (osg::Vec3Array *points, osg::Vec3Array *tangents, osg::Vec3Array *normals, osg::Vec3Array *binormals)
 
- 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 (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...
 

Protected Member Functions

void updateSpheresPosition ()
 
virtual int processNotification (BaseClass *sender, unsigned long notificationType, void *notificationData)
 Process an incoming notification. More...
 
void createSpheres ()
 
void clearSpheres ()
 
void updateControlPoints ()
 
- 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)
 
IOPinBasefindPinInList (const char *strName, PinList *pinList)
 Internal method to find a given pin in a given list. More...
 

Protected Attributes

bool controlPointsChange
 
bool isUpdateState
 
float cableRadius
 
float controlSpheresRadiusAdjust
 
float basePlaneRotation
 
osg::Vec4f cableColor
 
osg::Vec4f controlSpheresColor
 
osg::ref_ptr< osg::Vec3Array > controlPoints
 
osg::ref_ptr< osg::Vec3Array > thisTangents
 
osg::ref_ptr< osg::Vec3Array > thisNormals
 
osg::ref_ptr< osg::Vec3Array > thisBinormals
 
osg::ref_ptr< osg::Vec3Array > interpolatedPoints
 
osg::ref_ptr< osg::Vec3Array > shapePoints
 
std::vector
< vrecko::EnvironmentObject * > * 
controlSpheres
 
EnvironmentObjectcableControlLine
 
EnvironmentObjectthisEoWrapper
 
osg::ref_ptr
< osg::MatrixTransform > 
lastWrapperTransformation
 
osg::ref_ptr< osg::Geode > wrapperGeode
 
unsigned int interpolationsNum
 
unsigned int interpolationType
 
string cableID
 
EnvironmentObjectcontrolVectors
 
- 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
 

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

AP_CableEditor::Cable::Cable ( )
AP_CableEditor::Cable::~Cable ( )
virtual

Member Function Documentation

void AP_CableEditor::Cable::addControlPoint ( osg::Vec3f  position)
inline
void AP_CableEditor::Cable::addControlPoint ( unsigned int  position,
osg::Vec3f  point 
)
void AP_CableEditor::Cable::addControlPointBetweenLine ( osg::Vec3f  position)
void AP_CableEditor::Cable::clearSpheres ( )
protected
int AP_CableEditor::Cable::computeRMF ( osg::Vec3Array *  points,
osg::Vec3Array *  tangents,
osg::Vec3Array *  normals,
osg::Vec3Array *  binormals 
)
osg::Vec4f AP_CableEditor::Cable::ControlSpheresColor ( )
inline
EnvironmentObject* AP_CableEditor::Cable::createSphere ( osg::Vec3f  center,
float  radius = 0.25 
)
inline
EnvironmentObject * AP_CableEditor::Cable::createSphere ( osg::Vec3f  center,
osg::Vec4f  color,
float  radius = 0.25 
)
void AP_CableEditor::Cable::createSpheres ( )
protected
osg::Vec4f AP_CableEditor::Cable::getCableColor ( )
inline
string AP_CableEditor::Cable::getCableID ( )
inline
osg::Node* AP_CableEditor::Cable::getCableWrapperNode ( )
inline
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::getControlPoints ( )
inline
float AP_CableEditor::Cable::getControlSpheresRadiusAdjust ( )
inline
EnvironmentObject* AP_CableEditor::Cable::getEoWrapper ( )
inline
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::getIntepolatedPoints ( )
inline
osg::Vec3f AP_CableEditor::Cable::getInterpolatedPoint ( osg::Vec3  p0,
osg::Vec3  p1,
osg::Vec3  p2,
osg::Vec3  p3,
double  t = 0.5 
) const
void AP_CableEditor::Cable::getInterpolation ( unsigned int *  type,
unsigned int *  num 
)
inline
float AP_CableEditor::Cable::getRadius ( )
inline
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::getShape ( )
inline
float AP_CableEditor::Cable::getShapeRotate ( )
inline
bool AP_CableEditor::Cable::getUpdate ( )
inline
void AP_CableEditor::Cable::interpolate ( )
osg::ref_ptr< osg::Vec3Array > AP_CableEditor::Cable::interpolateCatIterate ( osg::ref_ptr< osg::Vec3Array >  inputPoints,
unsigned int  numIterations 
) const
osg::ref_ptr< osg::Vec3Array > AP_CableEditor::Cable::interpolateCatPerSegment ( osg::ref_ptr< osg::Vec3Array >  inputPoints,
unsigned int  pointsPerSegment 
) const
void AP_CableEditor::Cable::postInitialize ( void  )
virtual

OBSOLETE METHOD, kept for backwards compatibility.

The preInitialize(), loadXMLParameters() and postInitialize() methods were replaced in 2011 by a single method initialize().

Reimplemented from vrecko::BaseClass.

void AP_CableEditor::Cable::preInitialize ( void  )
virtual

OBSOLETE METHOD, kept for backwards compatibility.

The preInitialize(), loadXMLParameters() and postInitialize() methods were replaced in 2011 by a single method initialize().

Reimplemented from vrecko::BaseClass.

int AP_CableEditor::Cable::processNotification ( BaseClass sender,
unsigned long  notificationType,
void *  notificationData 
)
protectedvirtual

Process an incoming notification.

Override this method to react to a registered notification (see addNotification() method).

Parameters
sender(BaseClass *) The sender of the notification
notificationType(unsigned long) Type of the notification, only ONE bit will be set
notificationData(void *) Appropriate notification data, dependent on the notificationType.
Returns
(int) Should return 0, other values are reserved for future use.

Reimplemented from vrecko::BaseClass.

void AP_CableEditor::Cable::setCableColor ( osg::Vec4f  color)
inline
void AP_CableEditor::Cable::setCableID ( string  ID)
inline
void AP_CableEditor::Cable::setControlPoints ( osg::ref_ptr< osg::Vec3Array >  points)
inline
void AP_CableEditor::Cable::setControlSpheresColor ( osg::Vec4f  color)
inline
void AP_CableEditor::Cable::setControlSpheresRadiusAdjust ( float  radius)
inline
void AP_CableEditor::Cable::setEoWrapper ( EnvironmentObject wrapper)
inline
void AP_CableEditor::Cable::setInterpolation ( unsigned int  type,
unsigned int  num 
)
inline
void AP_CableEditor::Cable::setRadius ( float  radius)
inline
void AP_CableEditor::Cable::setShape ( osg::ref_ptr< osg::Vec3Array >  points)
inline
void AP_CableEditor::Cable::setShapeRotate ( float  angle)
inline
void AP_CableEditor::Cable::setUpdate ( bool  state)
osg::Vec3Array * AP_CableEditor::Cable::transformVectors ( osg::Vec3Array *  vectors,
osg::Vec3f  point,
osg::Vec3f  tangent,
osg::Vec3f  normal,
osg::Vec3f  binormal,
float  scale = 1 
)
void AP_CableEditor::Cable::update ( void  )
virtual

This method is called periodically in case this instance is registered in Scheduler.

The method is called periodically at specified frequency or every frame. Use the Scheduler::addEntity() method to register your class and set the frequency.

Reimplemented from vrecko::BaseClass.

void AP_CableEditor::Cable::updateControlPoints ( )
protected
void AP_CableEditor::Cable::updateControlSpheresRadius ( )
void AP_CableEditor::Cable::updateSpheresPosition ( )
protected
void AP_CableEditor::Cable::visualizeVectors ( osg::Vec3Array *  points,
osg::Vec3Array *  tangents,
osg::Vec3Array *  normals,
osg::Vec3Array *  binormals 
)
osg::ref_ptr< osg::Geode > AP_CableEditor::Cable::wrap ( osg::Vec3Array *  shapeVectors,
osg::Vec3Array *  points,
osg::Vec3Array *  tangents,
osg::Vec3Array *  normals,
osg::Vec3Array *  binormals,
float  scale = 1,
unsigned int  wrapFrom = 1,
unsigned int  wrapNum = 0 
)
void AP_CableEditor::Cable::wrapCable ( )

Member Data Documentation

float AP_CableEditor::Cable::basePlaneRotation
protected
osg::Vec4f AP_CableEditor::Cable::cableColor
protected
EnvironmentObject* AP_CableEditor::Cable::cableControlLine
protected
string AP_CableEditor::Cable::cableID
protected
float AP_CableEditor::Cable::cableRadius
protected
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::controlPoints
protected
bool AP_CableEditor::Cable::controlPointsChange
protected
std::vector<vrecko::EnvironmentObject *>* AP_CableEditor::Cable::controlSpheres
protected
osg::Vec4f AP_CableEditor::Cable::controlSpheresColor
protected
float AP_CableEditor::Cable::controlSpheresRadiusAdjust
protected
EnvironmentObject* AP_CableEditor::Cable::controlVectors
protected
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::interpolatedPoints
protected
unsigned int AP_CableEditor::Cable::interpolationsNum
protected
unsigned int AP_CableEditor::Cable::interpolationType
protected
bool AP_CableEditor::Cable::isUpdateState
protected
osg::ref_ptr<osg::MatrixTransform> AP_CableEditor::Cable::lastWrapperTransformation
protected
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::shapePoints
protected
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::thisBinormals
protected
EnvironmentObject* AP_CableEditor::Cable::thisEoWrapper
protected
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::thisNormals
protected
osg::ref_ptr<osg::Vec3Array> AP_CableEditor::Cable::thisTangents
protected
osg::ref_ptr<osg::Geode> AP_CableEditor::Cable::wrapperGeode
protected

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