Salome HOME
1. The incorrect behaviour fixed:
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_LengthDimension.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SketcherPrs_LengthDimension.h
4 // Created:     27 March 2015
5 // Author:      Vitaly SMETANNIKOV
6
7
8 #ifndef SketcherPrs_LinearDimension_H
9 #define SketcherPrs_LinearDimension_H
10
11 #include <GeomAPI_Ax3.h>
12 #include <AIS_LengthDimension.hxx>
13 #include <Standard_DefineHandle.hxx>
14
15
16 class SketchPlugin_Constraint;
17
18 DEFINE_STANDARD_HANDLE(SketcherPrs_LengthDimension, AIS_LengthDimension)
19
20 /**
21 * \ingroup GUI
22 * A class for representation of linear dimension constraint.
23 * It supports SketchPlugin_ConstraintLength and SketchPlugin_ConstraintDistance features.
24 */
25 class SketcherPrs_LengthDimension : public AIS_LengthDimension
26 {
27 public:
28   /// Constructor
29   /// \param theConstraint a constraint feature
30   /// \param thePlane a coordinate plane of current sketch
31   Standard_EXPORT SketcherPrs_LengthDimension(SketchPlugin_Constraint* theConstraint, 
32                         const std::shared_ptr<GeomAPI_Ax3>& thePlane);
33
34   std::string constraintType() const;
35
36   DEFINE_STANDARD_RTTI(SketcherPrs_LengthDimension)
37 protected:
38   /// Redefinition of virtual function
39   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
40     const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
41
42 private:
43   bool getPoints(gp_Pnt& thePnt1, gp_Pnt& thePnt2) const;
44
45   /// Constraint feature
46   SketchPlugin_Constraint* myConstraint;
47
48   /// Plane of the current sketcher
49   std::shared_ptr<GeomAPI_Ax3> myPlane;
50
51   Handle(Prs3d_DimensionAspect) myAspect;
52 };
53
54 #endif