Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:15

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