0026561: Porting CSharp wrapper to OCCT 7.0.0
[occt.git] / src / Bisector / Bisector_BisecAna.hxx
1 // Created on: 1994-05-19
2 // Created by: Yves FRICAUD
3 // Copyright (c) 1994-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 _Bisector_BisecAna_HeaderFile
18 #define _Bisector_BisecAna_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Bisector_Curve.hxx>
24 #include <Standard_Real.hxx>
25 #include <GeomAbs_JoinType.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Integer.hxx>
28 #include <GeomAbs_Shape.hxx>
29 class Geom2d_TrimmedCurve;
30 class Standard_DomainError;
31 class Standard_RangeError;
32 class Geom2d_Curve;
33 class gp_Pnt2d;
34 class gp_Vec2d;
35 class Geom2d_Point;
36 class GccInt_Bisec;
37 class Geom2d_Geometry;
38 class gp_Trsf2d;
39
40
41 class Bisector_BisecAna;
42 DEFINE_STANDARD_HANDLE(Bisector_BisecAna, Bisector_Curve)
43
44 //! This class provides the bisecting line between two
45 //! geometric elements.The elements are Circles,Lines or
46 //! Points.
47 class Bisector_BisecAna : public Bisector_Curve
48 {
49
50 public:
51
52   
53   Standard_EXPORT Bisector_BisecAna();
54   
55   //! Performs  the bisecting line  between the  curves
56   //! <Cu1> and <Cu2>.
57   //! <oncurve> is True if the point <P> is common to <Cu1>
58   //! and <Cu2>.
59   Standard_EXPORT void Perform (const Handle(Geom2d_Curve)& Cu1, const Handle(Geom2d_Curve)& Cu2, const gp_Pnt2d& P, const gp_Vec2d& V1, const gp_Vec2d& V2, const Standard_Real Sense, const GeomAbs_JoinType jointype, const Standard_Real Tolerance, const Standard_Boolean oncurve = Standard_True);
60   
61   //! Performs  the bisecting line  between the  curve
62   //! <Cu1> and the point <Pnt>.
63   //! <oncurve> is True if the point <P> is the point <Pnt>.
64   Standard_EXPORT void Perform (const Handle(Geom2d_Curve)& Cu, const Handle(Geom2d_Point)& Pnt, const gp_Pnt2d& P, const gp_Vec2d& V1, const gp_Vec2d& V2, const Standard_Real Sense, const Standard_Real Tolerance, const Standard_Boolean oncurve = Standard_True);
65   
66   //! Performs  the bisecting line  between the  curve
67   //! <Cu> and the point <Pnt>.
68   //! <oncurve> is True if the point <P> is the point <Pnt>.
69   Standard_EXPORT void Perform (const Handle(Geom2d_Point)& Pnt, const Handle(Geom2d_Curve)& Cu, const gp_Pnt2d& P, const gp_Vec2d& V1, const gp_Vec2d& V2, const Standard_Real Sense, const Standard_Real Tolerance, const Standard_Boolean oncurve = Standard_True);
70   
71   //! Performs  the bisecting line  between the two points
72   //! <Pnt1>  and <Pnt2>.
73   Standard_EXPORT void Perform (const Handle(Geom2d_Point)& Pnt1, const Handle(Geom2d_Point)& Pnt2, const gp_Pnt2d& P, const gp_Vec2d& V1, const gp_Vec2d& V2, const Standard_Real Sense, const Standard_Real Tolerance = 0.0, const Standard_Boolean oncurve = Standard_True);
74   
75   Standard_EXPORT void Init (const Handle(Geom2d_TrimmedCurve)& bisector);
76   
77   Standard_EXPORT Standard_Boolean IsExtendAtStart() const;
78   
79   Standard_EXPORT Standard_Boolean IsExtendAtEnd() const;
80   
81   //! Trim <me> by a domain defined by the curve <Cu>.
82   //! This domain is the set of the points which are
83   //! nearest from <Cu> than the extremitis of <Cu>.
84   Standard_EXPORT void SetTrim (const Handle(Geom2d_Curve)& Cu);
85   
86   //! Trim <me> by a domain defined by uf  and  ul
87   Standard_EXPORT void SetTrim (const Standard_Real uf, const Standard_Real ul);
88   
89   Standard_EXPORT void Reverse();
90   
91   Standard_EXPORT Standard_Real ReversedParameter (const Standard_Real U) const;
92   
93   //! Returns the order of continuity of the curve.
94   //! Raised if N < 0.
95   Standard_EXPORT Standard_Boolean IsCN (const Standard_Integer N) const;
96   
97   Standard_EXPORT Handle(Geom2d_Geometry) Copy() const;
98   
99   Standard_EXPORT void Transform (const gp_Trsf2d& T);
100   
101   Standard_EXPORT Standard_Real FirstParameter() const;
102   
103   Standard_EXPORT Standard_Real LastParameter() const;
104   
105   Standard_EXPORT Standard_Boolean IsClosed() const;
106   
107   Standard_EXPORT Standard_Boolean IsPeriodic() const;
108   
109   Standard_EXPORT GeomAbs_Shape Continuity() const;
110   
111   Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt2d& P) const;
112   
113   Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1) const;
114   
115   Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const;
116   
117   Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const;
118   
119   Standard_EXPORT gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const;
120   
121   Standard_EXPORT Handle(Geom2d_Curve) Geom2dCurve() const;
122   
123   Standard_EXPORT Standard_Real Parameter (const gp_Pnt2d& P) const;
124   
125   Standard_EXPORT Standard_Real ParameterOfStartPoint() const;
126   
127   Standard_EXPORT Standard_Real ParameterOfEndPoint() const;
128   
129   //! If necessary,  breaks the  curve in  intervals  of
130   //! continuity  <C1>.    And  returns   the number   of
131   //! intervals.
132   Standard_EXPORT Standard_Integer NbIntervals() const;
133   
134   //! Returns  the  first  parameter    of  the  current
135   //! interval.
136   Standard_EXPORT Standard_Real IntervalFirst (const Standard_Integer Index) const;
137   
138   //! Returns  the  last  parameter    of  the  current
139   //! interval.
140   Standard_EXPORT Standard_Real IntervalLast (const Standard_Integer Index) const;
141   
142   Standard_EXPORT void Dump (const Standard_Integer Deep = 0, const Standard_Integer Offset = 0) const;
143
144
145
146
147   DEFINE_STANDARD_RTTI(Bisector_BisecAna,Bisector_Curve)
148
149 protected:
150
151
152
153
154 private:
155
156   
157   //! Returns the distance between the point <P> and
158   //! the bisecting <Bis>.
159   Standard_EXPORT Standard_Real Distance (const gp_Pnt2d& P, const Handle(GccInt_Bisec)& Bis, const gp_Vec2d& V1, const gp_Vec2d& V2, const gp_Vec2d& VecRef, const Standard_Real Sense, Standard_Real& U, Standard_Boolean& sense, Standard_Boolean& ok, const Standard_Boolean IsBisecOfTwoLines = Standard_False);
160
161   Handle(Geom2d_TrimmedCurve) thebisector;
162
163
164 };
165
166
167
168
169
170
171
172 #endif // _Bisector_BisecAna_HeaderFile