1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketcherPrs_Radius.h
4 // Created: 26 March 2015
5 // Author: Vitaly SMETANNIKOV
8 #ifndef SketcherPrs_Radius_H
9 #define SketcherPrs_Radius_H
11 #include <GeomAPI_Ax3.h>
12 #include <ModelAPI_Feature.h>
14 #include <AIS_RadiusDimension.hxx>
15 #include <Standard_DefineHandle.hxx>
17 #include <SketcherPrs_DimensionStyleListener.h>
19 DEFINE_STANDARD_HANDLE(SketcherPrs_Radius, AIS_RadiusDimension)
23 * A class for representation of radius constraint
25 class SketcherPrs_Radius : public AIS_RadiusDimension
29 /// \param theConstraint a constraint feature
30 /// \param thePlane a coordinate plane of current sketch
31 Standard_EXPORT SketcherPrs_Radius(ModelAPI_Feature* theConstraint,
32 const std::shared_ptr<GeomAPI_Ax3>& thePlane);
35 Standard_EXPORT ~SketcherPrs_Radius();
37 DEFINE_STANDARD_RTTIEXT(SketcherPrs_Radius, AIS_RadiusDimension)
39 /// Returns true if the constraint feature arguments are correcly filled
40 /// to build AIS presentation
41 /// \param theConstraint a constraint feature
42 /// \param thePlane a coordinate plane of current sketch
43 /// \return boolean result value
44 static bool IsReadyToDisplay(ModelAPI_Feature* theConstraint,
45 const std::shared_ptr<GeomAPI_Ax3>& thePlane);
47 /// Fills the constraint parameters by constraint and plane
48 /// \param theConstraint a constraint feature
49 /// \param thePlane a coordinate plane of current sketch
50 /// \param theCircle a circle build on the constraint values
51 /// \param thePoint an anchor point to show text value
52 /// \return boolean result value
53 static bool readyToDisplay(ModelAPI_Feature* theConstraint,
54 const std::shared_ptr<GeomAPI_Ax3>& thePlane,
55 gp_Circ& theCircle, gp_Pnt& theAnchorPoint);
57 /// Redefinition of virtual function
58 Standard_EXPORT virtual void Compute(
59 const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
60 const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
62 /// Redefinition of virtual function
63 Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
64 const Standard_Integer aMode);
67 /// Constraint feature
68 ModelAPI_Feature* myConstraint;
70 /// Plane of the current sketcher
71 std::shared_ptr<GeomAPI_Ax3> mySketcherPlane;
73 /// Listener to update dimension visualization style
74 SketcherPrs_DimensionStyleListener* myStyleListener;
76 /// container of values obtained from the constraint, which are necessary to fill the presentation
77 gp_Circ myCircle; ///< the radius circle
78 gp_Pnt myAnchorPoint; ///< an ancor for the radius value visualization
80 SketcherPrs_DimensionStyleListener::DimensionValue myValue; /// the structure filled by constraint