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 /// \param theStep step between symbols
33 gp_Pnt getPosition(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs, double theStep = 20);
35 /// Deletes constraint object from internal structures. Has to be called on constraint delete.
36 /// \param thePrs a constraint presentation
37 void deleteConstraint(const SketcherPrs_SymbolPrs* thePrs);
41 SketcherPrs_PositionMgr();
43 /// Returns position index of the given constraint
44 /// \param theLine constrained object
45 /// \param thePrs a presentation of constraint
46 int getPositionIndex(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs);
49 typedef std::map<const SketcherPrs_SymbolPrs*, int> PositionsMap;
51 /// The map which contains position of presentation
52 PositionsMap myIndexes;
54 /// The map contains position index
55 std::map<ObjectPtr, PositionsMap> myShapes;