1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketcherPrs_Coincident.h
4 // Created: 12 February 2015
5 // Author: Vitaly SMETANNIKOV
7 #ifndef SketcherPrs_Coincident_H
8 #define SketcherPrs_Coincident_H
10 #include <GeomAPI_Ax3.h>
11 #include <ModelAPI_Feature.h>
13 #include <AIS_InteractiveObject.hxx>
14 #include <Standard_DefineHandle.hxx>
17 DEFINE_STANDARD_HANDLE(SketcherPrs_Coincident, AIS_InteractiveObject)
21 * A redefinition of standard AIS Interactive Object in order to provide
22 * presentation of coincident constraint
24 class SketcherPrs_Coincident: public AIS_InteractiveObject
28 /// \param theConstraint a constraint object
29 /// \param thePlane plane of a sketch
30 Standard_EXPORT SketcherPrs_Coincident(ModelAPI_Feature* theConstraint,
31 const std::shared_ptr<GeomAPI_Ax3>& thePlane);
33 /// Defines color for the presentation
34 /// \param aColor a color object
35 Standard_EXPORT virtual void SetColor(const Quantity_Color& aColor);
37 /// Defines color for the presentation
38 /// \param aColor a color name
39 Standard_EXPORT virtual void SetColor(const Quantity_NameOfColor aColor);
41 /// Set state of the presentation, in case of custom color, the icon of the presentation is
42 /// visualized in error color.
43 /// \param theColor a custom color for object presentation
44 Standard_EXPORT void SetCustomColor(const std::vector<int>& theColor);
46 /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
47 /// \param theConstraint a constraint feature
48 /// \param thePlane a coordinate plane of current sketch
49 /// \return boolean result value
50 static bool IsReadyToDisplay(ModelAPI_Feature* theConstraint,
51 const std::shared_ptr<GeomAPI_Ax3>& thePlane);
53 DEFINE_STANDARD_RTTIEXT(SketcherPrs_Coincident, AIS_InteractiveObject)
55 /// Redefinition of virtual function
56 Standard_EXPORT virtual void Compute(
57 const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
58 const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
60 /// Redefinition of virtual function
61 Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
62 const Standard_Integer aMode) ;
65 static bool readyToDisplay(ModelAPI_Feature* theConstraint,
66 const std::shared_ptr<GeomAPI_Ax3>& thePlane,
70 ModelAPI_Feature* myConstraint;
71 std::shared_ptr<GeomAPI_Ax3> mySketcherPlane;
73 bool myIsCustomColor; /// state if the presentation is visualized in custom color
74 Quantity_Color myCustomColor; /// the color of mid ring if there is a conflict