Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/GeomInt_IntSS.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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