Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/TopOpeBRep_FacesIntersector.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: 1994-10-11
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1994-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 _TopOpeBRep_FacesIntersector_HeaderFile
0018 #define _TopOpeBRep_FacesIntersector_HeaderFile
0019 
0020 #include <BRepAdaptor_Surface.hxx>
0021 #include <GeomAbs_SurfaceType.hxx>
0022 #include <IntPatch_Intersection.hxx>
0023 #include <TopAbs_ShapeEnum.hxx>
0024 #include <TopOpeBRep_LineInter.hxx>
0025 #include <NCollection_Array1.hxx>
0026 #include <NCollection_HArray1.hxx>
0027 #include <TopoDS_Face.hxx>
0028 #include <TopTools_ShapeMapHasher.hxx>
0029 #include <NCollection_IndexedMap.hxx>
0030 
0031 class BRepTopAdaptor_TopolTool;
0032 class Bnd_Box;
0033 
0034 //! Describes the intersection of two faces.
0035 class TopOpeBRep_FacesIntersector
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   Standard_EXPORT TopOpeBRep_FacesIntersector();
0041 
0042   //! Computes the intersection of faces S1 and S2.
0043   Standard_EXPORT void Perform(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
0044 
0045   //! Computes the intersection of faces S1 and S2.
0046   Standard_EXPORT void Perform(const TopoDS_Shape& S1,
0047                                const TopoDS_Shape& S2,
0048                                const Bnd_Box&      B1,
0049                                const Bnd_Box&      B2);
0050 
0051   Standard_EXPORT bool IsEmpty();
0052 
0053   Standard_EXPORT bool IsDone() const;
0054 
0055   //! Returns True if Perform() arguments are two faces with the
0056   //! same surface.
0057   Standard_EXPORT bool SameDomain() const;
0058 
0059   //! returns first or second intersected face.
0060   Standard_EXPORT const TopoDS_Shape& Face(const int Index) const;
0061 
0062   //! Returns True if Perform() arguments are two faces
0063   //! SameDomain() and normals on both side.
0064   //! Raise if SameDomain is False
0065   Standard_EXPORT bool SurfacesSameOriented() const;
0066 
0067   //! returns true if edge <E> is found as same as the edge
0068   //! associated with a RESTRICTION line.
0069   Standard_EXPORT bool IsRestriction(const TopoDS_Shape& E) const;
0070 
0071   //! returns the map of edges found as TopeBRepBRep_RESTRICTION
0072   Standard_EXPORT const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>&
0073                         Restrictions() const;
0074 
0075   Standard_EXPORT void PrepareLines();
0076 
0077   Standard_EXPORT occ::handle<NCollection_HArray1<TopOpeBRep_LineInter>> Lines();
0078 
0079   Standard_EXPORT int NbLines() const;
0080 
0081   Standard_EXPORT void InitLine();
0082 
0083   Standard_EXPORT bool MoreLine() const;
0084 
0085   Standard_EXPORT void NextLine();
0086 
0087   Standard_EXPORT TopOpeBRep_LineInter& CurrentLine();
0088 
0089   Standard_EXPORT int CurrentLineIndex() const;
0090 
0091   Standard_EXPORT TopOpeBRep_LineInter& ChangeLine(const int IL);
0092 
0093   //! Force the tolerance values used by the next Perform(S1,S2) call.
0094   Standard_EXPORT void ForceTolerances(const double tolarc, const double toltang);
0095 
0096   //! Return the tolerance values used in the last Perform() call
0097   //! If ForceTolerances() has been called, return the given values.
0098   //! If not, return values extracted from shapes.
0099   Standard_EXPORT void GetTolerances(double& tolarc, double& toltang) const;
0100 
0101 private:
0102   Standard_EXPORT void FindLine();
0103 
0104   Standard_EXPORT void ResetIntersection();
0105 
0106   //! extract tolerance values from shapes <S1>,<S2>,
0107   //! in order to perform intersection between <S1> and <S2>
0108   //! with tolerance values "fitting" the shape tolerances.
0109   //! (called by Perform() by default, when ForceTolerances() has not
0110   //! been called)
0111   Standard_EXPORT void ShapeTolerances(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
0112 
0113   //! returns the max tolerance of sub-shapes of type <T>
0114   //! found in shape <S>. If no such sub-shape found, return
0115   //! Precision::Intersection()
0116   //! (called by ShapeTolerances())
0117   Standard_EXPORT double ToleranceMax(const TopoDS_Shape& S, const TopAbs_ShapeEnum T) const;
0118 
0119   IntPatch_Intersection                                         myIntersector;
0120   bool                                                          myIntersectionDone;
0121   double                                                        myTol1;
0122   double                                                        myTol2;
0123   bool                                                          myForceTolerances;
0124   occ::handle<NCollection_HArray1<TopOpeBRep_LineInter>>        myHAL;
0125   TopOpeBRep_LineInter                                          myLine;
0126   int                                                           myLineIndex;
0127   bool                                                          myLineFound;
0128   int                                                           myLineNb;
0129   TopoDS_Face                                                   myFace1;
0130   TopoDS_Face                                                   myFace2;
0131   occ::handle<BRepAdaptor_Surface>                              mySurface1;
0132   occ::handle<BRepAdaptor_Surface>                              mySurface2;
0133   GeomAbs_SurfaceType                                           mySurfaceType1;
0134   GeomAbs_SurfaceType                                           mySurfaceType2;
0135   bool                                                          mySurfacesSameOriented;
0136   occ::handle<BRepTopAdaptor_TopolTool>                         myDomain1;
0137   occ::handle<BRepTopAdaptor_TopolTool>                         myDomain2;
0138   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myEdgeRestrictionMap;
0139   TopoDS_Shape                                                  myNullShape;
0140 };
0141 
0142 #endif // _TopOpeBRep_FacesIntersector_HeaderFile