// Created on: 1995-01-27 // Created by: Jacques GOUSSARD // Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _GeomInt_IntSS_HeaderFile #define _GeomInt_IntSS_HeaderFile #include "IntPatch_Intersection.hxx" #include "GeomInt_LineConstructor.hxx" #include "Standard_Integer.hxx" #include "Geom_Curve.hxx" #include "NCollection_Sequence.hxx" #include "Geom2d_Curve.hxx" #include "gp_Pnt.hxx" #include "NCollection_DynamicArray.hxx" class Geom_Surface; class Geom_Curve; class Geom2d_Curve; class gp_Pnt2d; class IntPatch_RLine; class Bnd_Box2d; class Adaptor3d_TopolTool; class IntPatch_WLine; class GeomInt_IntSS { public: DEFINE_STANDARD_ALLOC GeomInt_IntSS(); //! performs general intersection of two surfaces just now GeomInt_IntSS(const occ::handle& S1, const occ::handle& S2, const double Tol, const bool Approx = true, const bool ApproxS1 = false, const bool ApproxS2 = false); //! general intersection of two surfaces Standard_EXPORT void Perform(const occ::handle& S1, const occ::handle& S2, const double Tol, const bool Approx = true, const bool ApproxS1 = false, const bool ApproxS2 = false); //! intersection of adapted surfaces void Perform(const occ::handle& HS1, const occ::handle& HS2, const double Tol, const bool Approx = true, const bool ApproxS1 = false, const bool ApproxS2 = false); //! general intersection using a starting point Standard_EXPORT void Perform(const occ::handle& S1, const occ::handle& S2, const double Tol, const double U1, const double V1, const double U2, const double V2, const bool Approx = true, const bool ApproxS1 = false, const bool ApproxS2 = false); //! intersection of adapted surfaces using a starting point void Perform(const occ::handle& HS1, const occ::handle& HS2, const double Tol, const double U1, const double V1, const double U2, const double V2, const bool Approx = true, const bool ApproxS1 = false, const bool ApproxS2 = false); bool IsDone() const; double TolReached3d() const; double TolReached2d() const; int NbLines() const; Standard_EXPORT const occ::handle& Line(const int Index) const; Standard_EXPORT bool HasLineOnS1(const int Index) const; Standard_EXPORT const occ::handle& LineOnS1(const int Index) const; Standard_EXPORT bool HasLineOnS2(const int Index) const; Standard_EXPORT const occ::handle& LineOnS2(const int Index) const; int NbBoundaries() const; Standard_EXPORT const occ::handle& Boundary(const int Index) const; int NbPoints() const; gp_Pnt Point(const int Index) const; Standard_EXPORT gp_Pnt2d Pnt2d(const int Index, const bool OnFirst) const; Standard_EXPORT void SetTolFixTangents(const double aTolCheck, const double aTolAngCheck); Standard_EXPORT void TolFixTangents(double& aTolCheck, double& aTolAngCheck); //! converts RLine to Geom(2d)_Curve. Standard_EXPORT static void TreatRLine(const occ::handle& theRL, const occ::handle& theHS1, const occ::handle& theHS2, occ::handle& theC3d, occ::handle& theC2d1, occ::handle& theC2d2, double& theTolReached); //! creates 2D-curve on given surface from given 3D-curve Standard_EXPORT static void BuildPCurves(const double theFirst, const double theLast, const double theUmin, const double theUmax, const double theVmin, const double theVmax, double& theTol, const occ::handle& theSurface, const occ::handle& theCurve, occ::handle& theCurve2d); //! creates 2D-curve on given surface from given 3D-curve Standard_EXPORT static void BuildPCurves(const double f, const double l, double& Tol, const occ::handle& S, const occ::handle& C, occ::handle& C2d); //! puts into theArrayOfParameters the parameters of intersection //! points of given theC2d1 and theC2d2 curves with the boundaries //! of the source surface. Standard_EXPORT static void TrimILineOnSurfBoundaries( const occ::handle& theC2d1, const occ::handle& theC2d2, const Bnd_Box2d& theBound1, const Bnd_Box2d& theBound2, NCollection_DynamicArray& theArrayOfParameters); Standard_EXPORT static occ::handle MakeBSpline(const occ::handle& WL, const int ideb, const int ifin); Standard_EXPORT static occ::handle MakeBSpline2d( const occ::handle& theWLine, const int ideb, const int ifin, const bool onFirst); protected: Standard_EXPORT void InternalPerform(const double Tol, const bool Approx, const bool ApproxS1, const bool ApproxS2, const bool useStart, const double U1, const double V1, const double U2, const double V2); Standard_EXPORT void MakeCurve(const int Ind, const occ::handle& D1, const occ::handle& D2, const double Tol, const bool Approx, const bool Approx1, const bool Approx2); private: IntPatch_Intersection myIntersector; GeomInt_LineConstructor myLConstruct; occ::handle myHS1; occ::handle myHS2; int myNbrestr; NCollection_Sequence> sline; NCollection_Sequence> slineS1; NCollection_Sequence> slineS2; double myTolReached2d; double myTolReached3d; double myTolCheck; double myTolAngCheck; }; #include "GeomInt_IntSS.lxx" #endif // _GeomInt_IntSS_HeaderFile