- /** \brief Removes a constraint into the group
- * \param[in] theConstraint constraint to be removed
- * \return \c true if the constraint removed successfully
- */
- bool removeConstraint(boost::shared_ptr<SketchPlugin_Constraint> theConstraint);
-
- /** \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
- */
- bool isInteract(boost::shared_ptr<SketchPlugin_Constraint> theConstraint) const;
-
- /** \brief Verifies the specified workplane is the same as a base workplane for this group
- * \param[in] theWorkplane workplane to be compared
- * \return \c true if workplanes are the same
- */
- bool isBaseWorkplane(boost::shared_ptr<SketchPlugin_Sketch> theWorkplane) const;
-
-protected:
- /** \brief Adds an entity into the group
- * \param[in] theEntity the object of constraint
- * \return identifier of created entity or 0 if entity was not added
- */
- Slvs_hEntity addEntity(boost::shared_ptr<ModelAPI_Attribute> theEntity);
-
- /** \brief Adds a parameter into the group
- * \param[in] theParam parameter to be added
- * \return identifier of created parameter or 0 if it was not added
- */
- Slvs_hParam addParameter(double theParam);
-
- /** \brief Compute constraint type according to SolveSpace identifiers
- * \param[in] theConstraint constraint which type should be determined
- * \return identifier of constraint type
- */
- int getConstraintType(const boost::shared_ptr<SketchPlugin_Constraint>& theConstraint) const;
-
-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
- */
- bool addWorkplane(boost::shared_ptr<SketchPlugin_Sketch> theSketch);
-
-private:
- // SolveSpace entities
- Slvs_hGroup myID; ///< the index of the group
- Slvs_Entity myWorkplane; ///< Workplane for the current group
- 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_System myConstrSet; ///< SolveSpace's set of equations obtained by constraints
-
- // SketchPlugin entities
- boost::shared_ptr<SketchPlugin_Sketch> mySketch; ///< Equivalent to workplane
- std::map<boost::shared_ptr<SketchPlugin_Constraint>, Slvs_Constraint>
- myConstraintMap; ///< The map between SketchPlugin and SolveSpace constraints