1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketcherPrs_SymbolPrs.h
4 // Created: 12 March 2015
5 // Author: Vitaly SMETANNIKOV
7 #ifndef SketcherPrs_SymbolPrs_H
8 #define SketcherPrs_SymbolPrs_H
10 #include <AIS_InteractiveObject.hxx>
11 #include <GeomAPI_Ax3.h>
12 #include <Graphic3d_ArrayOfPoints.hxx>
13 #include <Graphic3d_AspectMarker3d.hxx>
14 #include <Image_AlienPixMap.hxx>
16 #include <Standard_DefineHandle.hxx>
19 class SketchPlugin_Constraint;
22 DEFINE_STANDARD_HANDLE(SketcherPrs_SymbolPrs, AIS_InteractiveObject)
26 * A base class of constraint presentation which is represented by an icon
28 class SketcherPrs_SymbolPrs: public AIS_InteractiveObject
32 /// \param theConstraint a constraint feature
33 /// \param thePlane a coordinate plane of current sketch
34 Standard_EXPORT SketcherPrs_SymbolPrs(SketchPlugin_Constraint* theConstraint,
35 const std::shared_ptr<GeomAPI_Ax3>& thePlane);
37 //! Method which clear all selected owners belonging
38 //! to this selectable object ( for fast presentation draw )
39 Standard_EXPORT virtual void ClearSelected();
41 Standard_EXPORT std::shared_ptr<GeomAPI_Ax3> plane() const { return myPlane; }
43 Standard_EXPORT SketchPlugin_Constraint* feature() const { return myConstraint; }
45 DEFINE_STANDARD_RTTI(SketcherPrs_SymbolPrs)
48 /// Returns an icon file name. Has to be redefined in successors
49 virtual const char* iconName() const = 0;
51 /// Check and creates if it is necessary myAspect member.
52 /// It has to be called before the object computation
53 virtual void prepareAspect();
55 /// Returns icon corresponded to the current constraint type
56 Handle(Image_AlienPixMap) icon();
58 /// Add a line into the given group
59 /// \param theGroup a group for drawing
60 /// \param theAttrName an attribute name which corresponds to referenced line
61 void addLine(const Handle(Graphic3d_Group)& theGroup, std::string theAttrName) const;
64 /// Constraint feature
65 SketchPlugin_Constraint* myConstraint;
67 /// Plane of the current sketcher
68 std::shared_ptr<GeomAPI_Ax3> myPlane;
70 /// Aspect for entities drawing
71 Handle(Graphic3d_AspectMarker3d) myAspect;
74 /// Static map to collect constraints icons {IconName : IconPixMap}
75 static std::map<const char*, Handle(Image_AlienPixMap)> myIconsMap;