File indexing completed on 2025-01-18 10:03:14
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
0028 Standard_EXPORT BRepMesh_IncrementalMesh();
0029
0030
0031 Standard_EXPORT virtual ~BRepMesh_IncrementalMesh();
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 Standard_EXPORT BRepMesh_IncrementalMesh(const TopoDS_Shape& theShape,
0043 const Standard_Real theLinDeflection,
0044 const Standard_Boolean isRelative = Standard_False,
0045 const Standard_Real theAngDeflection = 0.5,
0046 const Standard_Boolean isInParallel = Standard_False);
0047
0048
0049
0050
0051
0052 Standard_EXPORT BRepMesh_IncrementalMesh(const TopoDS_Shape& theShape,
0053 const IMeshTools_Parameters& theParameters,
0054 const Message_ProgressRange& theRange = Message_ProgressRange());
0055
0056
0057 Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0058
0059
0060 Standard_EXPORT void Perform(const Handle(IMeshTools_Context)& theContext,
0061 const Message_ProgressRange& theRange = Message_ProgressRange());
0062
0063 public:
0064
0065
0066 const IMeshTools_Parameters& Parameters() const
0067 {
0068 return myParameters;
0069 }
0070
0071
0072 IMeshTools_Parameters& ChangeParameters()
0073 {
0074 return myParameters;
0075 }
0076
0077
0078 Standard_Boolean IsModified() const
0079 {
0080 return myModified;
0081 }
0082
0083
0084 Standard_Integer GetStatusFlags() const
0085 {
0086 return myStatus;
0087 }
0088
0089 private:
0090
0091
0092 void initParameters()
0093 {
0094 if (myParameters.Deflection < Precision::Confusion())
0095 {
0096 throw Standard_NumericError ("BRepMesh_IncrementalMesh::initParameters : invalid parameter value");
0097 }
0098 if (myParameters.DeflectionInterior < Precision::Confusion())
0099 {
0100 myParameters.DeflectionInterior = myParameters.Deflection;
0101 }
0102
0103 if (myParameters.MinSize < Precision::Confusion())
0104 {
0105 myParameters.MinSize =
0106 Max(IMeshTools_Parameters::RelMinSize() * Min(myParameters.Deflection,
0107 myParameters.DeflectionInterior),
0108 Precision::Confusion());
0109 }
0110
0111 if (myParameters.Angle < Precision::Angular())
0112 {
0113 throw Standard_NumericError ("BRepMesh_IncrementalMesh::initParameters : invalid parameter value");
0114 }
0115 if (myParameters.AngleInterior < Precision::Angular())
0116 {
0117 myParameters.AngleInterior = 2.0 * myParameters.Angle;
0118 }
0119 }
0120
0121 public:
0122
0123
0124
0125
0126
0127
0128
0129 Standard_EXPORT static Standard_Integer Discret(const TopoDS_Shape& theShape,
0130 const Standard_Real theLinDeflection,
0131 const Standard_Real theAngDeflection,
0132 BRepMesh_DiscretRoot* &theAlgo);
0133
0134
0135
0136 Standard_EXPORT static Standard_Boolean IsParallelDefault();
0137
0138
0139
0140 Standard_EXPORT static void SetParallelDefault(const Standard_Boolean isInParallel);
0141
0142 DEFINE_STANDARD_RTTIEXT(BRepMesh_IncrementalMesh, BRepMesh_DiscretRoot)
0143
0144 protected:
0145
0146 IMeshTools_Parameters myParameters;
0147 Standard_Boolean myModified;
0148 Standard_Integer myStatus;
0149 };
0150
0151 #endif