Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _SMESH_HYPOTHESIS_HXX_
00029 #define _SMESH_HYPOTHESIS_HXX_
00030
00031 #include "SMESH_SMESH.hxx"
00032
00033 #include "SMESHDS_Hypothesis.hxx"
00034
00035 class SMESH_Gen;
00036 class TopoDS_Shape;
00037 class SMESH_Mesh;
00038
00039 enum MeshDimension
00040 {
00041 MeshDim_0D = 0,
00042 MeshDim_1D,
00043 MeshDim_2D,
00044 MeshDim_3D
00045 };
00046
00047 class SMESH_EXPORT SMESH_Hypothesis: public SMESHDS_Hypothesis
00048 {
00049 public:
00050 enum Hypothesis_Status
00051 {
00052 HYP_OK = 0,
00053 HYP_MISSING,
00054 HYP_CONCURENT,
00055 HYP_BAD_PARAMETER,
00056 HYP_HIDDEN_ALGO,
00057 HYP_HIDING_ALGO,
00058 HYP_UNKNOWN_FATAL,
00059
00060 HYP_INCOMPATIBLE,
00061 HYP_NOTCONFORM,
00062 HYP_ALREADY_EXIST,
00063 HYP_BAD_DIM,
00064 HYP_BAD_SUBSHAPE,
00065 HYP_BAD_GEOMETRY,
00066 HYP_NEED_SHAPE
00067 };
00068 static bool IsStatusFatal(Hypothesis_Status theStatus)
00069 { return theStatus >= HYP_UNKNOWN_FATAL; }
00070
00071 SMESH_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
00072 virtual ~SMESH_Hypothesis();
00073 virtual int GetDim() const;
00074 int GetStudyId() const;
00075 virtual void NotifySubMeshesHypothesisModification();
00076 virtual int GetShapeType() const;
00077 virtual const char* GetLibName() const;
00078 void SetLibName(const char* theLibName);
00079
00080 void SetParameters(const char *theParameters);
00081 char* GetParameters() const;
00082
00083 void SetLastParameters(const char* theParameters);
00084 char* GetLastParameters() const;
00085 void ClearParameters();
00086
00093 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape)=0;
00094
00095 struct TDefaults
00096 {
00097 double _elemLength;
00098 int _nbSegments;
00099 };
00104 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0)=0;
00105
00114 virtual bool IsAuxiliary() const
00115 { return GetType() == PARAM_ALGO && _param_algo_dim < 0; }
00116
00120 SMESH_Mesh* GetMeshByPersistentID(int id);
00121
00122 protected:
00123 SMESH_Gen* _gen;
00124 int _studyId;
00125 int _shapeType;
00126 int _param_algo_dim;
00127
00128 private:
00129 std::string _libName;
00130 std::string _parameters;
00131 std::string _lastParameters;
00132 };
00133
00134 #endif