Salome HOME
#1119 Confirmation box for deleting parts
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Radius.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SketcherPrs_Radius.h
4 // Created:     26 March 2015
5 // Author:      Vitaly SMETANNIKOV
6
7
8 #ifndef SketcherPrs_Radius_H
9 #define SketcherPrs_Radius_H
10
11 #include <GeomAPI_Ax3.h>
12 #include <ModelAPI_Feature.h>
13
14 #include <AIS_RadiusDimension.hxx>
15 #include <Standard_DefineHandle.hxx>
16
17 DEFINE_STANDARD_HANDLE(SketcherPrs_Radius, AIS_RadiusDimension)
18
19 /**
20 * \ingroup GUI
21 * A class for representation of radius constraint
22 */
23 class SketcherPrs_Radius : public AIS_RadiusDimension
24 {
25 public:
26   /// Constructor
27   /// \param theConstraint a constraint feature
28   /// \param thePlane a coordinate plane of current sketch
29   Standard_EXPORT SketcherPrs_Radius(ModelAPI_Feature* theConstraint, 
30                         const std::shared_ptr<GeomAPI_Ax3>& thePlane);
31
32   DEFINE_STANDARD_RTTI(SketcherPrs_Radius)
33
34   /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
35   /// \param theConstraint a constraint feature
36   /// \param thePlane a coordinate plane of current sketch
37   /// \return boolean result value
38   static bool IsReadyToDisplay(ModelAPI_Feature* theConstraint,
39                                const std::shared_ptr<GeomAPI_Ax3>& thePlane);
40 protected:
41   /// Redefinition of virtual function
42   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
43     const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
44
45   /// Redefinition of virtual function
46   Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
47     const Standard_Integer aMode);
48
49 private:
50   /// Constraint feature
51   ModelAPI_Feature* myConstraint;
52
53   /// Plane of the current sketcher
54   std::shared_ptr<GeomAPI_Ax3> myPlane;
55
56   Handle(Prs3d_DimensionAspect) myAspect;
57 };
58
59 #endif