File indexing completed on 2026-09-28 09:19:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _BRepOffset_Analyse_HeaderFile
0018 #define _BRepOffset_Analyse_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022
0023 #include <TopoDS_Shape.hxx>
0024 #include <BRepOffset_Interval.hxx>
0025 #include <NCollection_List.hxx>
0026 #include <TopTools_ShapeMapHasher.hxx>
0027 #include <NCollection_DataMap.hxx>
0028 #include <NCollection_IndexedDataMap.hxx>
0029 #include <ChFiDS_TypeOfConcavity.hxx>
0030 #include <NCollection_Map.hxx>
0031
0032 #include <Message_ProgressRange.hxx>
0033
0034 class TopoDS_Edge;
0035 class TopoDS_Vertex;
0036 class TopoDS_Face;
0037 class TopoDS_Compound;
0038
0039
0040
0041 class BRepOffset_Analyse
0042 {
0043 public:
0044 DEFINE_STANDARD_ALLOC
0045
0046 public:
0047
0048 Standard_EXPORT BRepOffset_Analyse();
0049
0050
0051 Standard_EXPORT BRepOffset_Analyse(const TopoDS_Shape& theS, const double theAngle);
0052
0053 public:
0054
0055 Standard_EXPORT void Perform(const TopoDS_Shape& theS,
0056 const double theAngle,
0057 const Message_ProgressRange& theRange = Message_ProgressRange());
0058
0059 public:
0060
0061 bool IsDone() const { return myDone; }
0062
0063
0064 Standard_EXPORT const NCollection_List<BRepOffset_Interval>& Type(const TopoDS_Edge& theE) const;
0065
0066
0067
0068 Standard_EXPORT void Edges(const TopoDS_Vertex& theV,
0069 const ChFiDS_TypeOfConcavity theType,
0070 NCollection_List<TopoDS_Shape>& theL) const;
0071
0072
0073
0074 Standard_EXPORT void Edges(const TopoDS_Face& theF,
0075 const ChFiDS_TypeOfConcavity theType,
0076 NCollection_List<TopoDS_Shape>& theL) const;
0077
0078
0079
0080 Standard_EXPORT void TangentEdges(const TopoDS_Edge& theEdge,
0081 const TopoDS_Vertex& theVertex,
0082 NCollection_List<TopoDS_Shape>& theEdges) const;
0083
0084
0085 bool HasAncestor(const TopoDS_Shape& theS) const { return myAncestors.Contains(theS); }
0086
0087
0088 const NCollection_List<TopoDS_Shape>& Ancestors(const TopoDS_Shape& theS) const
0089 {
0090 return myAncestors.FindFromKey(theS);
0091 }
0092
0093
0094
0095 Standard_EXPORT void Explode(NCollection_List<TopoDS_Shape>& theL,
0096 const ChFiDS_TypeOfConcavity theType) const;
0097
0098
0099
0100 Standard_EXPORT void Explode(NCollection_List<TopoDS_Shape>& theL,
0101 const ChFiDS_TypeOfConcavity theType1,
0102 const ChFiDS_TypeOfConcavity theType2) const;
0103
0104
0105
0106 Standard_EXPORT void AddFaces(const TopoDS_Face& theFace,
0107 TopoDS_Compound& theCo,
0108 NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& theMap,
0109 const ChFiDS_TypeOfConcavity theType) const;
0110
0111
0112
0113 Standard_EXPORT void AddFaces(const TopoDS_Face& theFace,
0114 TopoDS_Compound& theCo,
0115 NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& theMap,
0116 const ChFiDS_TypeOfConcavity theType1,
0117 const ChFiDS_TypeOfConcavity theType2) const;
0118
0119 void SetOffsetValue(const double theOffset) { myOffset = theOffset; }
0120
0121
0122 void SetFaceOffsetMap(
0123 const NCollection_DataMap<TopoDS_Shape, double, TopTools_ShapeMapHasher>& theMap)
0124 {
0125 myFaceOffsetMap = theMap;
0126 }
0127
0128
0129
0130 const NCollection_List<TopoDS_Shape>& NewFaces() const { return myNewFaces; }
0131
0132
0133
0134 Standard_EXPORT TopoDS_Shape Generated(const TopoDS_Shape& theS) const;
0135
0136
0137 bool HasGenerated(const TopoDS_Shape& theS) const { return myGenerated.Seek(theS) != nullptr; }
0138
0139
0140
0141 Standard_EXPORT const TopoDS_Edge& EdgeReplacement(const TopoDS_Face& theFace,
0142 const TopoDS_Edge& theEdge) const;
0143
0144
0145 Standard_EXPORT const NCollection_List<TopoDS_Shape>* Descendants(
0146 const TopoDS_Shape& theS,
0147 const bool theUpdate = false) const;
0148
0149 public:
0150
0151 Standard_EXPORT void Clear();
0152
0153 private:
0154
0155
0156 Standard_EXPORT void TreatTangentFaces(const NCollection_List<TopoDS_Shape>& theEdges,
0157 const Message_ProgressRange& theRange);
0158
0159 private:
0160
0161 TopoDS_Shape myShape;
0162 double myAngle;
0163
0164 double myOffset;
0165 NCollection_DataMap<TopoDS_Shape, double, TopTools_ShapeMapHasher>
0166 myFaceOffsetMap;
0167
0168
0169
0170 bool myDone;
0171
0172
0173 NCollection_DataMap<TopoDS_Shape, NCollection_List<BRepOffset_Interval>, TopTools_ShapeMapHasher> myMapEdgeType;
0174 NCollection_IndexedDataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher> myAncestors;
0175 NCollection_DataMap<TopoDS_Shape,
0176 NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>,
0177 TopTools_ShapeMapHasher> myReplacement;
0178 mutable NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher> myDescendants;
0179
0180
0181 NCollection_List<TopoDS_Shape> myNewFaces;
0182
0183 NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myGenerated;
0184
0185 };
0186
0187 #endif