X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_PositionMgr.h;h=7acc36e1150d9c56bc2031fc26df6711499f5190;hb=180173d1e6a5463c4962721c1213a47794dd0974;hp=272092989524c4d9a8f032035e257bcd51ae3b54;hpb=f34ed4488b454d0f9d2cb4281eafdea7daf0f91c;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.h b/src/SketcherPrs/SketcherPrs_PositionMgr.h index 272092989..7acc36e11 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.h +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.h @@ -21,6 +21,7 @@ #ifndef SketcherPrs_PositionMgr_H #define SketcherPrs_PositionMgr_H +#include "SketcherPrs.h" #include "SketcherPrs_SymbolPrs.h" #include @@ -29,13 +30,14 @@ #include #include +#include /** * \ingroup GUI * A class Position Manager which manages position of constraints symbols along a source object line. * it expects that symbol icons have size 16x16 px */ -class SketcherPrs_PositionMgr +class SKETCHERPRS_EXPORT SketcherPrs_PositionMgr { public: /// Returns current instance of position manager @@ -52,6 +54,9 @@ public: /// \param thePrs a constraint presentation void deleteConstraint(const SketcherPrs_SymbolPrs* thePrs); + /// Cleares all stored positions for all constraints + void clearAll() { myShapes.clear(); myPntShapes.clear(); } + private: /// Constructor SketcherPrs_PositionMgr(); @@ -61,17 +66,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