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
00029 #ifndef _SMESH_QUADRANGLE_2D_HXX_
00030 #define _SMESH_QUADRANGLE_2D_HXX_
00031
00032 #include "SMESH_StdMeshers.hxx"
00033
00034 #include "SMESH_2D_Algo.hxx"
00035 #include "Utils_SALOME_Exception.hxx"
00036
00037 class SMESH_Mesh;
00038 class SMESH_MesherHelper;
00039 class StdMeshers_FaceSide;
00040 class SMDS_MeshNode;
00041 struct uvPtStruct;
00042
00043
00044 enum TSideID { BOTTOM_SIDE=0, RIGHT_SIDE, TOP_SIDE, LEFT_SIDE, NB_SIDES };
00045
00046 typedef uvPtStruct UVPtStruct;
00047 typedef struct faceQuadStruct
00048 {
00049 std::vector< StdMeshers_FaceSide*> side;
00050 bool isEdgeOut[4];
00051 UVPtStruct* uv_grid;
00052 ~faceQuadStruct();
00053 } FaceQuadStruct;
00054
00055 class STDMESHERS_EXPORT StdMeshers_Quadrangle_2D: public SMESH_2D_Algo
00056 {
00057 public:
00058 StdMeshers_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen);
00059 virtual ~StdMeshers_Quadrangle_2D();
00060
00061 virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
00062 const TopoDS_Shape& aShape,
00063 SMESH_Hypothesis::Hypothesis_Status& aStatus);
00064
00065 virtual bool Compute(SMESH_Mesh& aMesh,
00066 const TopoDS_Shape& aShape);
00067
00068 virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
00069 MapShapeNbElems& aResMap);
00070
00071 FaceQuadStruct* CheckAnd2Dcompute(SMESH_Mesh& aMesh,
00072 const TopoDS_Shape& aShape,
00073 const bool CreateQuadratic);
00074
00075 protected:
00076
00077 FaceQuadStruct* CheckNbEdges(SMESH_Mesh& aMesh,
00078 const TopoDS_Shape& aShape);
00079
00080 bool CheckNbEdgesForEvaluate(SMESH_Mesh& aMesh,
00081 const TopoDS_Shape & aShape,
00082 MapShapeNbElems& aResMap,
00083 std::vector<int>& aNbNodes,
00084 bool& IsQuadratic);
00085
00086 bool SetNormalizedGrid(SMESH_Mesh& aMesh,
00087 const TopoDS_Shape& aShape,
00088 FaceQuadStruct*& quad);
00089
00090 void SplitQuad(SMESHDS_Mesh *theMeshDS,
00091 const int theFaceID,
00092 const SMDS_MeshNode* theNode1,
00093 const SMDS_MeshNode* theNode2,
00094 const SMDS_MeshNode* theNode3,
00095 const SMDS_MeshNode* theNode4);
00096
00100 bool ComputeQuadPref(SMESH_Mesh& aMesh,
00101 const TopoDS_Shape& aShape,
00102 FaceQuadStruct* quad);
00103
00104 bool EvaluateQuadPref(SMESH_Mesh& aMesh,
00105 const TopoDS_Shape& aShape,
00106 std::vector<int>& aNbNodes,
00107 MapShapeNbElems& aResMap,
00108 bool IsQuadratic);
00109
00110 UVPtStruct* LoadEdgePoints2(SMESH_Mesh& aMesh,
00111 const TopoDS_Face& F, const TopoDS_Edge& E,
00112 bool IsReverse);
00113
00114 UVPtStruct* LoadEdgePoints(SMESH_Mesh& aMesh,
00115 const TopoDS_Face& F, const TopoDS_Edge& E,
00116 double first, double last);
00117
00118 UVPtStruct* MakeEdgePoints(SMESH_Mesh& aMesh,
00119 const TopoDS_Face& F, const TopoDS_Edge& E,
00120 double first, double last, int nb_segm);
00121
00122
00123
00124
00125
00126 bool myQuadranglePreference;
00127
00128 bool myTrianglePreference;
00129
00130 int myTriaVertexID;
00131
00132 SMESH_MesherHelper* myTool;
00133 };
00134
00135 #endif