0031431: Visualization, PrsMgr_PresentableObject - simplify HLR computing interface
[occt.git] / src / AIS / AIS_Circle.hxx
CommitLineData
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 22class Geom_Circle;
42cf5bc1 23
24//! Constructs circle datums to be used in construction of
25//! composite shapes.
26class AIS_Circle : public AIS_InteractiveObject
27{
87432b82 28 DEFINE_STANDARD_RTTIEXT(AIS_Circle, AIS_InteractiveObject)
42cf5bc1 29public:
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.
87432b82 45 virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
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
93private:
94
42cf5bc1 95 Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
96
79104795 97 Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
42cf5bc1 98
99 Standard_EXPORT void ComputeCircle (const Handle(Prs3d_Presentation)& aPresentation);
100
101 Standard_EXPORT void ComputeArc (const Handle(Prs3d_Presentation)& aPresentation);
102
103 Standard_EXPORT void ComputeCircleSelection (const Handle(SelectMgr_Selection)& aSelection);
104
105 Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
106
226fce20 107 //! Replace aspects of already computed groups with the new value.
108 void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
109
87432b82 110private:
111
42cf5bc1 112 Handle(Geom_Circle) myComponent;
113 Standard_Real myUStart;
114 Standard_Real myUEnd;
115 Standard_Boolean myCircleIsArc;
116 Standard_Boolean myIsFilledCircleSens;
117
42cf5bc1 118};
119
87432b82 120DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject)
42cf5bc1 121
122#endif // _AIS_Circle_HeaderFile