Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:11

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 curves);<br>
0037 //! **the tangential tolerance** is the maximal distance from 3D curve to the
0038 //! end of the tangential zone between faces in terms of their tolerance values.
0039 class IntTools_Curve
0040 {
0041 public:
0042 
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)
0067   {
0068     my3dCurve = the3dCurve;
0069   }
0070 
0071   //! Sets the first 2d curve
0072   void SetFirstCurve2d(const Handle(Geom2d_Curve)& the2dCurve1)
0073   {
0074     my2dCurve1 = the2dCurve1;
0075   }
0076 
0077   //! Sets the second 2d curve
0078   void SetSecondCurve2d(const Handle(Geom2d_Curve)& the2dCurve2)
0079   {
0080     my2dCurve2 = the2dCurve2;
0081   }
0082 
0083   //! Sets the tolerance for the curve
0084   void SetTolerance(const Standard_Real theTolerance)
0085   {
0086     myTolerance = theTolerance;
0087   }
0088 
0089   //! Sets the tangential tolerance
0090   void SetTangentialTolerance(const Standard_Real theTangentialTolerance)
0091   {
0092     myTangentialTolerance = theTangentialTolerance;
0093   }
0094 
0095   //! Returns 3d curve
0096   const Handle(Geom_Curve)& Curve() const
0097   {
0098     return my3dCurve;
0099   }
0100 
0101   //! Returns first 2d curve
0102   const Handle(Geom2d_Curve)& FirstCurve2d() const
0103   {
0104     return my2dCurve1;
0105   }
0106 
0107   //! Returns second 2d curve
0108   const Handle(Geom2d_Curve)& SecondCurve2d() const
0109   {
0110     return my2dCurve2;
0111   }
0112 
0113   //! Returns the tolerance
0114   Standard_Real Tolerance() const
0115   {
0116     return myTolerance;
0117   }
0118 
0119   //! Returns the tangential tolerance
0120   Standard_Real TangentialTolerance() const
0121   {
0122     return myTangentialTolerance;
0123   }
0124 
0125   //! Returns TRUE if 3d curve is BoundedCurve
0126   Standard_EXPORT Standard_Boolean HasBounds() const;
0127 
0128   //! If the 3d curve is bounded curve the method will return TRUE
0129   //! and modify the output parameters with boundary parameters of
0130   //! the curve and corresponded 3d points.<br>
0131   //! If the curve does not have bounds, the method will return false
0132   //! and the output parameters will stay untouched.
0133   Standard_EXPORT Standard_Boolean Bounds(Standard_Real& theFirst,
0134                                           Standard_Real& theLast,
0135                                           gp_Pnt& theFirstPnt,
0136                                           gp_Pnt& theLastPnt) const;
0137 
0138   //! Computes 3d point corresponded to the given parameter if this
0139   //! parameter is inside the boundaries of the curve.
0140   //! Returns TRUE in this case. <br>
0141   //! Otherwise, the point will not be computed and the method will return FALSE.
0142   Standard_EXPORT Standard_Boolean D0(const Standard_Real& thePar,
0143                                       gp_Pnt& thePnt) const;
0144 
0145   //! Returns the type of the 3d curve
0146   Standard_EXPORT GeomAbs_CurveType Type() const;
0147 
0148 protected:
0149 
0150 private:
0151 
0152   Handle(Geom_Curve) my3dCurve;
0153   Handle(Geom2d_Curve) my2dCurve1;
0154   Handle(Geom2d_Curve) my2dCurve2;
0155   Standard_Real myTolerance;
0156   Standard_Real myTangentialTolerance;
0157 };
0158 
0159 #endif // _IntTools_Curve_HeaderFile