0027667: OCAF binary persistence hangs on reading truncated CBF file
[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
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
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>
31class Geom_Circle;
32class Prs3d_Presentation;
33class Prs3d_Projector;
34class Geom_Transformation;
35class Quantity_Color;
36
37
38class AIS_Circle;
39DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject)
40
41//! Constructs circle datums to be used in construction of
42//! composite shapes.
43class AIS_Circle : public AIS_InteractiveObject
44{
45
46public:
47
48
49 //! Initializes this algorithm for constructing AIS circle
50 //! datums initializes the circle aCircle
51 Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& aCircle);
52
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);
58
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;
67
68 //! Returns index 6 by default.
69 virtual Standard_Integer Signature() const Standard_OVERRIDE;
70
71 //! Indicates that the type of Interactive Object is a datum.
72 virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
73
74 //! Returns the circle component defined in SetCircle.
75 const Handle(Geom_Circle)& Circle() const;
76
77
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;
81
82 //! Allows you to provide settings for the circle datum aCircle.
83 void SetCircle (const Handle(Geom_Circle)& aCircle);
84
85 //! Allows you to set the parameter u for the starting point of an arc.
86 void SetFirstParam (const Standard_Real u);
87
88 //! Allows you to provide the parameter u for the end point of an arc.
89 void SetLastParam (const Standard_Real u);
90
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;
93
94 Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
95
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;
98
99 //! Removes color from the solid line boundary of the circle datum.
100 Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
101
102 //! Removes width settings from the solid line boundary of the circle datum.
103 Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
104
105 //! Returns the type of sensitivity for the circle;
106 Standard_Boolean IsFilledCircleSens() const;
107
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);
111
112
113
114
92efcf78 115 DEFINE_STANDARD_RTTIEXT(AIS_Circle,AIS_InteractiveObject)
42cf5bc1 116
117protected:
118
119
120
121
122private:
123
124
125 Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
126
127 Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
128
79104795 129 Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
42cf5bc1 130
131 Standard_EXPORT void ComputeCircle (const Handle(Prs3d_Presentation)& aPresentation);
132
133 Standard_EXPORT void ComputeArc (const Handle(Prs3d_Presentation)& aPresentation);
134
135 Standard_EXPORT void ComputeCircleSelection (const Handle(SelectMgr_Selection)& aSelection);
136
137 Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
138
139 Handle(Geom_Circle) myComponent;
140 Standard_Real myUStart;
141 Standard_Real myUEnd;
142 Standard_Boolean myCircleIsArc;
143 Standard_Boolean myIsFilledCircleSens;
144
145
146};
147
148
149#include <AIS_Circle.lxx>
150
151
152
153
154
155#endif // _AIS_Circle_HeaderFile