0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / GccAna / GccAna_Lin2dBisec.hxx
1 // Created on: 1991-04-03
2 // Created by: Remi GILET
3 // Copyright (c) 1991-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 _GccAna_Lin2dBisec_HeaderFile
18 #define _GccAna_Lin2dBisec_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <Standard_Integer.hxx>
24 #include <TColgp_Array1OfLin2d.hxx>
25 #include <TColgp_Array1OfPnt2d.hxx>
26 #include <TColStd_Array1OfReal.hxx>
27 class gp_Lin2d;
28 class gp_Pnt2d;
29
30
31 //! Describes functions for building bisecting lines between two 2D lines.
32 //! A bisecting line between two lines is such that each of its
33 //! points is at the same distance from the two lines.
34 //! If the two lines are secant, there are two orthogonal
35 //! bisecting lines which share the angles made by the two
36 //! straight lines in two equal parts. If D1 and D2 are the
37 //! unit vectors of the two straight lines, those of the two
38 //! bisecting lines are collinear with the following vectors:
39 //! -   D1 + D2 for the "internal" bisecting line,
40 //! -   D1 - D2 for the "external" bisecting line.
41 //! If the two lines are parallel, the (unique) bisecting line is
42 //! the straight line equidistant from the two straight lines. If
43 //! the two straight lines are coincident, the algorithm
44 //! returns the first straight line as the solution.
45 //! A Lin2dTanObl object provides a framework for:
46 //! -   defining the construction of the bisecting lines,
47 //! -   implementing the construction algorithm, and
48 //! -   consulting the result.
49 class GccAna_Lin2dBisec 
50 {
51 public:
52
53   DEFINE_STANDARD_ALLOC
54
55   
56   //! Constructs bisecting lines between the two lines Lin1 and Lin2.
57   Standard_EXPORT GccAna_Lin2dBisec(const gp_Lin2d& Lin1, const gp_Lin2d& Lin2);
58   
59   //! Returns True when the algorithm succeeded.
60   Standard_EXPORT Standard_Boolean IsDone() const;
61   
62   //! Returns the number of solutions and raise NotDone if
63   //! the constructor wasn't called before.
64   Standard_EXPORT Standard_Integer NbSolutions() const;
65   
66   //! Returns the solution number Index .
67   //! The first solution is the inside one and the second is the
68   //! outside one.
69   //! For the first solution the direction is D1+D2 (D1 is
70   //! the direction of the first argument and D2 the
71   //! direction of the second argument).
72   //! For the second solution the direction is D1-D2.
73   //! Raises NotDone if the construction algorithm
74   //! didn't succeed.
75   //! It raises OutOfRange if Index is greater than the
76   //! number of solutions.
77   Standard_EXPORT gp_Lin2d ThisSolution (const Standard_Integer Index) const;
78   
79   //! Returns information about the intersection point between
80   //! the result number Index and the first argument.
81   //! Raises NotDone if the construction algorithm  didn't succeed.
82   //! It raises OutOfRange if Index is greater than the
83   //! number of solutions.
84   Standard_EXPORT void Intersection1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
85   
86   //! Returns information about the intersection point between
87   //! the result number Index and the second argument.
88   //! Raises NotDone if the construction algorithm
89   //! didn't succeed.
90   //! It raises OutOfRange if Index is greater than the
91   //! number of solutions.
92   Standard_EXPORT void Intersection2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
93
94
95
96
97 protected:
98
99
100
101
102
103 private:
104
105
106
107   Standard_Boolean WellDone;
108   Standard_Integer NbrSol;
109   TColgp_Array1OfLin2d linsol;
110   TColgp_Array1OfPnt2d pntint1sol;
111   TColgp_Array1OfPnt2d pntint2sol;
112   TColStd_Array1OfReal par1sol;
113   TColStd_Array1OfReal par2sol;
114   TColStd_Array1OfReal pararg1;
115   TColStd_Array1OfReal pararg2;
116
117
118 };
119
120
121
122
123
124
125
126 #endif // _GccAna_Lin2dBisec_HeaderFile