/** \class SketchSolver_ConstraintGroup
* \ingroup DataModel
* \brief Keeps the group of constraints which based on the same entities
/** \class SketchSolver_ConstraintGroup
* \ingroup DataModel
* \brief Keeps the group of constraints which based on the same entities
* Throws an exception if theWorkplane is not an object of SketchPlugin_Sketch type
* \remark Type of theSketch is not verified inside
*/
* Throws an exception if theWorkplane is not an object of SketchPlugin_Sketch type
* \remark Type of theSketch is not verified inside
*/
* \param[in] theConstraint constraint to be changed
* \return \c true if the constraint added or updated successfully
*/
* \param[in] theConstraint constraint to be changed
* \return \c true if the constraint added or updated successfully
*/
- /** \brief Verifies the constraint uses the objects from this group
- * \param[in] theConstraint constraint for verification of interaction
- * \return \c true if the constrained objects are used in current group
+ /** \brief Verifies the feature attributes are used in this group
+ * \param[in] theFeature constraint or any other object for verification of interaction
+ * \return \c true if some of attributes are used in current group
/** \brief Verifies the specified feature is equal to the base workplane for this group
* \param[in] theWorkplane the feature to be compared with base workplane
* \return \c true if workplanes are the same
*/
/** \brief Verifies the specified feature is equal to the base workplane for this group
* \param[in] theWorkplane the feature to be compared with base workplane
* \return \c true if workplanes are the same
*/
/** \brief If the entity is in this group it will updated
* \param[in] theEntity attribute, which values should update SolveSpace entity
*/
/** \brief If the entity is in this group it will updated
* \param[in] theEntity attribute, which values should update SolveSpace entity
*/
/** \brief Searches invalid features and constraints in the group and avoids them
* \return \c true if the group several constraints were removed
/** \brief Searches invalid features and constraints in the group and avoids them
* \return \c true if the group several constraints were removed
void splitGroup(std::vector<SketchSolver_ConstraintGroup*>& theCuts);
/** \brief Start solution procedure if necessary and update attributes of features
void splitGroup(std::vector<SketchSolver_ConstraintGroup*>& theCuts);
/** \brief Start solution procedure if necessary and update attributes of features
/** \brief Searches the constraints built on the entity and emit the signal to update them
* \param[in] theEntity attribute of the constraint
*/
/** \brief Searches the constraints built on the entity and emit the signal to update them
* \param[in] theEntity attribute of the constraint
*/
- void updateRelatedConstraints(boost::shared_ptr<ModelAPI_Attribute> theEntity) const;
- void updateRelatedConstraints(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
+ void updateRelatedConstraints(std::shared_ptr<ModelAPI_Attribute> theEntity) const;
+ void updateRelatedConstraintsFeature(std::shared_ptr<ModelAPI_Feature> theFeature) const;
/** \brief Adds or updates an entity in the group
*
* The parameters of entity will be parsed and added to the list of SolveSpace parameters.
/** \brief Adds or updates an entity in the group
*
* The parameters of entity will be parsed and added to the list of SolveSpace parameters.
* \param[in] theEntity the object of constraint
* \return identifier of changed entity or 0 if entity could not be changed
*/
* \param[in] theEntity the object of constraint
* \return identifier of changed entity or 0 if entity could not be changed
*/
- Slvs_hEntity changeEntity(boost::shared_ptr<ModelAPI_Attribute> theEntity);
- Slvs_hEntity changeEntity(FeaturePtr theEntity);
+ Slvs_hEntity changeEntity(std::shared_ptr<ModelAPI_Attribute> theEntity);
+ Slvs_hEntity changeEntityFeature(std::shared_ptr<ModelAPI_Feature> theEntity);
/** \brief Adds or updates a normal in the group
*
* Normal is a special entity in SolveSpace, which defines a direction in 3D and
/** \brief Adds or updates a normal in the group
*
* Normal is a special entity in SolveSpace, which defines a direction in 3D and
* \param[in] theNorm attribute for the normal (used to identify newly created entity)
* \return identifier of created or updated normal
*/
* \param[in] theNorm attribute for the normal (used to identify newly created entity)
* \return identifier of created or updated normal
*/
- Slvs_hEntity changeNormal(boost::shared_ptr<ModelAPI_Attribute> theDirX,
- boost::shared_ptr<ModelAPI_Attribute> theDirY,
- boost::shared_ptr<ModelAPI_Attribute> theNorm);
+ Slvs_hEntity changeNormal(std::shared_ptr<ModelAPI_Attribute> theDirX,
+ std::shared_ptr<ModelAPI_Attribute> theDirY,
+ std::shared_ptr<ModelAPI_Attribute> theNorm);
Slvs_hParam changeParameter(const double& theParam,
std::vector<Slvs_Param>::const_iterator& thePrmIter);
Slvs_hParam changeParameter(const double& theParam,
std::vector<Slvs_Param>::const_iterator& thePrmIter);
/** \brief Change values of attribute by parameters received from SolveSpace solver
* \param[in,out] theAttribute pointer to the attribute to be changed
* \param[in] theEntityID identifier of SolveSpace entity, which contains updated data
* \return \c true if the attribute's value has changed
*/
/** \brief Change values of attribute by parameters received from SolveSpace solver
* \param[in,out] theAttribute pointer to the attribute to be changed
* \param[in] theEntityID identifier of SolveSpace entity, which contains updated data
* \return \c true if the attribute's value has changed
*/
const Slvs_hEntity& theEntityID);
/** \brief Adds a constraint for a point which should not be changed during computations
const Slvs_hEntity& theEntityID);
/** \brief Adds a constraint for a point which should not be changed during computations
- * \param[in] theEntity the base for the constraint
+ * \param[in] theEntity the base for the constraint
+ * \param[in] theAllowToFit this flag shows that the entity may be placed into
+ * the 'dragged' field of SolveSpace solver, so this entity
+ * may be changed a little during solution
private:
/** \brief Creates a workplane from the sketch parameters
* \param[in] theSketch parameters of workplane are the attributes of this sketch
* \return \c true if success, \c false if workplane parameters are not consistent
*/
private:
/** \brief Creates a workplane from the sketch parameters
* \param[in] theSketch parameters of workplane are the attributes of this sketch
* \return \c true if success, \c false if workplane parameters are not consistent
*/
/** \brief Add the entities of constraint for points coincidence into the appropriate list
* \param[in] thePoint1 identifier of the first point
/** \brief Add the entities of constraint for points coincidence into the appropriate list
* \param[in] thePoint1 identifier of the first point
std::vector<Slvs_Param> myParams; ///< List of parameters of the constraints
Slvs_hParam myParamMaxID; ///< Actual maximal ID of parameters (not equal to myParams size)
std::vector<Slvs_Entity> myEntities; ///< List of entities of the constaints
std::vector<Slvs_Param> myParams; ///< List of parameters of the constraints
Slvs_hParam myParamMaxID; ///< Actual maximal ID of parameters (not equal to myParams size)
std::vector<Slvs_Entity> myEntities; ///< List of entities of the constaints
Slvs_hEntity myEntityMaxID; ///< Actual maximal ID of entities (not equal to myEntities size)
std::vector<Slvs_Constraint> myConstraints; ///< List of constraints in SolveSpace format
Slvs_hConstraint myConstrMaxID; ///< Actual maximal ID of constraints (not equal to myConstraints size)
Slvs_hEntity myEntityMaxID; ///< Actual maximal ID of entities (not equal to myEntities size)
std::vector<Slvs_Constraint> myConstraints; ///< List of constraints in SolveSpace format
Slvs_hConstraint myConstrMaxID; ///< Actual maximal ID of constraints (not equal to myConstraints size)
- boost::shared_ptr<SketchPlugin_Feature> mySketch; ///< Equivalent to workplane
- std::map<boost::shared_ptr<SketchPlugin_Constraint>, Slvs_hConstraint> myConstraintMap; ///< The map between SketchPlugin and SolveSpace constraints
- std::map<boost::shared_ptr<ModelAPI_Attribute>, Slvs_hEntity> myEntityAttrMap; ///< The map between "attribute" parameters of constraints and their equivalent SolveSpace entities
+ std::shared_ptr<ModelAPI_CompositeFeature> mySketch; ///< Equivalent to workplane
+ ConstraintMap myConstraintMap; ///< The map between SketchPlugin and SolveSpace constraints
+ std::map<std::shared_ptr<ModelAPI_Attribute>, Slvs_hEntity> myEntityAttrMap; ///< The map between "attribute" parameters of constraints and their equivalent SolveSpace entities
std::map<FeaturePtr, Slvs_hEntity> myEntityFeatMap; ///< The map between "feature" parameters of constraints and their equivalent SolveSpace entities
// Conincident items
std::vector<std::set<Slvs_hEntity> > myCoincidentPoints; ///< Stores the lists of identifiers of coincident points (to avoid unnecessary coincidence constraints)
std::map<FeaturePtr, Slvs_hEntity> myEntityFeatMap; ///< The map between "feature" parameters of constraints and their equivalent SolveSpace entities
// Conincident items
std::vector<std::set<Slvs_hEntity> > myCoincidentPoints; ///< Stores the lists of identifiers of coincident points (to avoid unnecessary coincidence constraints)