Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:16:02

0001 // Created on: 2000-11-23
0002 // Created by: Michael KLOKOV
0003 // Copyright (c) 2000-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _IntTools_Curve_HeaderFile
0017 #define _IntTools_Curve_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <Standard_Boolean.hxx>
0024 #include <Standard_Real.hxx>
0025 #include <GeomAbs_CurveType.hxx>
0026 class Geom_Curve;
0027 class Geom2d_Curve;
0028 class gp_Pnt;
0029 
0030 //! The class is a container of one 3D curve, two 2D curves and two Tolerance values.<br>
0031 //! It is used in the Face/Face intersection algorithm to store the results
0032 //! of intersection. In this context:<br>
0033 //! **the 3D curve** is the intersection curve;<br>
0034 //! **the 2D curves** are the PCurves of the 3D curve on the intersecting faces;<br>
0035 //! **the tolerance** is the valid tolerance for 3D curve computed as
0036 //! maximal deviation between 3D curve and 2D curves (or surfaces in case there are no 2D
0037 //! curves);<br>
0038 //! **the tangential tolerance** is the maximal distance from 3D curve to the
0039 //! end of the tangential zone between faces in terms of their tolerance values.
0040 class IntTools_Curve
0041 {
0042 public:
0043   DEFINE_STANDARD_ALLOC
0044 
0045   //! Empty constructor
0046   Standard_EXPORT IntTools_Curve();
0047 
0048   //! Constructor taking 3d curve, two 2d curves and two tolerance values
0049   Standard_EXPORT IntTools_Curve(const Handle(Geom_Curve)&   the3dCurve3d,
0050                                  const Handle(Geom2d_Curve)& the2dCurve1,
0051                                  const Handle(Geom2d_Curve)& the2dCurve2,
0052                                  const Standard_Real         theTolerance           = 0.0,
0053                                  const Standard_Real         theTangentialTolerance = 0.0);
0054 
0055   //! Sets the curves
0056   void SetCurves(const Handle(Geom_Curve)&   the3dCurve,
0057                  const Handle(Geom2d_Curve)& the2dCurve1,
0058                  const Handle(Geom2d_Curve)& the2dCurve2)
0059   {
0060     my3dCurve  = the3dCurve;
0061     my2dCurve1 = the2dCurve1;
0062     my2dCurve2 = the2dCurve2;
0063   }
0064 
0065   //! Sets the 3d curve
0066   void SetCurve(const Handle(Geom_Curve)& the3dCurve) { my3dCurve = the3dCurve; }
0067 
0068   //! Sets the first 2d curve
0069   void SetFirstCurve2d(const Handle(Geom2d_Curve)& the2dCurve1) { my2dCurve1 = the2dCurve1; }
0070 
0071   //! Sets the second 2d curve
0072   void SetSecondCurve2d(const Handle(Geom2d_Curve)& the2dCurve2) { my2dCurve2 = the2dCurve2; }
0073 
0074   //! Sets the tolerance for the curve
0075   void SetTolerance(const Standard_Real theTolerance) { myTolerance = theTolerance; }
0076 
0077   //! Sets the tangential tolerance
0078   void SetTangentialTolerance(const Standard_Real theTangentialTolerance)
0079   {
0080     myTangentialTolerance = theTangentialTolerance;
0081   }
0082 
0083   //! Returns 3d curve
0084   const Handle(Geom_Curve)& Curve() const { return my3dCurve; }
0085 
0086   //! Returns first 2d curve
0087   const Handle(Geom2d_Curve)& FirstCurve2d() const { return my2dCurve1; }
0088 
0089   //! Returns second 2d curve
0090   const Handle(Geom2d_Curve)& SecondCurve2d() const { return my2dCurve2; }
0091 
0092   //! Returns the tolerance
0093   Standard_Real Tolerance() const { return myTolerance; }
0094 
0095   //! Returns the tangential tolerance
0096   Standard_Real TangentialTolerance() const { return myTangentialTolerance; }
0097 
0098   //! Returns TRUE if 3d curve is BoundedCurve
0099   Standard_EXPORT Standard_Boolean HasBounds() const;
0100 
0101   //! If the 3d curve is bounded curve the method will return TRUE
0102   //! and modify the output parameters with boundary parameters of
0103   //! the curve and corresponded 3d points.<br>
0104   //! If the curve does not have bounds, the method will return false
0105   //! and the output parameters will stay untouched.
0106   Standard_EXPORT Standard_Boolean Bounds(Standard_Real& theFirst,
0107                                           Standard_Real& theLast,
0108                                           gp_Pnt&        theFirstPnt,
0109                                           gp_Pnt&        theLastPnt) const;
0110 
0111   //! Computes 3d point corresponded to the given parameter if this
0112   //! parameter is inside the boundaries of the curve.
0113   //! Returns TRUE in this case. <br>
0114   //! Otherwise, the point will not be computed and the method will return FALSE.
0115   Standard_EXPORT Standard_Boolean D0(const Standard_Real& thePar, gp_Pnt& thePnt) const;
0116 
0117   //! Returns the type of the 3d curve
0118   Standard_EXPORT GeomAbs_CurveType Type() const;
0119 
0120 protected:
0121 private:
0122   Handle(Geom_Curve)   my3dCurve;
0123   Handle(Geom2d_Curve) my2dCurve1;
0124   Handle(Geom2d_Curve) my2dCurve2;
0125   Standard_Real        myTolerance;
0126   Standard_Real        myTangentialTolerance;
0127 };
0128 
0129 #endif // _IntTools_Curve_HeaderFile