SHAPER  9.12.0
SketchSolver_Constraint Class Reference

Converts SketchPlugin constraint to the constraint applicable for solver. More...

Inheritance diagram for SketchSolver_Constraint:
Inheritance graph

Public Member Functions

 SketchSolver_Constraint (ConstraintPtr theConstraint)
 Constructor based on SketchPlugin constraint. 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 void blockEvents (bool isBlocked)
 Block or unblock events from this 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

 SketchSolver_Constraint ()
 Default constructor. More...
virtual void process ()
 Converts SketchPlugin constraint to a list of solver's constraints. More...
virtual void getAttributes (EntityWrapperPtr &theValue, std::vector< EntityWrapperPtr > &theAttributes)
 Generate list of attributes of constraint in order useful for constraints. 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

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

Converts SketchPlugin constraint to the constraint applicable for solver.

Constructor & Destructor Documentation

◆ SketchSolver_Constraint() [1/2]

SketchSolver_Constraint::SketchSolver_Constraint ( )

Default constructor.

◆ SketchSolver_Constraint() [2/2]

SketchSolver_Constraint::SketchSolver_Constraint ( ConstraintPtr  theConstraint)

Constructor based on SketchPlugin constraint.

Member Function Documentation

◆ process() [1/2]

void SketchSolver_Constraint::process ( StoragePtr  theStorage,
bool  theEvensBlocked 

Initializes parameters and start constraint creation.

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

◆ notify()

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

◆ update()

void SketchSolver_Constraint::update ( )

◆ remove()

bool SketchSolver_Constraint::remove ( )

Tries to remove constraint.

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.

◆ blockEvents()

void SketchSolver_Constraint::blockEvents ( bool  isBlocked)

◆ TYPE()

SketchSolver_ConstraintType SketchSolver_Constraint::TYPE ( ConstraintPtr  theConstraint)

Obtain a type of SketchPlugin constraint.

◆ getType()

virtual SketchSolver_ConstraintType SketchSolver_Constraint::getType ( ) const

Returns the type of constraint.

◆ error()

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

Shows error message.

◆ process() [2/2]

◆ getAttributes()

void SketchSolver_Constraint::getAttributes ( EntityWrapperPtr &  theValue,
std::vector< EntityWrapperPtr > &  theAttributes 

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

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

Reimplemented in SketchSolver_ConstraintMiddle, SketchSolver_ConstraintLength, SketchSolver_ConstraintEqual, SketchSolver_ConstraintDistance, SketchSolver_ConstraintCoincidence, SketchSolver_ConstraintAngle, SketchSolver_ConstraintOffset, SketchSolver_ConstraintMulti, SketchSolver_ConstraintMirror, and SketchSolver_ConstraintFixed.

◆ adjustConstraint()

virtual void SketchSolver_Constraint::adjustConstraint ( )

◆ cleanErrorMsg()

void SketchSolver_Constraint::cleanErrorMsg ( )

Removes last error.

Field Documentation

◆ myBaseConstraint

ConstraintPtr SketchSolver_Constraint::myBaseConstraint

base SketchPlugin constraint

◆ mySolverConstraint

ConstraintWrapperPtr SketchSolver_Constraint::mySolverConstraint

wrapper for PlaneGCS constraint

◆ myStorage

StoragePtr SketchSolver_Constraint::myStorage

storage, which contains all information about entities and constraints

◆ myType

SketchSolver_ConstraintType SketchSolver_Constraint::myType

type of constraint

◆ myAttributes

std::list<EntityWrapperPtr> SketchSolver_Constraint::myAttributes

attributes of constraint

◆ myErrorMsg

std::string SketchSolver_Constraint::myErrorMsg

error message