Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:31

0001 // Created on: 1992-09-28
0002 // Created by: Remi GILET
0003 // Copyright (c) 1992-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 _GC_MakeArcOfCircle_HeaderFile
0018 #define _GC_MakeArcOfCircle_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GC_Root.hxx>
0025 #include <Geom_TrimmedCurve.hxx>
0026 
0027 class gp_Circ;
0028 class gp_Pnt;
0029 class gp_Vec;
0030 
0031 
0032 //! Implements construction algorithms for an
0033 //! arc of circle in 3D space. The result is a Geom_TrimmedCurve curve.
0034 //! A MakeArcOfCircle object provides a framework for:
0035 //! -   defining the construction of the arc of circle,
0036 //! -   implementing the construction algorithm, and
0037 //! -   consulting the results. In particular, the
0038 //! Value function returns the constructed arc of circle.
0039 class GC_MakeArcOfCircle  : public GC_Root
0040 {
0041 public:
0042 
0043   DEFINE_STANDARD_ALLOC
0044 
0045   
0046   //! Make an arc of circle (TrimmedCurve from Geom) from
0047   //! a circle between two angles Alpha1 and Alpha2
0048   //! given in radiians.
0049   Standard_EXPORT GC_MakeArcOfCircle(const gp_Circ& Circ, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Boolean Sense);
0050   
0051   //! Make an arc of circle (TrimmedCurve from Geom) from
0052   //! a circle between point <P> and the angle Alpha
0053   //! given in radians.
0054   Standard_EXPORT GC_MakeArcOfCircle(const gp_Circ& Circ, const gp_Pnt& P, const Standard_Real Alpha, const Standard_Boolean Sense);
0055   
0056   //! Make an arc of circle (TrimmedCurve from Geom) from
0057   //! a circle between two points P1 and P2.
0058   Standard_EXPORT GC_MakeArcOfCircle(const gp_Circ& Circ, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Boolean Sense);
0059   
0060   //! Make an arc of circle (TrimmedCurve from Geom) from
0061   //! three points P1,P2,P3 between two points P1 and P2.
0062   Standard_EXPORT GC_MakeArcOfCircle(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
0063   
0064   //! Make an arc of circle (TrimmedCurve from Geom) from
0065   //! two points P1,P2 and the tangente to the solution at
0066   //! the point P1.
0067   //! The orientation of the arc is:
0068   //! -   the sense determined by the order of the points P1, P3 and P2;
0069   //! -   the sense defined by the vector V; or
0070   //! -   for other syntaxes:
0071   //! -   the sense of Circ if Sense is true, or
0072   //! -   the opposite sense if Sense is false.
0073   //! Note: Alpha1, Alpha2 and Alpha are angle values, given in radians.
0074   //! Warning
0075   //! If an error occurs (that is, when IsDone returns
0076   //! false), the Status function returns:
0077   //! -   gce_ConfusedPoints if:
0078   //! -   any 2 of the 3 points P1, P2 and P3 are coincident, or
0079   //! -   P1 and P2 are coincident; or
0080   //! -   gce_IntersectionError if:
0081   //! -   P1, P2 and P3 are collinear and not coincident, or
0082   //! -   the vector defined by the points P1 and
0083   //! P2 is collinear with the vector V.
0084   Standard_EXPORT GC_MakeArcOfCircle(const gp_Pnt& P1, const gp_Vec& V, const gp_Pnt& P2);
0085   
0086   //! Returns the constructed arc of circle.
0087   //! Exceptions StdFail_NotDone if no arc of circle is constructed.
0088   Standard_EXPORT const Handle(Geom_TrimmedCurve)& Value() const;
0089 
0090   operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
0091 
0092 private:
0093   Handle(Geom_TrimmedCurve) TheArc;
0094 };
0095 
0096 #endif // _GC_MakeArcOfCircle_HeaderFile