SHAPER  9.12.0
SketchSolver_ConstraintMovement Class Reference

Stores data to the Fixed constraint for the moved feature only. More...

Inheritance diagram for SketchSolver_ConstraintMovement:
Inheritance graph

Public Member Functions

 SketchSolver_ConstraintMovement (FeaturePtr theFeature)
 Creates movement constraint based on feature. More...
 
 SketchSolver_ConstraintMovement (AttributePtr theMovedAttribute, const int thePointIndex=-1)
 Creates movement constraint based on point. More...
 
void startPoint (const std::shared_ptr< GeomAPI_Pnt2d > &theStartPoint)
 Set coordinates of the start point of the movement. More...
 
void moveTo (const std::shared_ptr< GeomAPI_Pnt2d > &theDestinationPoint)
 Set coordinates of fixed feature to the values where it has been dragged. More...
 
virtual void blockEvents (bool isBlocked)
 Block or unblock events from this constraint. More...
 
FeaturePtr movedFeature () const
 Returns moved feature. More...
 
void process (StoragePtr theStorage, bool theEvensBlocked)
 Initializes parameters and start constraint creation. More...
 
virtual void notify (const FeaturePtr &theFeature, PlaneGCSSolver_Update *theUpdater)
 Notify this object about the feature is changed somewhere. More...
 
virtual void update ()
 Update constraint. More...
 
virtual bool remove ()
 Tries to remove constraint. More...
 
virtual SketchSolver_ConstraintType getType () const
 Returns the type of constraint. More...
 
const std::string & error () const
 Shows error message. More...
 

Static Public Member Functions

static SketchSolver_ConstraintType TYPE (ConstraintPtr theConstraint)
 Obtain a type of SketchPlugin constraint. More...
 

Protected Member Functions

virtual void process ()
 Converts SketchPlugin constraint to a list of SolveSpace constraints. More...
 
ConstraintWrapperPtr initMovement ()
 Create Fixed constraint for the feature basing on its type and moved point. More...
 
ConstraintWrapperPtr fixArcExtremity (const EntityWrapperPtr &theArcExtremity)
 Create constraint to fix moved arc extremity. More...
 
ConstraintWrapperPtr fixPointOnCircle (const EntityWrapperPtr &theCircular)
 Create constraint to fix moved point on circle/arc. More...
 
ConstraintWrapperPtr fixPointOnEllipse (const EntityWrapperPtr &theConic)
 Create constraint to fix moved point on ellipse/elliptic arc. More...
 
virtual void getAttributes (EntityWrapperPtr &, std::vector< EntityWrapperPtr > &)
 Generate list of attributes of constraint in order useful for constraints. More...
 
EntityWrapperPtr entityToFix ()
 Obtain entity to be fixed. More...
 
ConstraintWrapperPtr fixFeature (EntityWrapperPtr theFeature)
 Create Fixed constraint for the feature basing on its type. More...
 
virtual void adjustConstraint ()
 This method is used in derived objects to check consistency of constraint. More...
 
void cleanErrorMsg ()
 Removes last error. More...
 

Protected Attributes

std::vector< double > myFixedValues
 
ConstraintPtr myBaseConstraint
 base SketchPlugin constraint More...
 
ConstraintWrapperPtr mySolverConstraint
 wrapper for PlaneGCS constraint More...
 
StoragePtr myStorage
 storage, which contains all information about entities and constraints More...
 
SketchSolver_ConstraintType myType
 type of constraint More...
 
std::list< EntityWrapperPtr > myAttributes
 attributes of constraint More...
 
std::string myErrorMsg
 error message More...
 

Detailed Description

Stores data to the Fixed constraint for the moved feature only.

Constructor & Destructor Documentation

◆ SketchSolver_ConstraintMovement() [1/2]

SketchSolver_ConstraintMovement::SketchSolver_ConstraintMovement ( FeaturePtr  theFeature)

Creates movement constraint based on feature.

◆ SketchSolver_ConstraintMovement() [2/2]

SketchSolver_ConstraintMovement::SketchSolver_ConstraintMovement ( AttributePtr  theMovedAttribute,
const int  thePointIndex = -1 
)

Creates movement constraint based on point.

Member Function Documentation

◆ startPoint()

void SketchSolver_ConstraintMovement::startPoint ( const std::shared_ptr< GeomAPI_Pnt2d > &  theStartPoint)

Set coordinates of the start point of the movement.

◆ moveTo()

void SketchSolver_ConstraintMovement::moveTo ( const std::shared_ptr< GeomAPI_Pnt2d > &  theDestinationPoint)

Set coordinates of fixed feature to the values where it has been dragged.

Useful when the feature is being moved.

◆ blockEvents()

void SketchSolver_ConstraintMovement::blockEvents ( bool  isBlocked)
virtual

Block or unblock events from this constraint.

Reimplemented from SketchSolver_ConstraintFixed.

◆ movedFeature()

FeaturePtr SketchSolver_ConstraintMovement::movedFeature ( ) const
inline

Returns moved feature.

◆ process() [1/2]

void SketchSolver_ConstraintMovement::process ( )
protectedvirtual

Converts SketchPlugin constraint to a list of SolveSpace constraints.

Reimplemented from SketchSolver_ConstraintFixed.

◆ initMovement()

ConstraintWrapperPtr SketchSolver_ConstraintMovement::initMovement ( )
protected

Create Fixed constraint for the feature basing on its type and moved point.

Returns
Fixed constraint

◆ fixArcExtremity()

ConstraintWrapperPtr SketchSolver_ConstraintMovement::fixArcExtremity ( const EntityWrapperPtr &  theArcExtremity)
protected

Create constraint to fix moved arc extremity.

◆ fixPointOnCircle()

ConstraintWrapperPtr SketchSolver_ConstraintMovement::fixPointOnCircle ( const EntityWrapperPtr &  theCircular)
protected

Create constraint to fix moved point on circle/arc.

◆ fixPointOnEllipse()

ConstraintWrapperPtr SketchSolver_ConstraintMovement::fixPointOnEllipse ( const EntityWrapperPtr &  theConic)
protected

Create constraint to fix moved point on ellipse/elliptic arc.

◆ process() [2/2]

void SketchSolver_Constraint::process ( StoragePtr  theStorage,
bool  theEvensBlocked 
)
inherited

Initializes parameters and start constraint creation.

Parameters
theStorage[in] storage where to place new constraint
theEventsBlocked[in] all events from this constraint should be blocked

◆ getAttributes()

virtual void SketchSolver_ConstraintFixed::getAttributes ( EntityWrapperPtr &  ,
std::vector< EntityWrapperPtr > &   
)
inlineprotectedvirtualinherited

Generate list of attributes of constraint in order useful for constraints.

Parameters
[out]theValuenumerical characteristic of constraint (e.g. distance)
[out]theAttributeslist of attributes to be filled

Reimplemented from SketchSolver_Constraint.

◆ entityToFix()

EntityWrapperPtr SketchSolver_ConstraintFixed::entityToFix ( )
protectedinherited

Obtain entity to be fixed.

◆ fixFeature()

ConstraintWrapperPtr SketchSolver_ConstraintFixed::fixFeature ( EntityWrapperPtr  theFeature)
protectedinherited

Create Fixed constraint for the feature basing on its type.

Parameters
theFeature[in] feature, converted to solver specific format
Returns
Fixed constraint

◆ notify()

virtual void SketchSolver_Constraint::notify ( const FeaturePtr &  theFeature,
PlaneGCSSolver_Update theUpdater 
)
inlinevirtualinherited

◆ update()

void SketchSolver_Constraint::update ( )
virtualinherited

◆ remove()

bool SketchSolver_Constraint::remove ( )
virtualinherited

Tries to remove constraint.

Returns
false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)

Reimplemented in SketchSolver_ConstraintTangent, SketchSolver_ConstraintMulti, SketchSolver_ConstraintMiddle, SketchSolver_ConstraintEqual, SketchSolver_ConstraintDistance, and SketchSolver_ConstraintCoincidence.

◆ TYPE()

SketchSolver_ConstraintType SketchSolver_Constraint::TYPE ( ConstraintPtr  theConstraint)
staticinherited

Obtain a type of SketchPlugin constraint.

◆ getType()

virtual SketchSolver_ConstraintType SketchSolver_Constraint::getType ( ) const
inlinevirtualinherited

Returns the type of constraint.

◆ error()

const std::string& SketchSolver_Constraint::error ( ) const
inlineinherited

Shows error message.

◆ adjustConstraint()

virtual void SketchSolver_Constraint::adjustConstraint ( )
inlineprotectedvirtualinherited

◆ cleanErrorMsg()

void SketchSolver_Constraint::cleanErrorMsg ( )
inlineprotectedinherited

Removes last error.

Field Documentation

◆ myBaseConstraint

ConstraintPtr SketchSolver_Constraint::myBaseConstraint
protectedinherited

base SketchPlugin constraint

◆ mySolverConstraint

ConstraintWrapperPtr SketchSolver_Constraint::mySolverConstraint
protectedinherited

wrapper for PlaneGCS constraint

◆ myStorage

StoragePtr SketchSolver_Constraint::myStorage
protectedinherited

storage, which contains all information about entities and constraints

◆ myType

SketchSolver_ConstraintType SketchSolver_Constraint::myType
protectedinherited

type of constraint

◆ myAttributes

std::list<EntityWrapperPtr> SketchSolver_Constraint::myAttributes
protectedinherited

attributes of constraint

◆ myErrorMsg

std::string SketchSolver_Constraint::myErrorMsg
protectedinherited

error message