Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:19:59

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_MakeArcOfCircle2d_HeaderFile
0018 #define _GC_MakeArcOfCircle2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GC_Root.hxx>
0025 #include <Geom2d_TrimmedCurve.hxx>
0026 
0027 class gp_Circ2d;
0028 class gp_Pnt2d;
0029 class gp_Vec2d;
0030 
0031 //! This class implements construction algorithms for arcs of circles in the plane.
0032 //! The result is a `Geom2d_TrimmedCurve`.
0033 //! A `GC_MakeArcOfCircle2d` object provides a framework for:
0034 //! - defining the construction parameters;
0035 //! - running the construction algorithm;
0036 //! - querying the construction status and the resulting arc via `Value()`.
0037 //! @note Angular parameters are expressed in radians.
0038 class GC_MakeArcOfCircle2d : public GC_Root
0039 {
0040 public:
0041   DEFINE_STANDARD_ALLOC
0042 
0043   //! Constructs an arc from angular bounds on a circle.
0044   //! @param[in] theCircle source circle
0045   //! @param[in] theAlpha1 first angle (radians)
0046   //! @param[in] theAlpha2 second angle (radians)
0047   //! @param[in] theSense orientation of resulting arc
0048   Standard_EXPORT GC_MakeArcOfCircle2d(const gp_Circ2d& theCircle,
0049                                        const double     theAlpha1,
0050                                        const double     theAlpha2,
0051                                        const bool       theSense = true);
0052 
0053   //! Constructs an arc from a point and angular bound on a circle.
0054   //! @param[in] theCircle source circle
0055   //! @param[in] thePoint point on source circle
0056   //! @param[in] theAlpha angle value (radians)
0057   //! @param[in] theSense orientation of resulting arc
0058   Standard_EXPORT GC_MakeArcOfCircle2d(const gp_Circ2d& theCircle,
0059                                        const gp_Pnt2d&  thePoint,
0060                                        const double     theAlpha,
0061                                        const bool       theSense = true);
0062 
0063   //! Constructs an arc between two points on a circle.
0064   //! @param[in] theCircle source circle
0065   //! @param[in] theP1 first point on source circle
0066   //! @param[in] theP2 second point on source circle
0067   //! @param[in] theSense orientation of resulting arc
0068   Standard_EXPORT GC_MakeArcOfCircle2d(const gp_Circ2d& theCircle,
0069                                        const gp_Pnt2d&  theP1,
0070                                        const gp_Pnt2d&  theP2,
0071                                        const bool       theSense = true);
0072 
0073   //! Constructs an arc passing through three points.
0074   //! @param[in] theP1 first point
0075   //! @param[in] theP2 intermediate point
0076   //! @param[in] theP3 last point
0077   Standard_EXPORT GC_MakeArcOfCircle2d(const gp_Pnt2d& theP1,
0078                                        const gp_Pnt2d& theP2,
0079                                        const gp_Pnt2d& theP3);
0080 
0081   //! Constructs an arc from two points and tangent vector at start point.
0082   //! @param[in] theP1 start point
0083   //! @param[in] theV tangent vector at start point
0084   //! @param[in] theP2 end point
0085   Standard_EXPORT GC_MakeArcOfCircle2d(const gp_Pnt2d& theP1,
0086                                        const gp_Vec2d& theV,
0087                                        const gp_Pnt2d& theP2);
0088 
0089   //! Returns the constructed arc of circle.
0090   //! Exceptions StdFail_NotDone if no arc of circle is constructed.
0091   //! @return resulting trimmed curve
0092   Standard_EXPORT const occ::handle<Geom2d_TrimmedCurve>& Value() const;
0093 
0094   //! Conversion operator returning the constructed object.
0095   //! @return resulting trimmed curve
0096   operator const occ::handle<Geom2d_TrimmedCurve>&() const { return Value(); }
0097 
0098 private:
0099   occ::handle<Geom2d_TrimmedCurve> TheArc;
0100 };
0101 
0102 #endif // _GC_MakeArcOfCircle2d_HeaderFile