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 #ifndef _BRepOffset_MakeSimpleOffset_HeaderFile
0017 #define _BRepOffset_MakeSimpleOffset_HeaderFile
0018
0019 #include <BRepTools_Modifier.hxx>
0020 #include <ShapeBuild_ReShape.hxx>
0021 #include <NCollection_DataMap.hxx>
0022 #include <Standard_Macro.hxx>
0023 #include <Standard_Real.hxx>
0024 #include <TCollection_AsciiString.hxx>
0025 #include <TopoDS_Edge.hxx>
0026 #include <TopoDS_Face.hxx>
0027 #include <TopoDS_Vertex.hxx>
0028 #include <TopoDS_Shape.hxx>
0029
0030
0031 enum BRepOffsetSimple_Status
0032 {
0033 BRepOffsetSimple_OK,
0034 BRepOffsetSimple_NullInputShape,
0035 BRepOffsetSimple_ErrorOffsetComputation,
0036 BRepOffsetSimple_ErrorWallFaceComputation,
0037 BRepOffsetSimple_ErrorInvalidNbShells,
0038 BRepOffsetSimple_ErrorNonClosedShell
0039 };
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 class BRepOffset_MakeSimpleOffset
0061 {
0062 public:
0063
0064
0065
0066 Standard_EXPORT BRepOffset_MakeSimpleOffset();
0067
0068
0069 Standard_EXPORT BRepOffset_MakeSimpleOffset(const TopoDS_Shape& theInputShape,
0070 const Standard_Real theOffsetValue);
0071
0072
0073 Standard_EXPORT void Initialize(const TopoDS_Shape& theInputShape,
0074 const Standard_Real theOffsetValue);
0075
0076
0077 Standard_EXPORT void Perform();
0078
0079
0080 Standard_EXPORT TCollection_AsciiString GetErrorMessage() const;
0081
0082
0083 BRepOffsetSimple_Status GetError() const { return myError; }
0084
0085
0086
0087 Standard_Boolean GetBuildSolidFlag() const { return myIsBuildSolid; }
0088
0089
0090 void SetBuildSolidFlag(const Standard_Boolean theBuildFlag) { myIsBuildSolid = theBuildFlag; }
0091
0092
0093 Standard_Real GetOffsetValue() const { return myOffsetValue; }
0094
0095
0096 void SetOffsetValue(const Standard_Real theOffsetValue) { myOffsetValue = theOffsetValue; }
0097
0098
0099 Standard_Real GetTolerance() const { return myTolerance; }
0100
0101
0102 void SetTolerance (const Standard_Real theValue) { myTolerance = theValue; }
0103
0104
0105 Standard_Boolean IsDone() const { return myIsDone; }
0106
0107
0108 const TopoDS_Shape& GetResultShape() const { return myResShape; }
0109
0110
0111 Standard_Real GetSafeOffset(const Standard_Real theExpectedToler);
0112
0113
0114 Standard_EXPORT const TopoDS_Shape Generated(const TopoDS_Shape& theShape) const;
0115
0116
0117 Standard_EXPORT const TopoDS_Shape Modified(const TopoDS_Shape& theShape) const;
0118
0119 protected:
0120
0121
0122 void ComputeMaxAngle();
0123
0124
0125 void Clear();
0126
0127 private:
0128
0129
0130 TopoDS_Face BuildWallFace(const TopoDS_Edge& theOrigEdge);
0131
0132
0133 Standard_Boolean BuildMissingWalls();
0134
0135
0136
0137
0138 TopoDS_Shape myInputShape;
0139
0140
0141 Standard_Real myOffsetValue;
0142
0143
0144 Standard_Real myTolerance;
0145
0146
0147 Standard_Boolean myIsBuildSolid;
0148
0149
0150
0151
0152 Standard_Real myMaxAngle;
0153
0154
0155 BRepOffsetSimple_Status myError;
0156
0157
0158 Standard_Boolean myIsDone;
0159
0160
0161
0162 NCollection_DataMap<TopoDS_Vertex, TopoDS_Edge> myMapVE;
0163
0164
0165 BRepTools_Modifier myBuilder;
0166
0167
0168 Handle(ShapeBuild_ReShape) myReShape;
0169
0170
0171
0172
0173 TopoDS_Shape myResShape;
0174
0175 };
0176
0177 #endif