File indexing completed on 2026-09-22 08:57:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepMesh_IncrementalMesh_HeaderFile
0015 #define _BRepMesh_IncrementalMesh_HeaderFile
0016
0017 #include <BRepMesh_DiscretRoot.hxx>
0018 #include <IMeshTools_Context.hxx>
0019 #include <Standard_NumericError.hxx>
0020
0021
0022
0023 class BRepMesh_IncrementalMesh : public BRepMesh_DiscretRoot
0024 {
0025 public:
0026
0027 Standard_EXPORT BRepMesh_IncrementalMesh();
0028
0029
0030 Standard_EXPORT ~BRepMesh_IncrementalMesh() override;
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 Standard_EXPORT BRepMesh_IncrementalMesh(const TopoDS_Shape& theShape,
0042 const double theLinDeflection,
0043 const bool isRelative = false,
0044 const double theAngDeflection = 0.5,
0045 const bool isInParallel = false);
0046
0047
0048
0049
0050
0051 Standard_EXPORT BRepMesh_IncrementalMesh(
0052 const TopoDS_Shape& theShape,
0053 const IMeshTools_Parameters& theParameters,
0054 const Message_ProgressRange& theRange = Message_ProgressRange());
0055
0056
0057 Standard_EXPORT void Perform(
0058 const Message_ProgressRange& theRange = Message_ProgressRange()) override;
0059
0060
0061 Standard_EXPORT void Perform(const occ::handle<IMeshTools_Context>& theContext,
0062 const Message_ProgressRange& theRange = Message_ProgressRange());
0063
0064 public:
0065
0066 const IMeshTools_Parameters& Parameters() const { return myParameters; }
0067
0068
0069 IMeshTools_Parameters& ChangeParameters() { return myParameters; }
0070
0071
0072 bool IsModified() const { return myModified; }
0073
0074
0075 int GetStatusFlags() const { return myStatus; }
0076
0077 private:
0078
0079 void initParameters()
0080 {
0081 if (myParameters.Deflection < Precision::Confusion())
0082 {
0083 throw Standard_NumericError(
0084 "BRepMesh_IncrementalMesh::initParameters : invalid parameter value");
0085 }
0086 if (myParameters.DeflectionInterior < Precision::Confusion())
0087 {
0088 myParameters.DeflectionInterior = myParameters.Deflection;
0089 }
0090
0091 if (myParameters.MinSize < Precision::Confusion())
0092 {
0093 myParameters.MinSize =
0094 (std::max)(IMeshTools_Parameters::RelMinSize()
0095 * (std::min)(myParameters.Deflection, myParameters.DeflectionInterior),
0096 Precision::Confusion());
0097 }
0098
0099 if (myParameters.Angle < Precision::Angular())
0100 {
0101 throw Standard_NumericError(
0102 "BRepMesh_IncrementalMesh::initParameters : invalid parameter value");
0103 }
0104 if (myParameters.AngleInterior < Precision::Angular())
0105 {
0106 myParameters.AngleInterior = 2.0 * myParameters.Angle;
0107 }
0108 }
0109
0110 public:
0111
0112
0113
0114
0115
0116
0117 Standard_EXPORT static int Discret(const TopoDS_Shape& theShape,
0118 const double theLinDeflection,
0119 const double theAngDeflection,
0120 BRepMesh_DiscretRoot*& theAlgo);
0121
0122
0123
0124 Standard_EXPORT static bool IsParallelDefault();
0125
0126
0127
0128 Standard_EXPORT static void SetParallelDefault(const bool isInParallel);
0129
0130 DEFINE_STANDARD_RTTIEXT(BRepMesh_IncrementalMesh, BRepMesh_DiscretRoot)
0131
0132 protected:
0133 IMeshTools_Parameters myParameters;
0134 bool myModified;
0135 int myStatus;
0136 };
0137
0138 #endif