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>
19 * A class Position Manager which manages position of constraints symbols along a source object line.
20 * it expects that symbol icons have size 16x16 px
22 class SketcherPrs_PositionMgr
25 /// Returns current instance of position manager
26 static SketcherPrs_PositionMgr* get();
28 /// Returns position of symbol for the given presentation
29 /// \param theLine constrained object
30 /// \param thePrs a presentation of constraint
31 gp_Pnt getPosition(std::shared_ptr<GeomAPI_Shape> theLine, Handle(SketcherPrs_SymbolPrs) thePrs);
33 /// Deletes constraint object from internal structures. Has to be called on constraint delete.
34 /// \param thePrs a constraint presentation
35 void deleteConstraint(Handle(SketcherPrs_SymbolPrs) thePrs);
39 SketcherPrs_PositionMgr();
41 /// Returns position index of the given constraint
42 /// \param theLine constrained object
43 /// \param thePrs a presentation of constraint
44 int getPositionIndex(std::shared_ptr<GeomAPI_Shape> theLine, Handle(SketcherPrs_SymbolPrs) thePrs);
47 typedef std::map<void*, int> PositionsMap;
49 /// The map which contains position of presentation
50 PositionsMap myIndexes;
52 /// The map contains position index
53 std::map<std::shared_ptr<GeomAPI_Shape>, PositionsMap> myShapes;