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