1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketcherPrs_PositionMgr.h
4 // Created: 13 March 2015
5 // Author: Vitaly SMETANNIKOV
7 #ifndef SketcherPrs_PositionMgr_H
8 #define SketcherPrs_PositionMgr_H
10 #include "SketcherPrs_SymbolPrs.h"
12 #include <GeomAPI_Shape.h>
14 #include <ModelAPI_Object.h>
20 * A class Position Manager which manages position of constraints symbols along a source object line.
21 * it expects that symbol icons have size 16x16 px
23 class SketcherPrs_PositionMgr
26 /// Returns current instance of position manager
27 static SketcherPrs_PositionMgr* get();
29 /// Returns position of symbol for the given presentation
30 /// \param theLine constrained object
31 /// \param thePrs a presentation of constraint
32 gp_Pnt getPosition(ObjectPtr theLine, Handle(SketcherPrs_SymbolPrs) thePrs);
34 /// Deletes constraint object from internal structures. Has to be called on constraint delete.
35 /// \param thePrs a constraint presentation
36 void deleteConstraint(Handle(SketcherPrs_SymbolPrs) thePrs);
40 SketcherPrs_PositionMgr();
42 /// Returns position index of the given constraint
43 /// \param theLine constrained object
44 /// \param thePrs a presentation of constraint
45 int getPositionIndex(ObjectPtr theLine, Handle(SketcherPrs_SymbolPrs) thePrs);
48 typedef std::map<void*, int> PositionsMap;
50 /// The map which contains position of presentation
51 PositionsMap myIndexes;
53 /// The map contains position index
54 std::map<ObjectPtr, PositionsMap> myShapes;