Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1995-01-27
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1995-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 _GeomInt_IntSS_HeaderFile
0018 #define _GeomInt_IntSS_HeaderFile
0019 
0020 #include <IntPatch_Intersection.hxx>
0021 #include <GeomInt_LineConstructor.hxx>
0022 #include <Standard_Integer.hxx>
0023 #include <TColGeom_SequenceOfCurve.hxx>
0024 #include <TColGeom2d_SequenceOfCurve.hxx>
0025 #include <gp_Pnt.hxx>
0026 #include <GeomInt_VectorOfReal.hxx>
0027 
0028 class Geom_Surface;
0029 class Geom_Curve;
0030 class Geom2d_Curve;
0031 class gp_Pnt2d;
0032 class IntPatch_RLine;
0033 class Bnd_Box2d;
0034 class Adaptor3d_TopolTool;
0035 class IntPatch_WLine;
0036 
0037 class GeomInt_IntSS 
0038 {
0039 public:
0040 
0041   DEFINE_STANDARD_ALLOC
0042 
0043   
0044     GeomInt_IntSS();
0045   
0046   //! performs general intersection of two surfaces just now
0047     GeomInt_IntSS(const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
0048   
0049   //! general intersection of two surfaces
0050   Standard_EXPORT void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
0051   
0052   //! intersection of adapted surfaces
0053     void Perform (const Handle(GeomAdaptor_Surface)& HS1, const Handle(GeomAdaptor_Surface)& HS2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
0054   
0055   //! general intersection using a starting point
0056   Standard_EXPORT void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
0057   
0058   //! intersection of adapted surfaces using a starting point
0059     void Perform (const Handle(GeomAdaptor_Surface)& HS1, const Handle(GeomAdaptor_Surface)& HS2, const Standard_Real Tol, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
0060   
0061     Standard_Boolean IsDone() const;
0062   
0063     Standard_Real TolReached3d() const;
0064   
0065     Standard_Real TolReached2d() const;
0066   
0067     Standard_Integer NbLines() const;
0068   
0069   Standard_EXPORT const Handle(Geom_Curve)& Line (const Standard_Integer Index) const;
0070   
0071   Standard_EXPORT Standard_Boolean HasLineOnS1 (const Standard_Integer Index) const;
0072   
0073   Standard_EXPORT const Handle(Geom2d_Curve)& LineOnS1 (const Standard_Integer Index) const;
0074   
0075   Standard_EXPORT Standard_Boolean HasLineOnS2 (const Standard_Integer Index) const;
0076   
0077   Standard_EXPORT const Handle(Geom2d_Curve)& LineOnS2 (const Standard_Integer Index) const;
0078   
0079     Standard_Integer NbBoundaries() const;
0080   
0081   Standard_EXPORT const Handle(Geom_Curve)& Boundary (const Standard_Integer Index) const;
0082   
0083     Standard_Integer NbPoints() const;
0084   
0085     gp_Pnt Point (const Standard_Integer Index) const;
0086   
0087   Standard_EXPORT gp_Pnt2d Pnt2d (const Standard_Integer Index, const Standard_Boolean OnFirst) const;
0088   
0089   Standard_EXPORT void SetTolFixTangents (const Standard_Real aTolCheck, const Standard_Real aTolAngCheck);
0090   
0091   Standard_EXPORT void TolFixTangents (Standard_Real& aTolCheck, Standard_Real& aTolAngCheck);
0092   
0093   //! converts RLine to Geom(2d)_Curve.
0094   Standard_EXPORT static void TreatRLine (const Handle(IntPatch_RLine)& theRL, const Handle(GeomAdaptor_Surface)& theHS1, const Handle(GeomAdaptor_Surface)& theHS2, Handle(Geom_Curve)& theC3d, Handle(Geom2d_Curve)& theC2d1, Handle(Geom2d_Curve)& theC2d2, Standard_Real& theTolReached);
0095   
0096   //! creates 2D-curve on given surface from given 3D-curve
0097   Standard_EXPORT static void BuildPCurves (const Standard_Real theFirst, const Standard_Real theLast,
0098                                             const Standard_Real theUmin, const Standard_Real theUmax,
0099                                             const Standard_Real theVmin, const Standard_Real theVmax,
0100                                             Standard_Real& theTol,
0101                                             const Handle(Geom_Surface)& theSurface,
0102                                             const Handle(Geom_Curve)& theCurve,
0103                                             Handle(Geom2d_Curve)& theCurve2d);
0104 
0105   //! creates 2D-curve on given surface from given 3D-curve
0106   Standard_EXPORT static void BuildPCurves (const Standard_Real f, const Standard_Real l, Standard_Real& Tol, const Handle(Geom_Surface)& S, const Handle(Geom_Curve)& C, Handle(Geom2d_Curve)& C2d);
0107   
0108   //! puts into theArrayOfParameters the parameters of intersection
0109   //! points of given theC2d1 and theC2d2 curves with the boundaries
0110   //! of the source surface.
0111   Standard_EXPORT static void TrimILineOnSurfBoundaries (const Handle(Geom2d_Curve)& theC2d1, const Handle(Geom2d_Curve)& theC2d2, const Bnd_Box2d& theBound1, const Bnd_Box2d& theBound2, GeomInt_VectorOfReal& theArrayOfParameters);
0112 
0113   Standard_EXPORT static Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, const Standard_Integer ideb, const Standard_Integer ifin);
0114 
0115   Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine, const Standard_Integer ideb, const Standard_Integer ifin, const Standard_Boolean onFirst);
0116 
0117 protected:
0118 
0119   
0120   Standard_EXPORT void InternalPerform (const Standard_Real Tol, const Standard_Boolean Approx, const Standard_Boolean ApproxS1, const Standard_Boolean ApproxS2, const Standard_Boolean useStart, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
0121   
0122   Standard_EXPORT void MakeCurve (const Standard_Integer Ind, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Real Tol, const Standard_Boolean Approx, const Standard_Boolean Approx1, const Standard_Boolean Approx2);
0123 
0124 
0125 
0126 
0127 private:
0128 
0129 
0130 
0131   IntPatch_Intersection myIntersector;
0132   GeomInt_LineConstructor myLConstruct;
0133   Handle(GeomAdaptor_Surface) myHS1;
0134   Handle(GeomAdaptor_Surface) myHS2;
0135   Standard_Integer myNbrestr;
0136   TColGeom_SequenceOfCurve sline;
0137   TColGeom2d_SequenceOfCurve slineS1;
0138   TColGeom2d_SequenceOfCurve slineS2;
0139   Standard_Real myTolReached2d;
0140   Standard_Real myTolReached3d;
0141   Standard_Real myTolCheck;
0142   Standard_Real myTolAngCheck;
0143 
0144 
0145 };
0146 
0147 
0148 #include <GeomInt_IntSS.lxx>
0149 
0150 
0151 
0152 
0153 
0154 #endif // _GeomInt_IntSS_HeaderFile