Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:17:51

0001 // Created on: 2000-11-23
0002 // Created by: Michael KLOKOV
0003 // Copyright (c) 2000-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _IntTools_FaceFace_HeaderFile
0017 #define _IntTools_FaceFace_HeaderFile
0018 
0019 #include <GeomAdaptor_Surface.hxx>
0020 #include <GeomInt_LineConstructor.hxx>
0021 #include <IntPatch_Intersection.hxx>
0022 #include <IntSurf_PntOn2S.hxx>
0023 #include <NCollection_List.hxx>
0024 #include <IntTools_Curve.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <IntTools_PntOn2Faces.hxx>
0027 #include <TopoDS_Face.hxx>
0028 
0029 class IntTools_Context;
0030 class Adaptor3d_TopolTool;
0031 
0032 //! This class provides the intersection of
0033 //! face's underlying surfaces.
0034 class IntTools_FaceFace
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Empty constructor.
0040   Standard_EXPORT IntTools_FaceFace();
0041 
0042   //! Modifier
0043   Standard_EXPORT void SetParameters(const bool   ApproxCurves,
0044                                      const bool   ComputeCurveOnS1,
0045                                      const bool   ComputeCurveOnS2,
0046                                      const double ApproximationTolerance);
0047 
0048   //! Intersects underliing surfaces of F1 and F2
0049   //! Use sum of tolerance of F1 and F2 as intersection
0050   //! criteria
0051   Standard_EXPORT void Perform(const TopoDS_Face& F1,
0052                                const TopoDS_Face& F2,
0053                                const bool         theToRunParallel = false);
0054 
0055   //! Returns True if the intersection was successful
0056   Standard_EXPORT bool IsDone() const;
0057 
0058   //! Returns sequence of 3d curves as result of intersection
0059   Standard_EXPORT const NCollection_Sequence<IntTools_Curve>& Lines() const;
0060 
0061   //! Returns sequence of 3d curves as result of intersection
0062   Standard_EXPORT const NCollection_Sequence<IntTools_PntOn2Faces>& Points() const;
0063 
0064   //! Returns first of processed faces
0065   Standard_EXPORT const TopoDS_Face& Face1() const;
0066 
0067   //! Returns second of processed faces
0068   Standard_EXPORT const TopoDS_Face& Face2() const;
0069 
0070   //! Returns True if faces are tangent
0071   Standard_EXPORT bool TangentFaces() const;
0072 
0073   //! Provides post-processing the result lines.
0074   //! @param[in] bToSplit  split the closed 3D-curves on parts when TRUE,
0075   //!                      remain untouched otherwise
0076   Standard_EXPORT void PrepareLines3D(const bool bToSplit = true);
0077 
0078   Standard_EXPORT void SetList(NCollection_List<IntSurf_PntOn2S>& ListOfPnts);
0079 
0080   //! Sets the intersection context
0081   Standard_EXPORT void SetContext(const occ::handle<IntTools_Context>& aContext);
0082 
0083   //! Sets the Fuzzy value
0084   Standard_EXPORT void SetFuzzyValue(const double theFuzz);
0085 
0086   //! Returns Fuzzy value
0087   Standard_EXPORT double FuzzyValue() const;
0088 
0089   //! Gets the intersection context
0090   Standard_EXPORT const occ::handle<IntTools_Context>& Context() const;
0091 
0092 protected:
0093   //! Creates curves from the IntPatch_Line.
0094   Standard_EXPORT void MakeCurve(const int                               Index,
0095                                  const occ::handle<Adaptor3d_TopolTool>& D1,
0096                                  const occ::handle<Adaptor3d_TopolTool>& D2,
0097                                  const double                            theToler);
0098 
0099   //! Computes the valid tolerance for the intersection curves
0100   //! as a maximal deviation between 3D curve and 2D curves on faces.
0101   //! If there are no 2D curves the maximal deviation between 3D curves
0102   //! and surfaces is computed.
0103   Standard_EXPORT void ComputeTolReached3d(const bool theToRunParallel);
0104 
0105 protected:
0106   bool                                       myIsDone;
0107   IntPatch_Intersection                      myIntersector;
0108   GeomInt_LineConstructor                    myLConstruct;
0109   occ::handle<GeomAdaptor_Surface>           myHS1;
0110   occ::handle<GeomAdaptor_Surface>           myHS2;
0111   int                                        myNbrestr;
0112   bool                                       myApprox;
0113   bool                                       myApprox1;
0114   bool                                       myApprox2;
0115   double                                     myTolApprox;
0116   double                                     myTolF1;
0117   double                                     myTolF2;
0118   double                                     myTol;
0119   double                                     myFuzzyValue;
0120   NCollection_Sequence<IntTools_Curve>       mySeqOfCurve;
0121   bool                                       myTangentFaces;
0122   TopoDS_Face                                myFace1;
0123   TopoDS_Face                                myFace2;
0124   NCollection_Sequence<IntTools_PntOn2Faces> myPnts;
0125   NCollection_List<IntSurf_PntOn2S>          myListOfPnts;
0126   occ::handle<IntTools_Context>              myContext;
0127 };
0128 
0129 #endif // _IntTools_FaceFace_HeaderFile