1 // Created on: 1997-01-21
2 // Created by: Prestataire Christiane ARMAND
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _AIS_Circle_HeaderFile
18 #define _AIS_Circle_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Real.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <AIS_InteractiveObject.hxx>
26 #include <PrsMgr_PresentationManager3d.hxx>
27 #include <Standard_Integer.hxx>
28 #include <SelectMgr_Selection.hxx>
29 #include <AIS_KindOfInteractive.hxx>
30 #include <Quantity_NameOfColor.hxx>
32 class Prs3d_Presentation;
33 class Prs3d_Projector;
34 class Geom_Transformation;
39 DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject)
41 //! Constructs circle datums to be used in construction of
43 class AIS_Circle : public AIS_InteractiveObject
49 //! Initializes this algorithm for constructing AIS circle
50 //! datums initializes the circle aCircle
51 Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& aCircle);
53 //! Initializes this algorithm for constructing AIS circle datums.
54 //! Initializes the circle theCircle, the arc
55 //! starting point theUStart, the arc ending point theUEnd,
56 //! and the type of sensitivity theIsFilledCircleSens.
57 Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& theCircle, const Standard_Real theUStart, const Standard_Real theUEnd, const Standard_Boolean theIsFilledCircleSens = Standard_False);
59 //! computes the presentation according to a point of view
60 //! given by <aProjector>.
61 //! To be Used when the associated degenerated Presentations
62 //! have been transformed by <aTrsf> which is not a Pure
63 //! Translation. The HLR Prs can't be deducted automatically
64 //! WARNING :<aTrsf> must be applied
65 //! to the object to display before computation !!!
66 Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
68 //! Returns index 6 by default.
69 virtual Standard_Integer Signature() const Standard_OVERRIDE;
71 //! Indicates that the type of Interactive Object is a datum.
72 virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
74 //! Returns the circle component defined in SetCircle.
75 const Handle(Geom_Circle)& Circle() const;
78 //! Constructs instances of the starting point and the end
79 //! point parameters, u1 and u2.
80 void Parameters (Standard_Real& u1, Standard_Real& u2) const;
82 //! Allows you to provide settings for the circle datum aCircle.
83 void SetCircle (const Handle(Geom_Circle)& aCircle);
85 //! Allows you to set the parameter u for the starting point of an arc.
86 void SetFirstParam (const Standard_Real u);
88 //! Allows you to provide the parameter u for the end point of an arc.
89 void SetLastParam (const Standard_Real u);
91 //! Assigns the color aColor to the solid line boundary of the circle datum.
92 Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
94 Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
96 //! Assigns the width aValue to the solid line boundary of the circle datum.
97 Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE;
99 //! Removes color from the solid line boundary of the circle datum.
100 Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
102 //! Removes width settings from the solid line boundary of the circle datum.
103 Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
105 //! Returns the type of sensitivity for the circle;
106 Standard_Boolean IsFilledCircleSens() const;
108 //! Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to Standard_True
109 //! then the whole circle will be detectable, otherwise only the boundary of the circle.
110 void SetFilledCircleSens (const Standard_Boolean theIsFilledCircleSens);
115 DEFINE_STANDARD_RTTIEXT(AIS_Circle,AIS_InteractiveObject)
125 Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
127 Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
129 Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
131 Standard_EXPORT void ComputeCircle (const Handle(Prs3d_Presentation)& aPresentation);
133 Standard_EXPORT void ComputeArc (const Handle(Prs3d_Presentation)& aPresentation);
135 Standard_EXPORT void ComputeCircleSelection (const Handle(SelectMgr_Selection)& aSelection);
137 Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
139 Handle(Geom_Circle) myComponent;
140 Standard_Real myUStart;
141 Standard_Real myUEnd;
142 Standard_Boolean myCircleIsArc;
143 Standard_Boolean myIsFilledCircleSens;
149 #include <AIS_Circle.lxx>
155 #endif // _AIS_Circle_HeaderFile