X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Trim.h;h=365cda33cec49e576cd12bce33e628361c374b8d;hb=629889bb85c8e4d8446651e8b597f20c14714aa1;hp=90bbf7434287ccc569b500efebb80cbd849e74cc;hpb=97917d3698f5a2f7fc9596e7c755ff8f6751e373;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Trim.h b/src/SketchPlugin/SketchPlugin_Trim.h index 90bbf7434..365cda33c 100644 --- a/src/SketchPlugin/SketchPlugin_Trim.h +++ b/src/SketchPlugin/SketchPlugin_Trim.h @@ -21,8 +21,9 @@ #define SketchPlugin_Trim_H_ #include "SketchPlugin.h" +#include -#include "GeomAPI_IPresentable.h" +#include #include #include @@ -105,15 +106,6 @@ class SketchPlugin_Trim : public SketchPlugin_Feature, public GeomAPI_IPresentab /// Apply information of the message to current object. It fills selected point and object virtual std::string processEvent(const std::shared_ptr& theMessage); - typedef std::map, - std::pair >, - std::list > > > PointToRefsMap; - - static void fillObjectShapes(const std::shared_ptr& theObject, - const std::shared_ptr& theSketch, - std::map, std::set >& theCashedShapes, - std::map, PointToRefsMap>& theObjectToPoints); - private: bool setCoincidenceToAttribute(const AttributePtr& theAttribute, const std::set >& theFurtherCoincidences, @@ -123,18 +115,6 @@ private: /// \param theFeature a feature that can be set into the attribute bool moveTangency(const AttributePtr& theAttribute, const FeaturePtr& theFeature); - GeomShapePtr getSubShape(const std::string& theObjectAttributeId, - const std::string& thePointAttributeId); - - /// Returns geom point attribute of the feature bounds. It processes line or arc. - /// For circle feature, the result attributes are null - /// \param theFeature a source feature - /// \param theStartPointAttr an out attribute to start point - /// \param theStartPointAttr an out attribute to end point - void getFeaturePoints(const FeaturePtr& theFeature, - std::shared_ptr& theStartPointAttr, - std::shared_ptr& theEndPointAttr); - /// Obtains those constraints of the feature that should be modified. output maps contain /// point of coincidence and attribute id to be modified after split /// \param theFeaturesToDelete [out] constrains that will be deleted after split @@ -142,36 +122,12 @@ private: void getConstraints(std::set>& theFeaturesToDelete, std::set& theFeaturesToUpdate); - /// Obtains references to feature point attributes and to feature, - /// e.g. for feature line: 1st container is - /// <1st line point, list > - /// <2nd line point, list<> > - /// for feature circle 2nd container is - /// \param theFeature an investigated feature - /// \param theRefs a container of list of referenced attributes - void getRefAttributes(const FeaturePtr& theFeature, - std::map >& theRefs, - std::list& theRefsToFeature); - - /// Move constraints from attribute of base feature to attribute after modification - /// \param theBaseRefAttributes container of references to the attributes of base feature - /// \param theModifiedAttributes container of attributes placed instead of base attributes - /// at the same place - void updateRefAttConstraints( - const std::map >& theBaseRefAttributes, - const std::set >& theModifiedAttributes, - std::set>& theFeaturesToDelete); - /// Remove references constraints from attribute of base feature refer to the given attribute /// \param theAttribute an attribute /// \param theModifiedAttributes modifiable container of attributes void removeReferencesToAttribute(const AttributePtr& theAttribute, std::map >& theBaseRefAttributes); - /// Updates line length if it exist in the list - /// \param theFeaturesToUpdate a constraints container - void updateFeaturesAfterTrim(const std::set& theFeaturesToUpdate); - /// Make the base object is splitted by the point attributes /// \param theBaseRefAttributes container of references to the attributes of base feature /// \param thePoints a list of points where coincidences will be build @@ -195,10 +151,19 @@ private: /// Make the base object is splitted by the point attributes /// \param thePoints a list of points where coincidences will be build - FeaturePtr trimCircle(const std::shared_ptr& theStartShapePoint, - const std::shared_ptr& theLastShapePoint, - std::set >& thePoints, - std::set>& theModifiedAttributes); + /// \return new elliptic arc if it was created + FeaturePtr trimEllipticArc(const std::shared_ptr& theStartShapePoint, + const std::shared_ptr& theLastShapePoint, + std::map >& theBaseRefAttributes, + std::set >& thePoints, + std::set>& theModifiedAttributes); + + /// Make the base object is splitted by the point attributes + /// \param thePoints a list of points where coincidences will be build + FeaturePtr trimClosed(const std::shared_ptr& theStartShapePoint, + const std::shared_ptr& theLastShapePoint, + std::set >& thePoints, + std::set>& theModifiedAttributes); /// Correct the first and the second point to provide condition that the first is closer to /// the start point and the second point - to the last end of current segment. To rearrange @@ -238,28 +203,6 @@ private: void fillPointAttribute(const AttributePtr& theModifiedAttribute, const std::shared_ptr& thePoint); - /// Creates a line feature filled by center of base feature and given points - /// \param theBaseFeature another arc feature - /// \param theFirstAttribute an attribute with coordinates for the start point - /// \param theSecondAttribute an attribute with coordinates for the end point - FeaturePtr createLineFeature(const FeaturePtr& theBaseFeature, - const std::shared_ptr& theFirstPoint, - const std::shared_ptr& theSecondPoint); - - /// Creates an arc feature filled by center of base feature and given points - /// \param theBaseFeature another arc feature - /// \param theFirstAttribute an attribute with coordinates for the start point - /// \param theSecondAttribute an attribute with coordinates for the end point - FeaturePtr createArcFeature(const FeaturePtr& theBaseFeature, - const std::shared_ptr& theFirstPoint, - const std::shared_ptr& theSecondPoint); - - /// Result result of the feature to build constraint with. For arc, circle it is an edge result. - /// \param theFeature a feature - /// \return result object - std::shared_ptr getFeatureResult( - const std::shared_ptr& theFeature); - private: void findShapePoints(const std::string& theObjectAttributeId, const std::string& thePointAttributeId, @@ -270,7 +213,8 @@ private: private: std::map, std::set > myCashedShapes; - std::map, PointToRefsMap> myObjectToPoints; + std::map, + GeomAlgoAPI_ShapeTools::PointToRefsMap> myObjectToPoints; }; #endif