File indexing completed on 2025-01-18 10:03:15
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
0044 class BRepOffset_MakeOffset
0045 {
0046 public:
0047
0048 DEFINE_STANDARD_ALLOC
0049
0050 Standard_EXPORT BRepOffset_MakeOffset();
0051
0052 Standard_EXPORT BRepOffset_MakeOffset(const TopoDS_Shape& S,
0053 const Standard_Real Offset,
0054 const Standard_Real Tol,
0055 const BRepOffset_Mode Mode = BRepOffset_Skin,
0056 const Standard_Boolean Intersection = Standard_False,
0057 const Standard_Boolean SelfInter = Standard_False,
0058 const GeomAbs_JoinType Join = GeomAbs_Arc,
0059 const Standard_Boolean Thickening = Standard_False,
0060 const Standard_Boolean RemoveIntEdges = Standard_False,
0061 const Message_ProgressRange& theRange = Message_ProgressRange());
0062
0063 Standard_EXPORT void Initialize (const TopoDS_Shape& S,
0064 const Standard_Real Offset,
0065 const Standard_Real Tol,
0066 const BRepOffset_Mode Mode = BRepOffset_Skin,
0067 const Standard_Boolean Intersection = Standard_False,
0068 const Standard_Boolean SelfInter = Standard_False,
0069 const GeomAbs_JoinType Join = GeomAbs_Arc,
0070 const Standard_Boolean Thickening = Standard_False,
0071 const Standard_Boolean RemoveIntEdges = Standard_False);
0072
0073 Standard_EXPORT void Clear();
0074
0075
0076 Standard_EXPORT void AllowLinearization (const Standard_Boolean theIsAllowed);
0077
0078
0079
0080 Standard_EXPORT void AddFace (const TopoDS_Face& F);
0081
0082
0083 Standard_EXPORT void SetOffsetOnFace (const TopoDS_Face& F, const Standard_Real Off);
0084
0085 Standard_EXPORT void MakeOffsetShape(const Message_ProgressRange& theRange = Message_ProgressRange());
0086
0087 Standard_EXPORT void MakeThickSolid(const Message_ProgressRange& theRange = Message_ProgressRange());
0088
0089 Standard_EXPORT const BRepOffset_Analyse& GetAnalyse() const;
0090
0091 Standard_EXPORT Standard_Boolean IsDone() const;
0092
0093 Standard_EXPORT const TopoDS_Shape& Shape() const;
0094
0095 const TopoDS_Shape& InitShape() const
0096 {
0097 return myInitialShape;
0098 }
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 TopTools_IndexedMapOfShape& ClosingFaces() const;
0116
0117
0118
0119
0120
0121
0122
0123
0124 Standard_EXPORT Standard_Boolean CheckInputData(const Message_ProgressRange& theRange);
0125
0126
0127 Standard_EXPORT const TopoDS_Shape& GetBadShape() const;
0128
0129 public:
0130
0131
0132 Standard_EXPORT const TopTools_ListOfShape& Generated (const TopoDS_Shape& theS);
0133
0134
0135 Standard_EXPORT const TopTools_ListOfShape& Modified (const TopoDS_Shape& theS);
0136
0137
0138 Standard_EXPORT Standard_Boolean IsDeleted (const TopoDS_Shape& S);
0139
0140
0141 protected:
0142
0143
0144
0145 Standard_EXPORT void analyzeProgress (const Standard_Real theWhole,
0146 TColStd_Array1OfReal& theSteps) const;
0147
0148 private:
0149
0150
0151
0152
0153 Standard_EXPORT Standard_Boolean IsPlanar();
0154
0155
0156 Standard_EXPORT void SetFaces();
0157
0158
0159 Standard_EXPORT void SetFacesWithOffset();
0160
0161 Standard_EXPORT void BuildFaceComp();
0162
0163 Standard_EXPORT void BuildOffsetByArc(const Message_ProgressRange& theRange);
0164
0165 Standard_EXPORT void BuildOffsetByInter(const Message_ProgressRange& theRange);
0166
0167
0168 Standard_EXPORT void MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF, const Message_ProgressRange& theRange);
0169
0170 Standard_EXPORT void SelfInter (TopTools_MapOfShape& Modif);
0171
0172 Standard_EXPORT void Intersection3D (BRepOffset_Inter3d& Inter, const Message_ProgressRange& theRange);
0173
0174 Standard_EXPORT void Intersection2D (const TopTools_IndexedMapOfShape& Modif,
0175 const TopTools_IndexedMapOfShape& NewEdges,
0176 const Message_ProgressRange& theRange);
0177
0178 Standard_EXPORT void MakeLoops (TopTools_IndexedMapOfShape& Modif, const Message_ProgressRange& theRange);
0179
0180 Standard_EXPORT void MakeLoopsOnContext (TopTools_MapOfShape& Modif);
0181
0182 Standard_EXPORT void MakeFaces (TopTools_IndexedMapOfShape& Modif, const Message_ProgressRange& theRange);
0183
0184 Standard_EXPORT void MakeShells(const Message_ProgressRange& theRange);
0185
0186 Standard_EXPORT void SelectShells();
0187
0188 Standard_EXPORT void EncodeRegularity();
0189
0190
0191 Standard_EXPORT void ReplaceRoots();
0192
0193 Standard_EXPORT void MakeSolid(const Message_ProgressRange& theRange);
0194
0195 Standard_EXPORT void ToContext (BRepOffset_DataMapOfShapeOffset& MapSF);
0196
0197
0198 Standard_EXPORT void UpdateFaceOffset();
0199
0200
0201 Standard_EXPORT void CorrectConicalFaces();
0202
0203
0204 Standard_EXPORT void MakeMissingWalls(const Message_ProgressRange& theRange);
0205
0206
0207 Standard_EXPORT void RemoveInternalEdges();
0208
0209
0210 Standard_EXPORT void IntersectEdges (const TopTools_ListOfShape& theFaces,
0211 BRepOffset_DataMapOfShapeOffset& theMapSF,
0212 TopTools_DataMapOfShapeShape& theMES,
0213 TopTools_DataMapOfShapeShape& theBuild,
0214 Handle(BRepAlgo_AsDes)& theAsDes,
0215 Handle(BRepAlgo_AsDes)& theAsDes2d,
0216 const Message_ProgressRange& theRange);
0217
0218
0219
0220
0221
0222 Standard_EXPORT void BuildSplitsOfExtendedFaces(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