Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-19 08:16:22

0001 // Created on: 1991-04-03
0002 // Created by: Remi GILET
0003 // Copyright (c) 1991-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _GccAna_CircPnt2dBisec_HeaderFile
0018 #define _GccAna_CircPnt2dBisec_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <gp_Circ2d.hxx>
0027 #include <gp_Pnt2d.hxx>
0028 #include <Standard_Real.hxx>
0029 class GccInt_Bisec;
0030 
0031 //! Describes functions for building a bisecting curve
0032 //! between a 2D circle and a point.
0033 //! A bisecting curve between a circle and a point is such a
0034 //! curve that each of its points is at the same distance from
0035 //! the circle and the point. It can be an ellipse, hyperbola,
0036 //! circle or line, depending on the relative position of the
0037 //! point and the circle. The algorithm computes all the
0038 //! elementary curves which are solutions.
0039 //! A CircPnt2dBisec object provides a framework for:
0040 //! -   defining the construction of the bisecting curves,
0041 //! -   implementing the construction algorithm, and
0042 //! -   consulting the result.
0043 class GccAna_CircPnt2dBisec
0044 {
0045 public:
0046   DEFINE_STANDARD_ALLOC
0047 
0048   //! Constructs bisecting curves between the circle Circle1 and the point Point2.
0049   Standard_EXPORT GccAna_CircPnt2dBisec(const gp_Circ2d& Circle1, const gp_Pnt2d& Point2);
0050 
0051   //! Constructs bisecting curves between the circle Circle1 and the point Point2.
0052   //! Tolerance is used.
0053   Standard_EXPORT GccAna_CircPnt2dBisec(const gp_Circ2d&    Circle1,
0054                                         const gp_Pnt2d&     Point2,
0055                                         const Standard_Real Tolerance);
0056 
0057   //! Returns true (this construction algorithm never fails).
0058   Standard_EXPORT Standard_Boolean IsDone() const;
0059 
0060   //! Returns the number of curves, representing solutions computed by this algorithm.
0061   Standard_EXPORT Standard_Integer NbSolutions() const;
0062 
0063   //! Returns the solution number Index and raises OutOfRange
0064   //! exception if Index is greater than the number of solutions.
0065   //! Exceptions
0066   //! Standard_OutOfRange if Index is less than zero or
0067   //! greater than the number of solutions computed by this algorithm.
0068   Standard_EXPORT Handle(GccInt_Bisec) ThisSolution(const Standard_Integer Index) const;
0069 
0070 protected:
0071 private:
0072   //! Defines the number and the type of solutions
0073   //! depending on input data
0074   Standard_EXPORT void DefineSolutions();
0075 
0076   Standard_Boolean WellDone;
0077   Standard_Integer NbrSol;
0078   gp_Circ2d        circle;
0079   gp_Pnt2d         point;
0080   Standard_Integer theposition;
0081   Standard_Real    myTolerance;
0082 };
0083 
0084 #endif // _GccAna_CircPnt2dBisec_HeaderFile