1 // Created on: 2000-11-23
2 // Created by: Michael KLOKOV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _IntTools_Curve_HeaderFile
17 #define _IntTools_Curve_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <Standard_Real.hxx>
25 #include <GeomAbs_CurveType.hxx>
30 //! The class is a container of one 3D curve, two 2D curves and two Tolerance values.<br>
31 //! It is used in the Face/Face intersection algorithm to store the results
32 //! of intersection. In this context:<br>
33 //! **the 3D curve** is the intersection curve;<br>
34 //! **the 2D curves** are the PCurves of the 3D curve on the intersecting faces;<br>
35 //! **the tolerance** is the valid tolerance for 3D curve computed as
36 //! maximal deviation between 3D curve and 2D curves (or surfaces in case there are no 2D curves);<br>
37 //! **the tangential tolerance** is the maximal distance from 3D curve to the
38 //! end of the tangential zone between faces in terms of their tolerance values.
46 Standard_EXPORT IntTools_Curve();
48 //! Constructor taking 3d curve, two 2d curves and two tolerance values
49 Standard_EXPORT IntTools_Curve(const Handle(Geom_Curve)& the3dCurve3d,
50 const Handle(Geom2d_Curve)& the2dCurve1,
51 const Handle(Geom2d_Curve)& the2dCurve2,
52 const Standard_Real theTolerance = 0.0,
53 const Standard_Real theTangentialTolerance = 0.0);
56 void SetCurves(const Handle(Geom_Curve)& the3dCurve,
57 const Handle(Geom2d_Curve)& the2dCurve1,
58 const Handle(Geom2d_Curve)& the2dCurve2)
60 my3dCurve = the3dCurve;
61 my2dCurve1 = the2dCurve1;
62 my2dCurve2 = the2dCurve2;
66 void SetCurve(const Handle(Geom_Curve)& the3dCurve)
68 my3dCurve = the3dCurve;
71 //! Sets the first 2d curve
72 void SetFirstCurve2d(const Handle(Geom2d_Curve)& the2dCurve1)
74 my2dCurve1 = the2dCurve1;
77 //! Sets the second 2d curve
78 void SetSecondCurve2d(const Handle(Geom2d_Curve)& the2dCurve2)
80 my2dCurve2 = the2dCurve2;
83 //! Sets the tolerance for the curve
84 void SetTolerance(const Standard_Real theTolerance)
86 myTolerance = theTolerance;
89 //! Sets the tangential tolerance
90 void SetTangentialTolerance(const Standard_Real theTangentialTolerance)
92 myTangentialTolerance = theTangentialTolerance;
96 const Handle(Geom_Curve)& Curve() const
101 //! Returns first 2d curve
102 const Handle(Geom2d_Curve)& FirstCurve2d() const
107 //! Returns second 2d curve
108 const Handle(Geom2d_Curve)& SecondCurve2d() const
113 //! Returns the tolerance
114 Standard_Real Tolerance() const
119 //! Returns the tangential tolerance
120 Standard_Real TangentialTolerance() const
122 return myTangentialTolerance;
125 //! Returns TRUE if 3d curve is BoundedCurve
126 Standard_EXPORT Standard_Boolean HasBounds() const;
128 //! If the 3d curve is bounded curve the method will return TRUE
129 //! and modify the output parameters with boundary parameters of
130 //! the curve and corresponded 3d points.<br>
131 //! If the curve does not have bounds, the method will return false
132 //! and the output parameters will stay untouched.
133 Standard_EXPORT Standard_Boolean Bounds(Standard_Real& theFirst,
134 Standard_Real& theLast,
136 gp_Pnt& theLastPnt) const;
138 //! Computes 3d point corresponded to the given parameter if this
139 //! parameter is inside the boundaries of the curve.
140 //! Returns TRUE in this case. <br>
141 //! Otherwise, the point will not be computed and the method will return FALSE.
142 Standard_EXPORT Standard_Boolean D0(const Standard_Real& thePar,
143 gp_Pnt& thePnt) const;
145 //! Returns the type of the 3d curve
146 Standard_EXPORT GeomAbs_CurveType Type() const;
152 Handle(Geom_Curve) my3dCurve;
153 Handle(Geom2d_Curve) my2dCurve1;
154 Handle(Geom2d_Curve) my2dCurve2;
155 Standard_Real myTolerance;
156 Standard_Real myTangentialTolerance;
159 #endif // _IntTools_Curve_HeaderFile