Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-11 08:47:29

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   DEFINE_STANDARD_ALLOC
0041 
0042   GeomInt_IntSS();
0043 
0044   //! performs general intersection of two surfaces just now
0045   GeomInt_IntSS(const Handle(Geom_Surface)& S1,
0046                 const Handle(Geom_Surface)& S2,
0047                 const Standard_Real         Tol,
0048                 const Standard_Boolean      Approx   = Standard_True,
0049                 const Standard_Boolean      ApproxS1 = Standard_False,
0050                 const Standard_Boolean      ApproxS2 = Standard_False);
0051 
0052   //! general intersection of two surfaces
0053   Standard_EXPORT void Perform(const Handle(Geom_Surface)& S1,
0054                                const Handle(Geom_Surface)& S2,
0055                                const Standard_Real         Tol,
0056                                const Standard_Boolean      Approx   = Standard_True,
0057                                const Standard_Boolean      ApproxS1 = Standard_False,
0058                                const Standard_Boolean      ApproxS2 = Standard_False);
0059 
0060   //! intersection of adapted surfaces
0061   void Perform(const Handle(GeomAdaptor_Surface)& HS1,
0062                const Handle(GeomAdaptor_Surface)& HS2,
0063                const Standard_Real                Tol,
0064                const Standard_Boolean             Approx   = Standard_True,
0065                const Standard_Boolean             ApproxS1 = Standard_False,
0066                const Standard_Boolean             ApproxS2 = Standard_False);
0067 
0068   //! general intersection using a starting point
0069   Standard_EXPORT void Perform(const Handle(Geom_Surface)& S1,
0070                                const Handle(Geom_Surface)& S2,
0071                                const Standard_Real         Tol,
0072                                const Standard_Real         U1,
0073                                const Standard_Real         V1,
0074                                const Standard_Real         U2,
0075                                const Standard_Real         V2,
0076                                const Standard_Boolean      Approx   = Standard_True,
0077                                const Standard_Boolean      ApproxS1 = Standard_False,
0078                                const Standard_Boolean      ApproxS2 = Standard_False);
0079 
0080   //! intersection of adapted surfaces using a starting point
0081   void Perform(const Handle(GeomAdaptor_Surface)& HS1,
0082                const Handle(GeomAdaptor_Surface)& HS2,
0083                const Standard_Real                Tol,
0084                const Standard_Real                U1,
0085                const Standard_Real                V1,
0086                const Standard_Real                U2,
0087                const Standard_Real                V2,
0088                const Standard_Boolean             Approx   = Standard_True,
0089                const Standard_Boolean             ApproxS1 = Standard_False,
0090                const Standard_Boolean             ApproxS2 = Standard_False);
0091 
0092   Standard_Boolean IsDone() const;
0093 
0094   Standard_Real TolReached3d() const;
0095 
0096   Standard_Real TolReached2d() const;
0097 
0098   Standard_Integer NbLines() const;
0099 
0100   Standard_EXPORT const Handle(Geom_Curve)& Line(const Standard_Integer Index) const;
0101 
0102   Standard_EXPORT Standard_Boolean HasLineOnS1(const Standard_Integer Index) const;
0103 
0104   Standard_EXPORT const Handle(Geom2d_Curve)& LineOnS1(const Standard_Integer Index) const;
0105 
0106   Standard_EXPORT Standard_Boolean HasLineOnS2(const Standard_Integer Index) const;
0107 
0108   Standard_EXPORT const Handle(Geom2d_Curve)& LineOnS2(const Standard_Integer Index) const;
0109 
0110   Standard_Integer NbBoundaries() const;
0111 
0112   Standard_EXPORT const Handle(Geom_Curve)& Boundary(const Standard_Integer Index) const;
0113 
0114   Standard_Integer NbPoints() const;
0115 
0116   gp_Pnt Point(const Standard_Integer Index) const;
0117 
0118   Standard_EXPORT gp_Pnt2d Pnt2d(const Standard_Integer Index,
0119                                  const Standard_Boolean OnFirst) const;
0120 
0121   Standard_EXPORT void SetTolFixTangents(const Standard_Real aTolCheck,
0122                                          const Standard_Real aTolAngCheck);
0123 
0124   Standard_EXPORT void TolFixTangents(Standard_Real& aTolCheck, Standard_Real& aTolAngCheck);
0125 
0126   //! converts RLine to Geom(2d)_Curve.
0127   Standard_EXPORT static void TreatRLine(const Handle(IntPatch_RLine)&      theRL,
0128                                          const Handle(GeomAdaptor_Surface)& theHS1,
0129                                          const Handle(GeomAdaptor_Surface)& theHS2,
0130                                          Handle(Geom_Curve)&                theC3d,
0131                                          Handle(Geom2d_Curve)&              theC2d1,
0132                                          Handle(Geom2d_Curve)&              theC2d2,
0133                                          Standard_Real&                     theTolReached);
0134 
0135   //! creates 2D-curve on given surface from given 3D-curve
0136   Standard_EXPORT static void BuildPCurves(const Standard_Real         theFirst,
0137                                            const Standard_Real         theLast,
0138                                            const Standard_Real         theUmin,
0139                                            const Standard_Real         theUmax,
0140                                            const Standard_Real         theVmin,
0141                                            const Standard_Real         theVmax,
0142                                            Standard_Real&              theTol,
0143                                            const Handle(Geom_Surface)& theSurface,
0144                                            const Handle(Geom_Curve)&   theCurve,
0145                                            Handle(Geom2d_Curve)&       theCurve2d);
0146 
0147   //! creates 2D-curve on given surface from given 3D-curve
0148   Standard_EXPORT static void BuildPCurves(const Standard_Real         f,
0149                                            const Standard_Real         l,
0150                                            Standard_Real&              Tol,
0151                                            const Handle(Geom_Surface)& S,
0152                                            const Handle(Geom_Curve)&   C,
0153                                            Handle(Geom2d_Curve)&       C2d);
0154 
0155   //! puts into theArrayOfParameters the parameters of intersection
0156   //! points of given theC2d1 and theC2d2 curves with the boundaries
0157   //! of the source surface.
0158   Standard_EXPORT static void TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d1,
0159                                                         const Handle(Geom2d_Curve)& theC2d2,
0160                                                         const Bnd_Box2d&            theBound1,
0161                                                         const Bnd_Box2d&            theBound2,
0162                                                         GeomInt_VectorOfReal& theArrayOfParameters);
0163 
0164   Standard_EXPORT static Handle(Geom_Curve) MakeBSpline(const Handle(IntPatch_WLine)& WL,
0165                                                         const Standard_Integer        ideb,
0166                                                         const Standard_Integer        ifin);
0167 
0168   Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakeBSpline2d(
0169     const Handle(IntPatch_WLine)& theWLine,
0170     const Standard_Integer        ideb,
0171     const Standard_Integer        ifin,
0172     const Standard_Boolean        onFirst);
0173 
0174 protected:
0175   Standard_EXPORT void InternalPerform(const Standard_Real    Tol,
0176                                        const Standard_Boolean Approx,
0177                                        const Standard_Boolean ApproxS1,
0178                                        const Standard_Boolean ApproxS2,
0179                                        const Standard_Boolean useStart,
0180                                        const Standard_Real    U1,
0181                                        const Standard_Real    V1,
0182                                        const Standard_Real    U2,
0183                                        const Standard_Real    V2);
0184 
0185   Standard_EXPORT void MakeCurve(const Standard_Integer             Ind,
0186                                  const Handle(Adaptor3d_TopolTool)& D1,
0187                                  const Handle(Adaptor3d_TopolTool)& D2,
0188                                  const Standard_Real                Tol,
0189                                  const Standard_Boolean             Approx,
0190                                  const Standard_Boolean             Approx1,
0191                                  const Standard_Boolean             Approx2);
0192 
0193 private:
0194   IntPatch_Intersection       myIntersector;
0195   GeomInt_LineConstructor     myLConstruct;
0196   Handle(GeomAdaptor_Surface) myHS1;
0197   Handle(GeomAdaptor_Surface) myHS2;
0198   Standard_Integer            myNbrestr;
0199   TColGeom_SequenceOfCurve    sline;
0200   TColGeom2d_SequenceOfCurve  slineS1;
0201   TColGeom2d_SequenceOfCurve  slineS2;
0202   Standard_Real               myTolReached2d;
0203   Standard_Real               myTolReached3d;
0204   Standard_Real               myTolCheck;
0205   Standard_Real               myTolAngCheck;
0206 };
0207 
0208 #include <GeomInt_IntSS.lxx>
0209 
0210 #endif // _GeomInt_IntSS_HeaderFile