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