Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:14:02

0001 // Created on: 1996-08-30
0002 // Created by: Yves FRICAUD
0003 // Copyright (c) 1996-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 _BRepOffset_Inter3d_HeaderFile
0018 #define _BRepOffset_Inter3d_HeaderFile
0019 
0020 #include <Message_ProgressRange.hxx>
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024 
0025 #include <TopTools_ShapeMapHasher.hxx>
0026 #include <NCollection_IndexedMap.hxx>
0027 #include <TopoDS_Shape.hxx>
0028 #include <NCollection_List.hxx>
0029 #include <NCollection_DataMap.hxx>
0030 #include <TopAbs_State.hxx>
0031 #include <BRepOffset_Offset.hxx>
0032 class BRepAlgo_AsDes;
0033 class BRepAlgo_Image;
0034 class TopoDS_Face;
0035 class TopoDS_Shape;
0036 class BRepOffset_Analyse;
0037 
0038 //! Computes the connection of the offset and not offset faces
0039 //! according to the connection type required.
0040 //! Store the result in AsDes tool.
0041 class BRepOffset_Inter3d
0042 {
0043 public:
0044   DEFINE_STANDARD_ALLOC
0045 
0046 public:
0047   //! Constructor
0048   Standard_EXPORT BRepOffset_Inter3d(const occ::handle<BRepAlgo_AsDes>& AsDes,
0049                                      const TopAbs_State                 Side,
0050                                      const double                       Tol);
0051 
0052   // Computes intersection of the given faces among each other
0053   Standard_EXPORT void CompletInt(const NCollection_List<TopoDS_Shape>& SetOfFaces,
0054                                   const BRepAlgo_Image&                 InitOffsetFace,
0055                                   const Message_ProgressRange&          theRange);
0056 
0057   //! Computes intersection of pair of faces
0058   Standard_EXPORT void FaceInter(const TopoDS_Face&    F1,
0059                                  const TopoDS_Face&    F2,
0060                                  const BRepAlgo_Image& InitOffsetFace);
0061 
0062   //! Computes connections of the offset faces that have to be connected by arcs.
0063   Standard_EXPORT void ConnexIntByArc(const NCollection_List<TopoDS_Shape>& SetOfFaces,
0064                                       const TopoDS_Shape&                   ShapeInit,
0065                                       const BRepOffset_Analyse&             Analyse,
0066                                       const BRepAlgo_Image&                 InitOffsetFace,
0067                                       const Message_ProgressRange&          theRange);
0068 
0069   //! Computes intersection of the offset faces that have to be connected by
0070   //! sharp edges, i.e. it computes intersection between extended offset faces.
0071   Standard_EXPORT void ConnexIntByInt(
0072     const TopoDS_Shape&                                                                  SI,
0073     const NCollection_DataMap<TopoDS_Shape, BRepOffset_Offset, TopTools_ShapeMapHasher>& MapSF,
0074     const BRepOffset_Analyse&                                                            A,
0075     NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>&            MES,
0076     NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>&            Build,
0077     NCollection_List<TopoDS_Shape>&                                                      Failed,
0078     const Message_ProgressRange&                                                         theRange,
0079     const bool bIsPlanar = false);
0080 
0081   //! Computes intersection with not offset faces .
0082   Standard_EXPORT void ContextIntByInt(
0083     const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& ContextFaces,
0084     const bool                                                           ExtentContext,
0085     const NCollection_DataMap<TopoDS_Shape, BRepOffset_Offset, TopTools_ShapeMapHasher>& MapSF,
0086     const BRepOffset_Analyse&                                                            A,
0087     NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>&            MES,
0088     NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>&            Build,
0089     NCollection_List<TopoDS_Shape>&                                                      Failed,
0090     const Message_ProgressRange&                                                         theRange,
0091     const bool bIsPlanar = false);
0092 
0093   //! Computes connections of the not offset faces that have to be connected by arcs
0094   Standard_EXPORT void ContextIntByArc(
0095     const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& ContextFaces,
0096     const bool                                                           ExtentContext,
0097     const BRepOffset_Analyse&                                            Analyse,
0098     const BRepAlgo_Image&                                                InitOffsetFace,
0099     BRepAlgo_Image&                                                      InitOffsetEdge,
0100     const Message_ProgressRange&                                         theRange);
0101 
0102   //! Marks the pair of faces as already intersected
0103   Standard_EXPORT void SetDone(const TopoDS_Face& F1, const TopoDS_Face& F2);
0104 
0105   //! Checks if the pair of faces has already been treated.
0106   Standard_EXPORT bool IsDone(const TopoDS_Face& F1, const TopoDS_Face& F2) const;
0107 
0108   //! Returns touched faces
0109   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& TouchedFaces()
0110   {
0111     return myTouched;
0112   };
0113 
0114   //! Returns AsDes tool
0115   occ::handle<BRepAlgo_AsDes> AsDes() const { return myAsDes; }
0116 
0117   //! Returns new edges
0118   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& NewEdges() { return myNewEdges; }
0119 
0120 private:
0121   //! Stores the intersection results into AsDes
0122   Standard_EXPORT void Store(const TopoDS_Face&                    F1,
0123                              const TopoDS_Face&                    F2,
0124                              const NCollection_List<TopoDS_Shape>& LInt1,
0125                              const NCollection_List<TopoDS_Shape>& LInt2);
0126 
0127 private:
0128   occ::handle<BRepAlgo_AsDes>                                   myAsDes;
0129   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myTouched;
0130   NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher> myDone;
0131   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myNewEdges;
0132   TopAbs_State                                                  mySide;
0133   double                                                        myTol;
0134 };
0135 #endif // _BRepOffset_Inter3d_HeaderFile