20 #ifndef SolveSpaceSolver_Storage_H_
21 #define SolveSpaceSolver_Storage_H_
23 #include <SketchSolver_Storage.h>
24 #include <SolveSpaceSolver_Solver.h>
31 typedef std::list< std::set<ConstraintWrapperPtr> > SameConstraintMap;
47 virtual bool update(ConstraintWrapperPtr theConstraint);
50 virtual bool update(EntityWrapperPtr theEntity);
53 virtual bool update(ParameterWrapperPtr theParameter);
57 virtual void refresh(
bool theFixedOnly =
false)
const;
73 virtual bool remove(ConstraintWrapperPtr theConstraint);
76 virtual bool remove(EntityWrapperPtr theEntity);
79 virtual bool remove(ParameterWrapperPtr theParameter);
82 virtual void changeGroup(EntityWrapperPtr theEntity,
const GroupID& theGroup);
84 virtual void changeGroup(ParameterWrapperPtr theParam,
const GroupID& theGroup);
108 const Slvs_Param&
getParameter(
const Slvs_hParam& theParamID)
const;
114 Slvs_hEntity
addEntity(
const Slvs_Entity& theEntity);
119 Slvs_hEntity
updateEntity(
const Slvs_Entity& theEntity);
127 const Slvs_Entity&
getEntity(
const Slvs_hEntity& theEntityID)
const;
130 {
return myEntityMaxID; }
136 Slvs_hConstraint
addConstraint(
const Slvs_Constraint& theConstraint);
150 const Slvs_Constraint&
getConstraint(
const Slvs_hConstraint& theConstraintID)
const;
153 {
return myConstraints.size(); }
157 {
return myDuplicatedConstraint; }
164 void adjustArc(
const Slvs_Entity& theArc);
167 void replaceInFeatures(EntityWrapperPtr theSource, EntityWrapperPtr theDest);
169 void replaceInConstraints(EntityWrapperPtr theSource, EntityWrapperPtr theDest);
175 void addSameConstraints(ConstraintWrapperPtr theConstraint1,
176 ConstraintWrapperPtr theConstraint2);
179 bool findSameConstraint(ConstraintWrapperPtr theConstraint);
182 Slvs_hEntity myWorkplaneID;
185 Slvs_hParam myParamMaxID;
188 std::vector<Slvs_Param> myParameters;
189 Slvs_hEntity myEntityMaxID;
192 std::vector<Slvs_Entity> myEntities;
195 Slvs_hConstraint myConstrMaxID;
198 std::vector<Slvs_Constraint> myConstraints;
200 bool myDuplicatedConstraint;
202 SameConstraintMap myEqualConstraints;
Interface to map SketchPlugin features to the entities of corresponding solver.
Definition: SketchSolver_Storage.h:44
virtual void refresh() const =0
Update SketchPlugin features after resolving constraints.
Contains all necessary data in SolveSpace format to solve a single group of constraints.
Definition: SolveSpaceSolver_Storage.h:39
virtual bool remove(ConstraintWrapperPtr theConstraint)
Remove constraint.
Definition: SolveSpaceSolver_Storage.cpp:915
const Slvs_Param & getParameter(const Slvs_hParam &theParamID) const
Returns the parameter by its ID.
Definition: SolveSpaceSolver_Storage.cpp:671
virtual bool update(ConstraintWrapperPtr theConstraint)
Update constraint's data.
Definition: SolveSpaceSolver_Storage.cpp:66
const Slvs_Constraint & getConstraint(const Slvs_hConstraint &theConstraintID) const
Returns the constraint by its ID.
Definition: SolveSpaceSolver_Storage.cpp:878
virtual void verifyFixed()
Check if some parameters or entities are returned to the current group after removing temporary const...
Definition: SolveSpaceSolver_Storage.cpp:1082
size_t nbConstraints() const
Returns quantity of constraints in this storage.
Definition: SolveSpaceSolver_Storage.h:152
virtual void initializeSolver(SolverPtr theSolver)
Initialize constraint solver by the entities collected by current storage.
Definition: SolveSpaceSolver_Storage.cpp:891
Slvs_hEntity addEntity(const Slvs_Entity &theEntity)
Add new entity to the current group.
Definition: SolveSpaceSolver_Storage.cpp:684
virtual bool hasDuplicatedConstraint() const
Shows the storage has the same constraint twice.
Definition: SolveSpaceSolver_Storage.h:156
bool removeEntity(const Slvs_hEntity &theEntityID)
Removes the entity by its ID.
Definition: SolveSpaceSolver_Storage.cpp:719
Slvs_hParam updateParameter(const Slvs_Param &theParam)
Updates parameter in the current group.
Definition: SolveSpaceSolver_Storage.cpp:633
Slvs_hConstraint updateConstraint(const Slvs_Constraint &theConstraint)
Updates constraint in the current group.
Definition: SolveSpaceSolver_Storage.cpp:808
const Slvs_Entity & getEntity(const Slvs_hEntity &theEntityID) const
Returns the entity by its ID.
Definition: SolveSpaceSolver_Storage.cpp:764
Slvs_hEntity updateEntity(const Slvs_Entity &theEntity)
Updates entity in the current group.
Definition: SolveSpaceSolver_Storage.cpp:701
virtual void changeGroup(EntityWrapperPtr theEntity, const GroupID &theGroup)
Update the group for the given entity, its sub-entities and parameters.
Definition: SolveSpaceSolver_Storage.cpp:255
virtual void addCoincidentPoints(EntityWrapperPtr theMaster, EntityWrapperPtr theSlave)
Mark two points as coincident.
Definition: SolveSpaceSolver_Storage.cpp:292
Slvs_hConstraint addConstraint(const Slvs_Constraint &theConstraint)
Add new constraint to the current group.
Definition: SolveSpaceSolver_Storage.cpp:777
bool removeConstraint(const Slvs_hConstraint &theConstraintID)
Removes the constraint by its ID.
Definition: SolveSpaceSolver_Storage.cpp:850
Slvs_hParam addParameter(const Slvs_Param &theParam)
Add new parameter to the current group.
Definition: SolveSpaceSolver_Storage.cpp:616
bool removeParameter(const Slvs_hParam &theParamID)
Removes the parameter by its ID.
Definition: SolveSpaceSolver_Storage.cpp:652
const Slvs_hEntity & entityMaxID() const
Returns maximal ID of entities in this storage.
Definition: SolveSpaceSolver_Storage.h:129
virtual EntityWrapperPtr calculateMiddlePoint(EntityWrapperPtr theBase, double theCoeff)
Calculate point on theBase entity.
Definition: SolveSpaceSolver_Storage.cpp:530
void storeWorkplane(EntityWrapperPtr theSketch)
Obtain and store identifier of sketch.
Definition: SolveSpaceSolver_Storage.cpp:235