SHAPER  9.15.0
SketchSolver_Group Class Reference

Keeps the group of constraints which placed in the same sketch. More...

Public Member Functions

 SketchSolver_Group (const CompositeFeaturePtr &theWorkplane)
 New group based on specified workplane. More...
 
bool isEmpty () const
 Returns true if the group has no constraints yet. More...
 
bool isWorkplaneValid () const
 Check for valid sketch data. More...
 
bool changeConstraint (std::shared_ptr< SketchPlugin_Constraint > theConstraint)
 Adds or updates a constraint in the group. More...
 
bool updateSketch (CompositeFeaturePtr theSketch)
 Updates the sketch feature. More...
 
bool updateFeature (FeaturePtr theFeature)
 Updates the data corresponding the specified feature. More...
 
bool moveFeature (FeaturePtr theFeature, const std::shared_ptr< GeomAPI_Pnt2d > &theFrom, const std::shared_ptr< GeomAPI_Pnt2d > &theTo)
 Updates the data corresponding the specified feature moved in GUI. More...
 
bool movePoint (AttributePtr thePointOrArray, const int thePointIndex, const std::shared_ptr< GeomAPI_Pnt2d > &theFrom, const std::shared_ptr< GeomAPI_Pnt2d > &theTo)
 Updates the data corresponding the specified point moved in GUI. More...
 
const CompositeFeaturePtr & getWorkplane () const
 Returns the current workplane. More...
 
void repairConsistency ()
 Searches invalid features and constraints in the group and removes them. More...
 
bool resolveConstraints ()
 Start solution procedure if necessary and update attributes of features. More...
 
void underconstrainedFeatures (std::set< ObjectPtr > &theFeatures) const
 Find the list of features, which are not fully constrained. More...
 
void blockEvents (bool isBlocked)
 Block or unblock events sent by features in this group. More...
 

Detailed Description

Keeps the group of constraints which placed in the same sketch.

Constructor & Destructor Documentation

◆ SketchSolver_Group()

SketchSolver_Group::SketchSolver_Group ( const CompositeFeaturePtr &  theWorkplane)

New group based on specified workplane.

Throws an exception if theWorkplane is not an object of SketchPlugin_Sketch type

Remarks
Type of theSketch is not verified inside

Member Function Documentation

◆ isEmpty()

bool SketchSolver_Group::isEmpty ( ) const
inline

Returns true if the group has no constraints yet.

◆ isWorkplaneValid()

bool SketchSolver_Group::isWorkplaneValid ( ) const
inline

Check for valid sketch data.

◆ changeConstraint()

bool SketchSolver_Group::changeConstraint ( std::shared_ptr< SketchPlugin_Constraint theConstraint)

Adds or updates a constraint in the group.

Parameters
[in]theConstraintconstraint to be changed
Returns
true if the constraint added or updated successfully

◆ updateSketch()

bool SketchSolver_Group::updateSketch ( CompositeFeaturePtr  theSketch)

Updates the sketch feature.

◆ updateFeature()

bool SketchSolver_Group::updateFeature ( FeaturePtr  theFeature)

Updates the data corresponding the specified feature.

Parameters
[in]theFeaturethe feature to be updated

◆ moveFeature()

bool SketchSolver_Group::moveFeature ( FeaturePtr  theFeature,
const std::shared_ptr< GeomAPI_Pnt2d > &  theFrom,
const std::shared_ptr< GeomAPI_Pnt2d > &  theTo 
)

Updates the data corresponding the specified feature moved in GUI.

Special kind of Fixed constraints is created.

Parameters
[in]theFeaturethe feature to be updated
[in]theFromstart point of the movement
[in]theTofinal point of the movement
Returns
true, if the feature is really moved

◆ movePoint()

bool SketchSolver_Group::movePoint ( AttributePtr  thePointOrArray,
const int  thePointIndex,
const std::shared_ptr< GeomAPI_Pnt2d > &  theFrom,
const std::shared_ptr< GeomAPI_Pnt2d > &  theTo 
)

Updates the data corresponding the specified point moved in GUI.

Special kind of Fixed constraints is created.

Parameters
[in]thePointOrArraythe attribute to be updated
[in]thePointIndexindex of moved point in array
[in]theFromstart point of the movement
[in]theTodestination point of the movement
Returns
true, if the attribute is really moved

◆ getWorkplane()

const CompositeFeaturePtr& SketchSolver_Group::getWorkplane ( ) const
inline

Returns the current workplane.

◆ repairConsistency()

void SketchSolver_Group::repairConsistency ( )

Searches invalid features and constraints in the group and removes them.

Returns
false if the group several constraints were removed

◆ resolveConstraints()

bool SketchSolver_Group::resolveConstraints ( )

Start solution procedure if necessary and update attributes of features.

Returns
false when no need to solve constraints

◆ underconstrainedFeatures()

void SketchSolver_Group::underconstrainedFeatures ( std::set< ObjectPtr > &  theFeatures) const

Find the list of features, which are not fully constrained.

◆ blockEvents()

void SketchSolver_Group::blockEvents ( bool  isBlocked)

Block or unblock events sent by features in this group.