version 3.3

VRS::ConstraintChecker Class Reference

#include <vrs/sg/constraintchecker.h>

Inheritance diagram for VRS::ConstraintChecker:

VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 ConstraintChecker (unsigned int maxIterations=10)
virtual ~ConstraintChecker ()
 Destructor.
virtual bool check (const Vector &oldPoint, const Vector &desiredPoint)
virtual VectorfindAlternative (const Vector &oldPoint, const Vector &desiredPoint)
virtual void prependConstraint (Constraint *newConstraint)
 Adds a constraint to the front of the constraint chain.
virtual void appendConstraint (Constraint *newConstraint)
 Adds a constraint to the end of the constraint chain.
virtual void insertConstraint (unsigned int pos, Constraint *newConstraint)
 Inserts a constraint to the constraint chain at the given position.
virtual void removeFirstConstraint ()
 Removes the first constraint from the constraint chain.
virtual void removeLastConstraint ()
 Removes the last constraint from the constraint chain.
virtual void removeConstraint (Constraint *constraint)
 Removes the specified constraint from the constraint chain.
virtual void moveConstraint (Constraint *constraint, unsigned int newPos)
 Moves the specified constraint to a new position in the constraint chain.
virtual void flushConstraints ()
 Removes all constraints from the constraint chain.
virtual bool contains (Constraint *constraint)
 Returns true, if the constraint checker constains the constraint.
virtual void setMaxIterations (unsigned int maxIterations)
 Sets the maximum number of iterations to validate alternatives.
virtual unsigned int getMaxIterations () const
 Returns the maximum number of iterations to validate alternatives.
virtual unsigned int getNoOfConstraints () const
 Returns the number of constraints in the constraint chain.
 VRS_TYPEINFO (ConstraintChecker, SharedObj)
 VRS_SERIALIZABLE (ConstraintChecker)


Detailed Description

Class for performing constraint checks. Therefore it manages a chain of constraints. To check whether a movement is valid, the first constraint in the chain is called. If all constraints agree to the movement, the movement is valid. If one constraint denies the movement, the ConstraintChecker can provide a valid alternative.

Constructor & Destructor Documentation

VRS::ConstraintChecker::ConstraintChecker ( unsigned int  maxIterations = 10  ) 

Constructs an 'empty' ConstraintChecker. For validating movements, constraints must be added. The parameter maxIterations defines the number of alternatives that are veryfied before the search for alternatives stops.

virtual VRS::ConstraintChecker::~ConstraintChecker (  )  [virtual]

Destructor.


Member Function Documentation

virtual bool VRS::ConstraintChecker::check ( const Vector oldPoint,
const Vector desiredPoint 
) [virtual]

Validates the movement from oldPoint to desiredPoint without searching for alternatives. Returns true, if all constraints in the constraint chain agree to the movement or false if one of the constraints refuses the movement.

virtual Vector* VRS::ConstraintChecker::findAlternative ( const Vector oldPoint,
const Vector desiredPoint 
) [virtual]

Validates the movement from oldPoint to desiredPoint and searches for alternative destination points. Each constraint checks the movement and computes an alternative, if possible. If a constraint refuses a movement, the next alternative is passed to the chain of constraints. The method returns the first point that was accepted by all constraints. This can be the original desired point or a valid alternative. If no valid movement can be found, the method returns NULL. In this case the maximum number of iterations has been reached or no more alternatives have been found.

virtual void VRS::ConstraintChecker::prependConstraint ( Constraint newConstraint  )  [virtual]

Adds a constraint to the front of the constraint chain.

virtual void VRS::ConstraintChecker::appendConstraint ( Constraint newConstraint  )  [virtual]

Adds a constraint to the end of the constraint chain.

virtual void VRS::ConstraintChecker::insertConstraint ( unsigned int  pos,
Constraint newConstraint 
) [virtual]

Inserts a constraint to the constraint chain at the given position.

virtual void VRS::ConstraintChecker::removeFirstConstraint (  )  [virtual]

Removes the first constraint from the constraint chain.

virtual void VRS::ConstraintChecker::removeLastConstraint (  )  [virtual]

Removes the last constraint from the constraint chain.

virtual void VRS::ConstraintChecker::removeConstraint ( Constraint constraint  )  [virtual]

Removes the specified constraint from the constraint chain.

virtual void VRS::ConstraintChecker::moveConstraint ( Constraint constraint,
unsigned int  newPos 
) [virtual]

Moves the specified constraint to a new position in the constraint chain.

virtual void VRS::ConstraintChecker::flushConstraints (  )  [virtual]

Removes all constraints from the constraint chain.

virtual bool VRS::ConstraintChecker::contains ( Constraint constraint  )  [virtual]

Returns true, if the constraint checker constains the constraint.

virtual void VRS::ConstraintChecker::setMaxIterations ( unsigned int  maxIterations  )  [virtual]

Sets the maximum number of iterations to validate alternatives.

virtual unsigned int VRS::ConstraintChecker::getMaxIterations (  )  const [virtual]

Returns the maximum number of iterations to validate alternatives.

virtual unsigned int VRS::ConstraintChecker::getNoOfConstraints (  )  const [virtual]

Returns the number of constraints in the constraint chain.

VRS::ConstraintChecker::VRS_TYPEINFO ( ConstraintChecker  ,
SharedObj   
)

VRS::ConstraintChecker::VRS_SERIALIZABLE ( ConstraintChecker   ) 


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

Generated on Mon May 20 06:00:33 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact