SHAPER  9.12.0
SketchSolver_ConstraintMulti Class Referenceabstract

Common base class for the Multi constraints. More...

Inheritance diagram for SketchSolver_ConstraintMulti:
Inheritance graph

Public Member Functions

 SketchSolver_ConstraintMulti (ConstraintPtr theConstraint)
 Constructor based on SketchPlugin constraint. More...
 
virtual void update ()
 Update constraint. More...
 
virtual void notify (const FeaturePtr &theFeature, PlaneGCSSolver_Update *)
 Notify this object about the feature is changed somewhere. More...
 
virtual bool remove ()
 Tries to remove constraint. More...
 
virtual void blockEvents (bool isBlocked)
 Block or unblock events from this constraint. More...
 
void process (StoragePtr theStorage, bool theEvensBlocked)
 Initializes parameters and start constraint creation. 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...
 
void getEntities (std::list< EntityWrapperPtr > &theEntities)
 Collect entities which are translated or rotated (not their copies) More...
 
virtual void getAttributes (EntityWrapperPtr &, std::vector< EntityWrapperPtr > &)
 Generate list of attributes of constraint in order useful for SolveSpace constraints. More...
 
virtual void adjustConstraint ()
 This method is used in derived objects to check consistence of constraint. More...
 
virtual void updateLocal ()=0
 Update parameters of derived classes. More...
 
virtual const std::string & nameNbObjects ()=0
 Returns name of NUMBER_OF_COPIES parameter for corresponding feature. More...
 
virtual void getRelative (double theAbsX, double theAbsY, double &theRelX, double &theRelY)=0
 Convert absolute coordinates to relative coordinates. More...
 
virtual void getAbsolute (double theRelX, double theRelY, double &theAbsX, double &theAbsY)=0
 Convert relative coordinates to absolute coordinates. More...
 
virtual void transformRelative (double &theX, double &theY)=0
 Apply transformation for relative coordinates. More...
 
void cleanErrorMsg ()
 Removes last error. More...
 

Protected Attributes

int myNumberOfObjects
 number of previous initial objects More...
 
int myNumberOfCopies
 number of previous copies of initial objects More...
 
bool myIsFullValue
 value whether the angle/distance is a full or single for objects More...
 
bool myAdjusted
 the constraint is already adjusted (to not do it several times) More...
 
std::set< FeaturePtr > myOriginalFeatures
 lists of original features and their copies to find whether some of them are disappeared More...
 
std::set< FeaturePtr > myCopiedFeatures
 
bool myIsEventsBlocked
 
bool myIsProcessingNotify
 the notification is already processing More...
 
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

Common base class for the Multi constraints.

Constructor & Destructor Documentation

◆ SketchSolver_ConstraintMulti()

SketchSolver_ConstraintMulti::SketchSolver_ConstraintMulti ( ConstraintPtr  theConstraint)
inline

Constructor based on SketchPlugin constraint.

Member Function Documentation

◆ update()

void SketchSolver_ConstraintMulti::update ( )
virtual

Update constraint.

Reimplemented from SketchSolver_Constraint.

◆ notify()

void SketchSolver_ConstraintMulti::notify ( const FeaturePtr &  theFeature,
PlaneGCSSolver_Update  
)
virtual

Notify this object about the feature is changed somewhere.

Reimplemented from SketchSolver_Constraint.

◆ remove()

bool SketchSolver_ConstraintMulti::remove ( )
virtual

Tries to remove constraint.

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

Reimplemented from SketchSolver_Constraint.

◆ blockEvents()

void SketchSolver_ConstraintMulti::blockEvents ( bool  isBlocked)
virtual

Block or unblock events from this constraint.

Reimplemented from SketchSolver_Constraint.

◆ process() [1/2]

virtual void SketchSolver_ConstraintMulti::process ( )
inlineprotectedvirtual

Converts SketchPlugin constraint to a list of SolveSpace constraints.

Reimplemented from SketchSolver_Constraint.

Reimplemented in SketchSolver_ConstraintMultiTranslation, and SketchSolver_ConstraintMultiRotation.

◆ getEntities()

void SketchSolver_ConstraintMulti::getEntities ( std::list< EntityWrapperPtr > &  theEntities)
protected

Collect entities which are translated or rotated (not their copies)

◆ getAttributes()

virtual void SketchSolver_ConstraintMulti::getAttributes ( EntityWrapperPtr &  ,
std::vector< EntityWrapperPtr > &   
)
inlineprotectedvirtual

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

Reimplemented from SketchSolver_Constraint.

◆ adjustConstraint()

void SketchSolver_ConstraintMulti::adjustConstraint ( )
protectedvirtual

This method is used in derived objects to check consistence of constraint.

Reimplemented from SketchSolver_Constraint.

Reimplemented in SketchSolver_ConstraintMultiTranslation, and SketchSolver_ConstraintMultiRotation.

◆ updateLocal()

virtual void SketchSolver_ConstraintMulti::updateLocal ( )
protectedpure virtual

Update parameters of derived classes.

Implemented in SketchSolver_ConstraintMultiTranslation, and SketchSolver_ConstraintMultiRotation.

◆ nameNbObjects()

virtual const std::string& SketchSolver_ConstraintMulti::nameNbObjects ( )
protectedpure virtual

Returns name of NUMBER_OF_COPIES parameter for corresponding feature.

◆ getRelative()

virtual void SketchSolver_ConstraintMulti::getRelative ( double  theAbsX,
double  theAbsY,
double &  theRelX,
double &  theRelY 
)
protectedpure virtual

Convert absolute coordinates to relative coordinates.

◆ getAbsolute()

virtual void SketchSolver_ConstraintMulti::getAbsolute ( double  theRelX,
double  theRelY,
double &  theAbsX,
double &  theAbsY 
)
protectedpure virtual

Convert relative coordinates to absolute coordinates.

◆ transformRelative()

virtual void SketchSolver_ConstraintMulti::transformRelative ( double &  theX,
double &  theY 
)
protectedpure virtual

Apply transformation for relative coordinates.

◆ 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

◆ 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.

◆ cleanErrorMsg()

void SketchSolver_Constraint::cleanErrorMsg ( )
inlineprotectedinherited

Removes last error.

Field Documentation

◆ myNumberOfObjects

int SketchSolver_ConstraintMulti::myNumberOfObjects
protected

number of previous initial objects

◆ myNumberOfCopies

int SketchSolver_ConstraintMulti::myNumberOfCopies
protected

number of previous copies of initial objects

◆ myIsFullValue

bool SketchSolver_ConstraintMulti::myIsFullValue
protected

value whether the angle/distance is a full or single for objects

◆ myAdjusted

bool SketchSolver_ConstraintMulti::myAdjusted
protected

the constraint is already adjusted (to not do it several times)

◆ myOriginalFeatures

std::set<FeaturePtr> SketchSolver_ConstraintMulti::myOriginalFeatures
protected

lists of original features and their copies to find whether some of them are disappeared

◆ myIsProcessingNotify

bool SketchSolver_ConstraintMulti::myIsProcessingNotify
protected

the notification is already processing

◆ 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