Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:11

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_ListOfPntOn2S.hxx>
0023 #include <IntTools_SequenceOfCurves.hxx>
0024 #include <IntTools_SequenceOfPntOn2Faces.hxx>
0025 #include <TopoDS_Face.hxx>
0026 
0027 class IntTools_Context;
0028 class Adaptor3d_TopolTool;
0029 
0030 //! This class provides the intersection of
0031 //! face's underlying surfaces.
0032 class IntTools_FaceFace 
0033 {
0034 public:
0035 
0036   DEFINE_STANDARD_ALLOC
0037 
0038   
0039 
0040   //! Empty constructor.
0041   Standard_EXPORT IntTools_FaceFace();
0042   
0043 
0044   //! Modifier
0045   Standard_EXPORT void SetParameters (const Standard_Boolean ApproxCurves, const Standard_Boolean ComputeCurveOnS1, const Standard_Boolean ComputeCurveOnS2, const Standard_Real ApproximationTolerance);
0046   
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 Standard_Boolean theToRunParallel = Standard_False);
0054   
0055 
0056   //! Returns True if the intersection was successful
0057   Standard_EXPORT Standard_Boolean IsDone() const;
0058   
0059 
0060   //! Returns sequence of 3d curves as result of intersection
0061   Standard_EXPORT const IntTools_SequenceOfCurves& Lines() const;
0062   
0063 
0064   //! Returns sequence of 3d curves as result of intersection
0065   Standard_EXPORT const IntTools_SequenceOfPntOn2Faces& Points() const;
0066 
0067   //! Returns first of processed faces
0068   Standard_EXPORT const TopoDS_Face& Face1() const;
0069   
0070 
0071   //! Returns second of processed faces
0072   Standard_EXPORT const TopoDS_Face& Face2() const;
0073   
0074 
0075   //! Returns True if faces are tangent
0076   Standard_EXPORT Standard_Boolean TangentFaces() const;
0077 
0078   //! Provides post-processing the result lines.
0079   //! @param bToSplit [in] split the closed 3D-curves on parts when TRUE,
0080   //!                      remain untouched otherwise
0081   Standard_EXPORT void PrepareLines3D (const Standard_Boolean bToSplit = Standard_True);
0082 
0083   Standard_EXPORT void SetList (IntSurf_ListOfPntOn2S& ListOfPnts);
0084   
0085 
0086   //! Sets the intersection context
0087   Standard_EXPORT void SetContext (const Handle(IntTools_Context)& aContext);
0088 
0089   //! Sets the Fuzzy value
0090   Standard_EXPORT void SetFuzzyValue (const Standard_Real theFuzz);
0091 
0092   
0093   //! Returns Fuzzy value
0094   Standard_EXPORT Standard_Real FuzzyValue() const;
0095 
0096   //! Gets the intersection context
0097   Standard_EXPORT const Handle(IntTools_Context)& Context() const;
0098 
0099 protected:
0100 
0101   //! Creates curves from the IntPatch_Line.
0102   Standard_EXPORT void MakeCurve (const Standard_Integer Index,
0103                                   const Handle(Adaptor3d_TopolTool)& D1,
0104                                   const Handle(Adaptor3d_TopolTool)& D2,
0105                                   const Standard_Real theToler);
0106 
0107   //! Computes the valid tolerance for the intersection curves
0108   //! as a maximal deviation between 3D curve and 2D curves on faces.<br>
0109   //! If there are no 2D curves the maximal deviation between 3D curves
0110   //! and surfaces is computed.
0111   Standard_EXPORT void ComputeTolReached3d (const Standard_Boolean theToRunParallel);
0112 
0113 protected:
0114 
0115   Standard_Boolean myIsDone;
0116   IntPatch_Intersection myIntersector;
0117   GeomInt_LineConstructor myLConstruct;
0118   Handle(GeomAdaptor_Surface) myHS1;
0119   Handle(GeomAdaptor_Surface) myHS2;
0120   Standard_Integer myNbrestr;
0121   Standard_Boolean myApprox;
0122   Standard_Boolean myApprox1;
0123   Standard_Boolean myApprox2;
0124   Standard_Real myTolApprox;
0125   Standard_Real myTolF1;
0126   Standard_Real myTolF2;
0127   Standard_Real myTol;
0128   Standard_Real myFuzzyValue;
0129   IntTools_SequenceOfCurves mySeqOfCurve;
0130   Standard_Boolean myTangentFaces;
0131   TopoDS_Face myFace1;
0132   TopoDS_Face myFace2;
0133   IntTools_SequenceOfPntOn2Faces myPnts;
0134   IntSurf_ListOfPntOn2S myListOfPnts;
0135   Handle(IntTools_Context) myContext;
0136 
0137 };
0138 
0139 #endif // _IntTools_FaceFace_HeaderFile