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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GccAna_Lin2dBisec_HeaderFile
18 #define _GccAna_Lin2dBisec_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
23 #include <Standard_Integer.hxx>
24 #include <TColgp_Array1OfLin2d.hxx>
25 #include <TColgp_Array1OfPnt2d.hxx>
26 #include <TColStd_Array1OfReal.hxx>
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
56 //! Constructs bisecting lines between the two lines Lin1 and Lin2.
57 Standard_EXPORT GccAna_Lin2dBisec(const gp_Lin2d& Lin1, const gp_Lin2d& Lin2);
59 //! Returns True when the algorithm succeeded.
60 Standard_EXPORT Standard_Boolean IsDone() const;
62 //! Returns the number of solutions and raise NotDone if
63 //! the constructor wasn't called before.
64 Standard_EXPORT Standard_Integer NbSolutions() const;
66 //! Returns the solution number Index .
67 //! The first solution is the inside one and the second is the
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
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;
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;
86 //! Returns information about the intersection point between
87 //! the result number Index and the second argument.
88 //! Raises NotDone if the construction algorithm
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;
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;
126 #endif // _GccAna_Lin2dBisec_HeaderFile