SHAPER  9.12.0
PlaneGCSSolver_Tools Namespace Reference

Converter tools. More...

Data Structures

class  AttributeArray
 Provide an interface to access values in attribute which is an array of values. More...
 

Functions

SolverConstraintPtr createConstraint (ConstraintPtr theConstraint)
 Creates a solver's constraint using given SketchPlugin constraint or returns empty pointer if not all attributes are correct. More...
 
std::shared_ptr< SketchSolver_ConstraintMovementcreateMovementConstraint (FeaturePtr theMovedFeature)
 Creates temporary constraint to fix the feature after movement. More...
 
std::shared_ptr< SketchSolver_ConstraintMovementcreateMovementConstraint (AttributePtr theMovedAttribute)
 Creates temporary constraint to fix the attribute after movement. More...
 
std::shared_ptr< SketchSolver_ConstraintMovementcreateMovementConstraint (const std::pair< AttributePtr, int > &theMovedPointInArray)
 Creates temporary constraint to fix the point in array after movement. More...
 
ConstraintWrapperPtr createConstraint (ConstraintPtr theConstraint, const SketchSolver_ConstraintType &theType, const EntityWrapperPtr &theValue, const EntityWrapperPtr &theEntity1, const EntityWrapperPtr &theEntity2=EntityWrapperPtr(), const EntityWrapperPtr &theEntity3=EntityWrapperPtr(), const EntityWrapperPtr &theEntity4=EntityWrapperPtr())
 Creates new constraint using given parameters. More...
 
bool isAttributeApplicable (const std::string &theAttrName, const std::string &theOwnerName)
 Return true if the attribute is used in PlaneGCS solver. More...
 
std::shared_ptr< GeomAPI_Pnt2dpoint (EntityWrapperPtr theEntity)
 Convert entity to point. More...
 
std::shared_ptr< GeomAPI_Lin2dline (EntityWrapperPtr theEntity)
 Convert entity to line. More...
 
std::shared_ptr< GeomAPI_Circ2dcircle (EntityWrapperPtr theEntity)
 Convert entity to circle. More...
 
std::shared_ptr< GeomAPI_Ellipse2dellipse (EntityWrapperPtr theEntity)
 Convert entity to ellipse. More...
 
std::shared_ptr< GeomAPI_BSpline2dbspline (EntityWrapperPtr theEntity)
 Convert entity to Bs-pline. More...
 
std::shared_ptr< GeomAPI_Lin2dline (FeaturePtr theFeature)
 Convert entity to line. More...
 
void recalculateArcParameters (EntityWrapperPtr theArc)
 Update start and end parameters of circular and elliptic arcs respectively to start and end points on the arc. More...
 
GCS::SET_pD parameters (const EntityWrapperPtr &theEntity)
 brief Return list of parameters for the given entity More...
 
bool updateValue (const double &theSource, double &theDest, const double theTolerance=1.e4 *tolerance)
 Update value in theDest if theSource is differ more than theTolerance. More...
 
double distance (const GCS::Point &thePnt1, const GCS::Point &thePnt2)
 

Detailed Description

Converter tools.

Function Documentation

◆ createConstraint() [1/2]

SolverConstraintPtr PlaneGCSSolver_Tools::createConstraint ( ConstraintPtr  theConstraint)

Creates a solver's constraint using given SketchPlugin constraint or returns empty pointer if not all attributes are correct.

◆ createMovementConstraint() [1/3]

std::shared_ptr< SketchSolver_ConstraintMovement > PlaneGCSSolver_Tools::createMovementConstraint ( FeaturePtr  theMovedFeature)

Creates temporary constraint to fix the feature after movement.

◆ createMovementConstraint() [2/3]

std::shared_ptr< SketchSolver_ConstraintMovement > PlaneGCSSolver_Tools::createMovementConstraint ( AttributePtr  theMovedAttribute)

Creates temporary constraint to fix the attribute after movement.

◆ createMovementConstraint() [3/3]

std::shared_ptr< SketchSolver_ConstraintMovement > PlaneGCSSolver_Tools::createMovementConstraint ( const std::pair< AttributePtr, int > &  theMovedPointInArray)

Creates temporary constraint to fix the point in array after movement.

◆ createConstraint() [2/2]

ConstraintWrapperPtr PlaneGCSSolver_Tools::createConstraint ( ConstraintPtr  theConstraint,
const SketchSolver_ConstraintType &  theType,
const EntityWrapperPtr &  theValue,
const EntityWrapperPtr &  theEntity1,
const EntityWrapperPtr &  theEntity2 = EntityWrapperPtr(),
const EntityWrapperPtr &  theEntity3 = EntityWrapperPtr(),
const EntityWrapperPtr &  theEntity4 = EntityWrapperPtr() 
)

Creates new constraint using given parameters.

Parameters
theConstraint[in] original constraint
theType[in] type of constraint
theValue[in] numeric characteristic of constraint (e.g. distance or radius) if applicable
theEntity1[in] first attribute of constraint
theEntity2[in] second attribute of constraint
theEntity3[in] third attribute of constraint
theEntity4[in] fourth attribute of constraint
Returns
Created wrapper of constraints applicable for specific solver.

◆ isAttributeApplicable()

bool PlaneGCSSolver_Tools::isAttributeApplicable ( const std::string &  theAttrName,
const std::string &  theOwnerName 
)

Return true if the attribute is used in PlaneGCS solver.

Parameters
[in]theAttrNamename of the attribute
[in]theOwnerNamename of the parent feature

◆ point()

std::shared_ptr< GeomAPI_Pnt2d > PlaneGCSSolver_Tools::point ( EntityWrapperPtr  theEntity)

Convert entity to point.

Returns
empty pointer if the entity is not a point

◆ line() [1/2]

std::shared_ptr< GeomAPI_Lin2d > PlaneGCSSolver_Tools::line ( EntityWrapperPtr  theEntity)

Convert entity to line.

Returns
empty pointer if the entity is not a line

◆ circle()

std::shared_ptr< GeomAPI_Circ2d > PlaneGCSSolver_Tools::circle ( EntityWrapperPtr  theEntity)

Convert entity to circle.

Returns
empty pointer if the entity is not a circle

◆ ellipse()

std::shared_ptr< GeomAPI_Ellipse2d > PlaneGCSSolver_Tools::ellipse ( EntityWrapperPtr  theEntity)

Convert entity to ellipse.

Returns
empty pointer if the entity is not an ellipse

◆ bspline()

std::shared_ptr< GeomAPI_BSpline2d > PlaneGCSSolver_Tools::bspline ( EntityWrapperPtr  theEntity)

Convert entity to Bs-pline.

Returns
empty pointer if the entity is not an ellipse

◆ line() [2/2]

std::shared_ptr< GeomAPI_Lin2d > PlaneGCSSolver_Tools::line ( FeaturePtr  theFeature)

Convert entity to line.

Returns
empty pointer if the entity is not a line

◆ recalculateArcParameters()

void PlaneGCSSolver_Tools::recalculateArcParameters ( EntityWrapperPtr  theArc)

Update start and end parameters of circular and elliptic arcs respectively to start and end points on the arc.

For the circular arc, the radius is calculated too.

◆ parameters()

GCS::SET_pD PlaneGCSSolver_Tools::parameters ( const EntityWrapperPtr &  theEntity)

brief Return list of parameters for the given entity

◆ updateValue()

bool PlaneGCSSolver_Tools::updateValue ( const double &  theSource,
double &  theDest,
const double  theTolerance = 1.e4 * tolerance 
)

Update value in theDest if theSource is differ more than theTolerance.

Update value.

Returns
true if the value was updated.