File indexing completed on 2026-11-11 10:37:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _BRepOffset_MakeOffset_HeaderFile
0018 #define _BRepOffset_MakeOffset_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <TopoDS_Shape.hxx>
0025 #include <TopoDS_Compound.hxx>
0026 #include <BRepOffset_Mode.hxx>
0027 #include <GeomAbs_JoinType.hxx>
0028 #include <TopTools_ShapeMapHasher.hxx>
0029 #include <NCollection_IndexedMap.hxx>
0030 #include <BRepOffset_Analyse.hxx>
0031 #include <BRepAlgo_Image.hxx>
0032 #include <NCollection_List.hxx>
0033 #include <BRepOffset_Error.hxx>
0034 #include <BRepOffset_MakeLoops.hxx>
0035 #include <NCollection_Map.hxx>
0036 #include <BRepOffset_Offset.hxx>
0037 #include <NCollection_DataMap.hxx>
0038 #include <NCollection_Array1.hxx>
0039
0040 #include <Message_ProgressRange.hxx>
0041 class BRepAlgo_AsDes;
0042 class TopoDS_Face;
0043 class BRepOffset_Inter3d;
0044
0045 class BRepOffset_MakeOffset
0046 {
0047 public:
0048 DEFINE_STANDARD_ALLOC
0049
0050 Standard_EXPORT BRepOffset_MakeOffset();
0051
0052 Standard_EXPORT BRepOffset_MakeOffset(
0053 const TopoDS_Shape& S,
0054 const double Offset,
0055 const double Tol,
0056 const BRepOffset_Mode Mode = BRepOffset_Skin,
0057 const bool Intersection = false,
0058 const bool SelfInter = false,
0059 const GeomAbs_JoinType Join = GeomAbs_Arc,
0060 const bool Thickening = false,
0061 const bool RemoveIntEdges = false,
0062 const Message_ProgressRange& theRange = Message_ProgressRange());
0063
0064 Standard_EXPORT void Initialize(const TopoDS_Shape& S,
0065 const double Offset,
0066 const double Tol,
0067 const BRepOffset_Mode Mode = BRepOffset_Skin,
0068 const bool Intersection = false,
0069 const bool SelfInter = false,
0070 const GeomAbs_JoinType Join = GeomAbs_Arc,
0071 const bool Thickening = false,
0072 const bool RemoveIntEdges = false);
0073
0074 Standard_EXPORT void Clear();
0075
0076
0077 Standard_EXPORT void AllowLinearization(const bool theIsAllowed);
0078
0079
0080
0081 Standard_EXPORT void AddFace(const TopoDS_Face& F);
0082
0083
0084 Standard_EXPORT void SetOffsetOnFace(const TopoDS_Face& F, const double Off);
0085
0086 Standard_EXPORT void MakeOffsetShape(
0087 const Message_ProgressRange& theRange = Message_ProgressRange());
0088
0089 Standard_EXPORT void MakeThickSolid(
0090 const Message_ProgressRange& theRange = Message_ProgressRange());
0091
0092 Standard_EXPORT const BRepOffset_Analyse& GetAnalyse() const;
0093
0094 Standard_EXPORT bool IsDone() const;
0095
0096 Standard_EXPORT const TopoDS_Shape& Shape() const;
0097
0098 const TopoDS_Shape& InitShape() const { return myInitialShape; }
0099
0100
0101 Standard_EXPORT BRepOffset_Error Error() const;
0102
0103
0104
0105 Standard_EXPORT const BRepAlgo_Image& OffsetFacesFromShapes() const;
0106
0107
0108 Standard_EXPORT GeomAbs_JoinType GetJoinType() const;
0109
0110
0111
0112 Standard_EXPORT const BRepAlgo_Image& OffsetEdgesFromShapes() const;
0113
0114
0115 Standard_EXPORT const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>&
0116 ClosingFaces() const;
0117
0118
0119
0120
0121
0122
0123
0124
0125 Standard_EXPORT bool CheckInputData(const Message_ProgressRange& theRange);
0126
0127
0128 Standard_EXPORT const TopoDS_Shape& GetBadShape() const;
0129
0130 public:
0131
0132 Standard_EXPORT const NCollection_List<TopoDS_Shape>& Generated(const TopoDS_Shape& theS);
0133
0134
0135 Standard_EXPORT const NCollection_List<TopoDS_Shape>& Modified(const TopoDS_Shape& theS);
0136
0137
0138 Standard_EXPORT bool IsDeleted(const TopoDS_Shape& S);
0139
0140 protected:
0141
0142
0143
0144 Standard_EXPORT void analyzeProgress(const double theWhole,
0145 NCollection_Array1<double>& theSteps) const;
0146
0147 private:
0148
0149
0150
0151 Standard_EXPORT bool IsPlanar();
0152
0153
0154 Standard_EXPORT void SetFaces();
0155
0156
0157 Standard_EXPORT void SetFacesWithOffset();
0158
0159 Standard_EXPORT void BuildFaceComp();
0160
0161 Standard_EXPORT void BuildOffsetByArc(const Message_ProgressRange& theRange);
0162
0163 Standard_EXPORT void BuildOffsetByInter(const Message_ProgressRange& theRange);
0164
0165
0166 Standard_EXPORT void MakeOffsetFaces(
0167 NCollection_DataMap<TopoDS_Shape, BRepOffset_Offset, TopTools_ShapeMapHasher>& theMapSF,
0168 const Message_ProgressRange& theRange);
0169
0170 Standard_EXPORT void SelfInter(NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& Modif);
0171
0172 Standard_EXPORT void Intersection3D(BRepOffset_Inter3d& Inter,
0173 const Message_ProgressRange& theRange);
0174
0175 Standard_EXPORT void Intersection2D(
0176 const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& Modif,
0177 const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& NewEdges,
0178 const Message_ProgressRange& theRange);
0179
0180 Standard_EXPORT void MakeLoops(
0181 NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& Modif,
0182 const Message_ProgressRange& theRange);
0183
0184 Standard_EXPORT void MakeLoopsOnContext(
0185 NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& Modif);
0186
0187 Standard_EXPORT void MakeFaces(
0188 NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& Modif,
0189 const Message_ProgressRange& theRange);
0190
0191 Standard_EXPORT void MakeShells(const Message_ProgressRange& theRange);
0192
0193 Standard_EXPORT void SelectShells();
0194
0195 Standard_EXPORT void EncodeRegularity();
0196
0197
0198 Standard_EXPORT void ReplaceRoots();
0199
0200 Standard_EXPORT void MakeSolid(const Message_ProgressRange& theRange);
0201
0202 Standard_EXPORT void ToContext(
0203 NCollection_DataMap<TopoDS_Shape, BRepOffset_Offset, TopTools_ShapeMapHasher>& MapSF);
0204
0205
0206 Standard_EXPORT void UpdateFaceOffset();
0207
0208
0209 Standard_EXPORT void CorrectConicalFaces();
0210
0211
0212 Standard_EXPORT void MakeMissingWalls(const Message_ProgressRange& theRange);
0213
0214
0215 Standard_EXPORT void RemoveInternalEdges();
0216
0217
0218 Standard_EXPORT void IntersectEdges(
0219 const NCollection_List<TopoDS_Shape>& theFaces,
0220 NCollection_DataMap<TopoDS_Shape, BRepOffset_Offset, TopTools_ShapeMapHasher>& theMapSF,
0221 NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& theMES,
0222 NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& theBuild,
0223 occ::handle<BRepAlgo_AsDes>& theAsDes,
0224 occ::handle<BRepAlgo_AsDes>& theAsDes2d,
0225 const Message_ProgressRange& theRange);
0226
0227
0228
0229
0230
0231 Standard_EXPORT void BuildSplitsOfExtendedFaces(
0232 const NCollection_List<TopoDS_Shape>& theLF,
0233 const BRepOffset_Analyse& theAnalyse,
0234 const occ::handle<BRepAlgo_AsDes>& theAsDes,
0235 NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>&
0236 theEdgesOrigins,
0237 NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& theFacesOrigins,
0238 NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& theETrimEInf,
0239 BRepAlgo_Image& theImage,
0240 const Message_ProgressRange& theRange);
0241
0242
0243
0244 Standard_EXPORT void BuildSplitsOfTrimmedFaces(const NCollection_List<TopoDS_Shape>& theLF,
0245 const occ::handle<BRepAlgo_AsDes>& theAsDes,
0246 BRepAlgo_Image& theImage,
0247 const Message_ProgressRange& theRange);
0248
0249 double myOffset;
0250 double myTol;
0251 TopoDS_Shape myInitialShape;
0252 TopoDS_Shape myShape;
0253 TopoDS_Compound myFaceComp;
0254 BRepOffset_Mode myMode;
0255 bool myIsLinearizationAllowed;
0256 bool myInter;
0257 bool mySelfInter;
0258 GeomAbs_JoinType myJoin;
0259 bool myThickening;
0260 bool myRemoveIntEdges;
0261 NCollection_DataMap<TopoDS_Shape, double, TopTools_ShapeMapHasher> myFaceOffset;
0262 NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myFaces;
0263 NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myOriginalFaces;
0264 BRepOffset_Analyse myAnalyse;
0265 TopoDS_Shape myOffsetShape;
0266 BRepAlgo_Image myInitOffsetFace;
0267 BRepAlgo_Image myInitOffsetEdge;
0268 BRepAlgo_Image myImageOffset;
0269 BRepAlgo_Image myImageVV;
0270 NCollection_List<TopoDS_Shape> myWalls;
0271 occ::handle<BRepAlgo_AsDes> myAsDes;
0272 NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>
0273 myEdgeIntEdges;
0274 bool myDone;
0275 BRepOffset_Error myError;
0276 BRepOffset_MakeLoops myMakeLoops;
0277 bool myIsPerformSewing;
0278 bool myIsPlanar;
0279 TopoDS_Shape myBadShape;
0280 NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myFacePlanfaceMap;
0281 NCollection_List<TopoDS_Shape> myGenerated;
0282 NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> myResMap;
0283 };
0284
0285 #endif