42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _AIS_Circle_HeaderFile |
18 | #define _AIS_Circle_HeaderFile |
19 | |
42cf5bc1 |
20 | #include <AIS_InteractiveObject.hxx> |
42cf5bc1 |
21 | |
87432b82 |
22 | class Geom_Circle; |
42cf5bc1 |
23 | |
24 | //! Constructs circle datums to be used in construction of |
25 | //! composite shapes. |
26 | class AIS_Circle : public AIS_InteractiveObject |
27 | { |
87432b82 |
28 | DEFINE_STANDARD_RTTIEXT(AIS_Circle, AIS_InteractiveObject) |
42cf5bc1 |
29 | public: |
30 | |
42cf5bc1 |
31 | //! Initializes this algorithm for constructing AIS circle |
32 | //! datums initializes the circle aCircle |
33 | Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& aCircle); |
34 | |
35 | //! Initializes this algorithm for constructing AIS circle datums. |
36 | //! Initializes the circle theCircle, the arc |
37 | //! starting point theUStart, the arc ending point theUEnd, |
38 | //! and the type of sensitivity theIsFilledCircleSens. |
39 | Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& theCircle, const Standard_Real theUStart, const Standard_Real theUEnd, const Standard_Boolean theIsFilledCircleSens = Standard_False); |
b5163d2f |
40 | |
42cf5bc1 |
41 | //! Returns index 6 by default. |
87432b82 |
42 | virtual Standard_Integer Signature() const Standard_OVERRIDE { return 6; } |
43 | |
42cf5bc1 |
44 | //! Indicates that the type of Interactive Object is a datum. |
82b856b8 |
45 | virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; } |
87432b82 |
46 | |
42cf5bc1 |
47 | //! Returns the circle component defined in SetCircle. |
87432b82 |
48 | const Handle(Geom_Circle)& Circle() const { return myComponent; } |
42cf5bc1 |
49 | |
50 | //! Constructs instances of the starting point and the end |
87432b82 |
51 | //! point parameters, theU1 and theU2. |
52 | void Parameters (Standard_Real& theU1, Standard_Real& theU2) const |
53 | { |
54 | theU1 = myUStart; |
55 | theU2 = myUEnd; |
56 | } |
57 | |
42cf5bc1 |
58 | //! Allows you to provide settings for the circle datum aCircle. |
87432b82 |
59 | void SetCircle (const Handle(Geom_Circle)& theCircle) { myComponent = theCircle; } |
60 | |
61 | //! Allows you to set the parameter theU for the starting point of an arc. |
62 | void SetFirstParam (const Standard_Real theU) |
63 | { |
64 | myUStart = theU; |
65 | myCircleIsArc = Standard_True; |
66 | } |
67 | |
68 | //! Allows you to provide the parameter theU for the end point of an arc. |
69 | void SetLastParam (const Standard_Real theU) |
70 | { |
71 | myUEnd = theU; |
72 | myCircleIsArc = Standard_True; |
73 | } |
74 | |
42cf5bc1 |
75 | Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE; |
76 | |
77 | //! Assigns the width aValue to the solid line boundary of the circle datum. |
78 | Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE; |
79 | |
80 | //! Removes color from the solid line boundary of the circle datum. |
81 | Standard_EXPORT void UnsetColor() Standard_OVERRIDE; |
82 | |
83 | //! Removes width settings from the solid line boundary of the circle datum. |
84 | Standard_EXPORT void UnsetWidth() Standard_OVERRIDE; |
85 | |
86 | //! Returns the type of sensitivity for the circle; |
87432b82 |
87 | Standard_Boolean IsFilledCircleSens() const { return myIsFilledCircleSens; } |
88 | |
42cf5bc1 |
89 | //! Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to Standard_True |
90 | //! then the whole circle will be detectable, otherwise only the boundary of the circle. |
87432b82 |
91 | void SetFilledCircleSens (const Standard_Boolean theIsFilledCircleSens) { myIsFilledCircleSens = theIsFilledCircleSens; } |
42cf5bc1 |
92 | |
93 | private: |
94 | |
decbff0d |
95 | Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr, |
96 | const Handle(Prs3d_Presentation)& theprs, |
97 | const Standard_Integer theMode) Standard_OVERRIDE; |
98 | |
99 | Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel, |
100 | const Standard_Integer theMode) Standard_OVERRIDE; |
101 | |
42cf5bc1 |
102 | Standard_EXPORT void ComputeCircle (const Handle(Prs3d_Presentation)& aPresentation); |
decbff0d |
103 | |
42cf5bc1 |
104 | Standard_EXPORT void ComputeArc (const Handle(Prs3d_Presentation)& aPresentation); |
decbff0d |
105 | |
42cf5bc1 |
106 | Standard_EXPORT void ComputeCircleSelection (const Handle(SelectMgr_Selection)& aSelection); |
decbff0d |
107 | |
42cf5bc1 |
108 | Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection); |
109 | |
226fce20 |
110 | //! Replace aspects of already computed groups with the new value. |
111 | void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect); |
112 | |
87432b82 |
113 | private: |
114 | |
42cf5bc1 |
115 | Handle(Geom_Circle) myComponent; |
116 | Standard_Real myUStart; |
117 | Standard_Real myUEnd; |
118 | Standard_Boolean myCircleIsArc; |
119 | Standard_Boolean myIsFilledCircleSens; |
120 | |
42cf5bc1 |
121 | }; |
122 | |
87432b82 |
123 | DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject) |
42cf5bc1 |
124 | |
125 | #endif // _AIS_Circle_HeaderFile |