X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_PositionMgr.h;h=a739dff146537dad5660310f78e86905b7a5b964;hb=745c72679f6346375d5e886b25cc3865f3c4daae;hp=d9bb444ee17776a7470a45417ff5352a4c3f8c28;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.h b/src/SketcherPrs/SketcherPrs_PositionMgr.h index d9bb444ee..a739dff14 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.h +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,22 +12,24 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SketcherPrs_PositionMgr_H #define SketcherPrs_PositionMgr_H +#include "SketcherPrs.h" #include "SketcherPrs_SymbolPrs.h" #include +#include #include #include #include +#include /** * \ingroup GUI @@ -38,17 +40,21 @@ class SketcherPrs_PositionMgr { public: /// Returns current instance of position manager - static SketcherPrs_PositionMgr* get(); + SKETCHERPRS_EXPORT static SketcherPrs_PositionMgr* get(); /// Returns position of symbol for the given presentation /// \param theLine constrained object /// \param thePrs a presentation of constraint /// \param theStep step between symbols - gp_Pnt getPosition(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs, double theStep = 20); + SKETCHERPRS_EXPORT gp_Pnt getPosition(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs, + double theStep = 20, GeomPointPtr thePnt = GeomPointPtr()); /// Deletes constraint object from internal structures. Has to be called on constraint delete. /// \param thePrs a constraint presentation - void deleteConstraint(const SketcherPrs_SymbolPrs* thePrs); + SKETCHERPRS_EXPORT void deleteConstraint(const SketcherPrs_SymbolPrs* thePrs); + + /// Cleares all stored positions for all constraints + void clearAll() { myShapes.clear(); myPntShapes.clear(); } private: /// Constructor @@ -59,14 +65,31 @@ private: /// \param thePrs a presentation of constraint int getPositionIndex(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs); + /// Returns position index of the given constraint around a point + /// \param theLine constrained object + /// \param thePrs a presentation of constraint + const std::array& getPositionIndex(GeomPointPtr thePos, + const SketcherPrs_SymbolPrs* thePrs); + + /// Returns position of a constraint around a point + /// \param theLine a base object of the constraint + /// \param thePrs a presentation of the constraint symbol + /// \param theStep step from base point + /// \param thePnt a base point + gp_Pnt getPointPosition(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs, + double theStep, GeomPointPtr thePnt); + + static bool isPntConstraint(const std::string& theName); + private: typedef std::map PositionsMap; - - /// The map which contains position of presentation - PositionsMap myIndexes; + typedef std::map> FeaturesMap; /// The map contains position index std::map myShapes; + + /// The map contains position of index for constraints around a point + FeaturesMap myPntShapes; }; #endif \ No newline at end of file