From: Christian Van Wambeke Date: Fri, 13 Jun 2014 13:45:11 +0000 (+0200) Subject: to get sat compile ok X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7cd421c350acc972a2388b08ab910fd586799674;p=plugins%2Fghs3dplugin.git to get sat compile ok --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8800449 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*~ +*.bak +*.pyc +.nfs* +Makefile.in +aclocal.m4 +adm_local/unix/config_files/l*m4 +adm_local/unix/config_files/ltmain.sh +autom4te.cache +configure + diff --git a/adm_local/unix/config_files/check_HYBRIDPLUGIN.m4 b/adm_local/unix/config_files/check_HYBRIDPLUGIN.m4 index 05a0572..fb37f83 100755 --- a/adm_local/unix/config_files/check_HYBRIDPLUGIN.m4 +++ b/adm_local/unix/config_files/check_HYBRIDPLUGIN.m4 @@ -27,9 +27,9 @@ AC_DEFUN([CHECK_HYBRIDPLUGIN],[ HYBRIDPLUGIN_LDFLAGS="" HYBRIDPLUGIN_CXXFLAGS="" -AC_CHECKING(for GHS3dPlugin) +AC_CHECKING(for HYBRIDPlugin) -GHS3dPlugin_ok=no +HYBRIDPlugin_ok=no AC_ARG_WITH(ghs, --with-hybridPlugin=DIR root directory path of HYBRIDPLUGIN build or installation, @@ -57,7 +57,7 @@ if test "x$HYBRIDPLUGIN_DIR" = "x" ; then fi if test -f ${HYBRIDPLUGIN_DIR}/lib/salome/libHYBRIDEngine.so ; then - GHS3dPlugin_ok=yes + HYBRIDPlugin_ok=yes AC_MSG_RESULT(Using HYBRIDPLUGIN module distribution in ${HYBRIDPLUGIN_DIR}) if test "x$HYBRIDPLUGIN_ROOT_DIR" == "x" ; then @@ -72,7 +72,7 @@ else AC_MSG_WARN("Cannot find compiled HYBRIDPLUGIN module distribution") fi -AC_MSG_RESULT(for HYBRIDPLUGIN: $GHS3dPlugin_ok) +AC_MSG_RESULT(for HYBRIDPLUGIN: $HYBRIDPlugin_ok) ])dnl diff --git a/bin/VERSION.in b/bin/VERSION.in index 4fe439a..4b2c65c 100755 --- a/bin/VERSION.in +++ b/bin/VERSION.in @@ -1,3 +1,3 @@ [SALOME HYBRIDPLUGIN] : @SALOMEHYBRIDPLUGIN_VERSION@ [DEVELOPMENT] : @SALOMEHYBRIDPLUGIN_VERSION_DEV@ -[DESCRIPTION] : DISTENE TetGen-GHS3d meshing plug-in for SALOME Mesh module +[DESCRIPTION] : DISTENE MG-HYBRID meshing plug-in for SALOME Mesh module diff --git a/doc/salome/examples/hybrid_enfvert.py b/doc/salome/examples/hybrid_enfvert.py index 0c04248..c4e7be3 100644 --- a/doc/salome/examples/hybrid_enfvert.py +++ b/doc/salome/examples/hybrid_enfvert.py @@ -25,16 +25,16 @@ smesh = smeshBuilder.New(salome.myStudy) box = geompy.MakeBoxDXDYDZ(200., 200., 200.) geompy.addToStudy(box, "box") # create a mesh on the box -hybridMesh = smesh.Mesh(box,"box: Ghs3D and BLSurf mesh") +hybridMesh = smesh.Mesh(box,"box: MG-Hybrid and BLSurf mesh") # create a BLSurf algorithm for faces hybridMesh.Triangle(algo=smeshBuilder.BLSURF) # compute the mesh hybridMesh.Compute() # Make a copy of the 2D mesh -hybridMesh_wo_geometry = smesh.CopyMesh( hybridMesh, 'Ghs3D wo geometry', 0, 0) +hybridMesh_wo_geometry = smesh.CopyMesh( hybridMesh, 'MG-Hybrid wo geometry', 0, 0) -# create a Ghs3D algorithm and hypothesis and assign them to the mesh +# create a MG-Hybrid algorithm and hypothesis and assign them to the mesh HYBRID = smesh.CreateHypothesis('HYBRID_3D', 'HYBRIDEngine') HYBRID_Parameters = smesh.CreateHypothesis('HYBRID_Parameters', 'HYBRIDEngine') hybridMesh.AddHypothesis( HYBRID ) diff --git a/doc/salome/examples/hybriddemo.py b/doc/salome/examples/hybriddemo.py index d4b89f7..e3a4a2c 100644 --- a/doc/salome/examples/hybriddemo.py +++ b/doc/salome/examples/hybriddemo.py @@ -14,7 +14,7 @@ box = geompy.MakeBoxDXDYDZ(200., 200., 200.) geompy.addToStudy(box, "box") # create a mesh on the box -hybridMesh = smesh.Mesh(box,"box: Ghs3D and BLSurf mesh") +hybridMesh = smesh.Mesh(box,"box: MG-Hybrid and BLSurf mesh") # create a BLSurf algorithm for faces BLSURF = hybridMesh.Triangle(algo=smeshBuilder.BLSURF) diff --git a/doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc b/doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc index 8124192..4d7252d 100644 --- a/doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc +++ b/doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc @@ -3,7 +3,7 @@ \page hybrid_hypo_page HYBRID Parameters hypothesis \anchor hybrid_top -HYBRID Parameters hypothesis works only with Tetrahedron (HYBRID) +HYBRID Parameters hypothesis works only with MeshGems-Hybrid algorithm. This algorithm is a commercial software. To get a licence, visit http://www.distene.com/en/corp/eval-distene.html @@ -17,6 +17,8 @@ To get a licence, visit http://www.distene.com/en/corp/eval-distene.html - Name - allows to define the name of the hypothesis (HYBRID Parameters by default). +This section is obsolete... TODO!!!... + - Mesh holes - if checked, the algorithm will create mesh in the holes inside a solid shape, else only the outermost shape will be meshed. Volumic elements created within holes are bound @@ -166,7 +168,7 @@ entirely into the solid mesh. - If a group name is given, the enforced elements will be added to the group. If the group does not exist, it is created. -
See Also a sample TUI Script of the \ref tui_hybrid "creation of a Ghs3D hypothesis", including enforced vertices and meshes. +
See Also a sample TUI Script of the \ref tui_hybrid "creation of a MG-Hybrid hypothesis", including enforced vertices and meshes. \ref hybrid_top "Back to top" diff --git a/doc/salome/gui/HYBRIDPLUGIN/input/hybridplugin_python_interface.doc b/doc/salome/gui/HYBRIDPLUGIN/input/hybridplugin_python_interface.doc index 5360f15..dd43d17 100644 --- a/doc/salome/gui/HYBRIDPLUGIN/input/hybridplugin_python_interface.doc +++ b/doc/salome/gui/HYBRIDPLUGIN/input/hybridplugin_python_interface.doc @@ -14,7 +14,7 @@ Below you can see an example of usage of the HYBRIDPluginBuilder Python API for -# \ref tui_hybrid_enforced_vertices -# \ref tui_hybrid_enforced_meshes -\section tui_hybrid_basic Construction of Mesh using Ghs3D algorithm +\section tui_hybrid_basic Construction of Mesh using MG-Hybrid algorithm \anchor example_BLSURFPlugin

Example of mesh generation with HYBRID algorithm:

diff --git a/doc/salome/gui/HYBRIDPLUGIN/input/index.doc b/doc/salome/gui/HYBRIDPLUGIN/input/index.doc index 9ec6a1a..47b61c4 100644 --- a/doc/salome/gui/HYBRIDPLUGIN/input/index.doc +++ b/doc/salome/gui/HYBRIDPLUGIN/input/index.doc @@ -3,10 +3,10 @@ \mainpage Introduction to HYBRIDPLUGIN \b HYBRIDPLUGIN plugin is destined for: -- Meshing 3D geometric entities: volumes are split into tetrahedral (pyramidal) elements. +- Meshing 3D geometric entities: volumes are split into tetrahedral and hexaheral elements. - Generating 3D meshes from 2D meshes (triangles and quadrangles), working without geometrical objects. -\note HYBRIDPLUGIN plugin used HYBRID commercial mesher and require a +\note HYBRIDPLUGIN plugin used MeshGems-Hybrid commercial mesher and require a license to be used within the Mesh module. To manage parameters of the HYBRIDPLUGIN use \subpage hybrid_hypo_page and \subpage additional_hypo_page diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx index 9c646d6..1c17bc8 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx @@ -465,520 +465,6 @@ static int findShapeID(SMESH_Mesh& mesh, return meshDS->ShapeToIndex( solids(2) ); } -// //======================================================================= -// //function : countShape -// //purpose : -// //======================================================================= -// -// template < class Mesh, class Shape > -// static int countShape( Mesh* mesh, Shape shape ) { -// TopExp_Explorer expShape ( mesh->ShapeToMesh(), shape ); -// TopTools_MapOfShape mapShape; -// int nbShape = 0; -// for ( ; expShape.More(); expShape.Next() ) { -// if (mapShape.Add(expShape.Current())) { -// nbShape++; -// } -// } -// return nbShape; -// } -// -// //======================================================================= -// //function : getShape -// //purpose : -// //======================================================================= -// -// template < class Mesh, class Shape, class Tab > -// void getShape(Mesh* mesh, Shape shape, Tab *t_Shape) { -// TopExp_Explorer expShape ( mesh->ShapeToMesh(), shape ); -// TopTools_MapOfShape mapShape; -// for ( int i=0; expShape.More(); expShape.Next() ) { -// if (mapShape.Add(expShape.Current())) { -// t_Shape[i] = expShape.Current(); -// i++; -// } -// } -// return; -// } -// -// // //======================================================================= -// // //function : findEdgeID -// // //purpose : -// // //======================================================================= -// -// static int findEdgeID(const SMDS_MeshNode* aNode, -// const SMESHDS_Mesh* theMesh, -// const int nEdge, -// const TopoDS_Shape* t_Edge) { -// -// TopoDS_Shape aPntShape, foundEdge; -// TopoDS_Vertex aVertex; -// gp_Pnt aPnt( aNode->X(), aNode->Y(), aNode->Z() ); -// -// int foundInd, ind; -// double nearest = RealLast(), *t_Dist; -// double epsilon = Precision::Confusion(); -// -// t_Dist = new double[ nEdge ]; -// aPntShape = BRepBuilderAPI_MakeVertex( aPnt ).Shape(); -// aVertex = TopoDS::Vertex( aPntShape ); -// -// for ( ind=0; ind < nEdge; ind++ ) { -// BRepExtrema_DistShapeShape aDistance ( aVertex, t_Edge[ind] ); -// t_Dist[ind] = aDistance.Value(); -// if ( t_Dist[ind] < nearest ) { -// nearest = t_Dist[ind]; -// foundEdge = t_Edge[ind]; -// foundInd = ind; -// if ( nearest < epsilon ) -// ind = nEdge; -// } -// } -// -// delete [] t_Dist; -// return theMesh->ShapeToIndex( foundEdge ); -// } -// -// -// // ======================================================================= -// // function : readGMFFile -// // purpose : read GMF file with geometry associated to mesh -// // ======================================================================= -// -// static bool readGMFFile(const int fileOpen, -// const char* theFileName, -// SMESH_Mesh& theMesh, -// const int nbShape, -// const TopoDS_Shape* tabShape, -// double** tabBox, -// map & theHybridIdToNodeMap, -// bool toMeshHoles, -// int nbEnforcedVertices, -// int nbEnforcedNodes) -// { -// TopoDS_Shape aShape; -// TopoDS_Vertex aVertex; -// SMESHDS_Mesh* theMeshDS = theMesh.GetMeshDS(); -// int nbElem = 0, nbRef = 0, IdShapeRef = 1; -// int *tabID; -// int aGMFNodeID = 0; -// int compoundID = -// nbShape ? theMeshDS->ShapeToIndex( tabShape[0] ) : theMeshDS->ShapeToIndex( theMeshDS->ShapeToMesh() ); -// int tetraShapeID = compoundID; -// double epsilon = Precision::Confusion(); -// int *nodeAssigne, *GMFNodeAssigne; -// SMDS_MeshNode** GMFNode; -// TopoDS_Shape *tabCorner, *tabEdge; -// std::map tabRef; -// -// -// int ver, dim; -// MESSAGE("Read " << theFileName << " file"); -// int InpMsh = GmfOpenMesh(theFileName, GmfRead, &ver, &dim); -// if (!InpMsh) -// return false; -// -// // =========================== -// // Fill the tabID array: BEGIN -// // =========================== -// -// /* -// The output .mesh file does not contain yet the subdomain-info (Ghs3D 4.2) -// */ -// Kernel_Utils::Localizer loc; -// struct stat status; -// size_t length; -// -// char *ptr, *mapPtr; -// char *tetraPtr; -// int *tab = new int[3]; -// -// // Read the file state -// fstat(fileOpen, &status); -// length = status.st_size; -// -// // Mapping the result file into memory -// #ifdef WIN32 -// HANDLE fd = CreateFile(theFileName, GENERIC_READ, FILE_SHARE_READ, -// NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); -// HANDLE hMapObject = CreateFileMapping(fd, NULL, PAGE_READONLY, -// 0, (DWORD)length, NULL); -// ptr = ( char* ) MapViewOfFile(hMapObject, FILE_MAP_READ, 0, 0, 0 ); -// #else -// ptr = (char *) mmap(0,length,PROT_READ,MAP_PRIVATE,fileOpen,0); -// #endif -// mapPtr = ptr; -// -// ptr = readMapIntLine(ptr, tab); -// tetraPtr = ptr; -// -// nbElem = tab[0]; -// int nbNodes = tab[1]; -// -// for (int i=0; i < 4*nbElem; i++) -// strtol(ptr, &ptr, 10); -// -// for (int iNode=1; iNode <= nbNodes; iNode++) -// for (int iCoor=0; iCoor < 3; iCoor++) -// strtod(ptr, &ptr); -// -// -// // Reading the number of triangles which corresponds to the number of sub-domains -// int nbTriangle = strtol(ptr, &ptr, 10); -// -// -// // The keyword does not exist yet => to update when it is created -// // int nbSubdomains = GmfStatKwd(InpMsh, GmfSubdomain); -// // int id_tri[3]; -// -// -// tabID = new int[nbTriangle]; -// for (int i=0; i < nbTriangle; i++) { -// tabID[i] = 0; -// int nodeId1, nodeId2, nodeId3; -// // find the solid corresponding to HYBRID sub-domain following -// // the technique proposed in HYBRID manual in chapter -// // "B.4 Subdomain (sub-region) assignment" -// -// nodeId1 = strtol(ptr, &ptr, 10); -// nodeId2 = strtol(ptr, &ptr, 10); -// nodeId3 = strtol(ptr, &ptr, 10); -// -// // // The keyword does not exist yet => to update when it is created -// // GmfGetLin(InpMsh, GmfSubdomain, &id_tri[0], &id_tri[1], &id_tri[2]); -// // nodeId1 = id_tri[0]; -// // nodeId2 = id_tri[1]; -// // nodeId3 = id_tri[2]; -// -// if ( nbTriangle > 1 ) { -// // get the nodes indices -// const SMDS_MeshNode* n1 = theHybridIdToNodeMap[ nodeId1 ]; -// const SMDS_MeshNode* n2 = theHybridIdToNodeMap[ nodeId2 ]; -// const SMDS_MeshNode* n3 = theHybridIdToNodeMap[ nodeId3 ]; -// try { -// OCC_CATCH_SIGNALS; -// tabID[i] = findShapeID( theMesh, n1, n2, n3, toMeshHoles ); -// // -- 0020330: Pb with hybrid as a submesh -// // check that found shape is to be meshed -// if ( tabID[i] > 0 ) { -// const TopoDS_Shape& foundShape = theMeshDS->IndexToShape( tabID[i] ); -// bool isToBeMeshed = false; -// for ( int iS = 0; !isToBeMeshed && iS < nbShape; ++iS ) -// isToBeMeshed = foundShape.IsSame( tabShape[ iS ]); -// if ( !isToBeMeshed ) -// tabID[i] = HOLE_ID; -// } -// // END -- 0020330: Pb with hybrid as a submesh -// #ifdef _DEBUG_ -// std::cout << i+1 << " subdomain: findShapeID() returns " << tabID[i] << std::endl; -// #endif -// } -// catch ( Standard_Failure & ex) -// { -// #ifdef _DEBUG_ -// std::cout << i+1 << " subdomain: Exception caugt: " << ex.GetMessageString() << std::endl; -// #endif -// } -// catch (...) { -// #ifdef _DEBUG_ -// std::cout << i+1 << " subdomain: unknown exception caught " << std::endl; -// #endif -// } -// } -// } -// -// // =========================== -// // Fill the tabID array: END -// // =========================== -// -// -// tabRef[GmfVertices] = 3; -// tabRef[GmfCorners] = 1; -// tabRef[GmfEdges] = 2; -// tabRef[GmfRidges] = 1; -// tabRef[GmfTriangles] = 3; -// // tabRef[GmfQuadrilaterals] = 4; -// tabRef[GmfTetrahedra] = 4; -// // tabRef[GmfHexahedra] = 8; -// -// SMDS_NodeIteratorPtr itOnGMFInputNode = theMeshDS->nodesIterator(); -// while ( itOnGMFInputNode->more() ) -// theMeshDS->RemoveNode( itOnGMFInputNode->next() ); -// -// -// int nbVertices = GmfStatKwd(InpMsh, GmfVertices); -// int nbCorners = max(countShape( theMeshDS, TopAbs_VERTEX ) , GmfStatKwd(InpMsh, GmfCorners)); -// int nbShapeEdge = countShape( theMeshDS, TopAbs_EDGE ); -// -// tabCorner = new TopoDS_Shape[ nbCorners ]; -// tabEdge = new TopoDS_Shape[ nbShapeEdge ]; -// nodeAssigne = new int[ nbVertices + 1 ]; -// GMFNodeAssigne = new int[ nbVertices + 1 ]; -// GMFNode = new SMDS_MeshNode*[ nbVertices + 1 ]; -// -// getShape(theMeshDS, TopAbs_VERTEX, tabCorner); -// getShape(theMeshDS, TopAbs_EDGE, tabEdge); -// -// std::map ::const_iterator it = tabRef.begin(); -// for ( ; it != tabRef.end() ; ++it) -// { -// // int dummy; -// GmfKwdCod token = it->first; -// nbRef = it->second; -// -// nbElem = GmfStatKwd(InpMsh, token); -// if (nbElem > 0) { -// GmfGotoKwd(InpMsh, token); -// std::cout << "Read " << nbElem; -// } -// else -// continue; -// -// int id[nbElem*tabRef[token]]; -// int hybridShapeID[nbElem]; -// -// if (token == GmfVertices) { -// std::cout << " vertices" << std::endl; -// int aGMFID; -// -// float VerTab_f[nbElem][3]; -// double VerTab_d[nbElem][3]; -// SMDS_MeshNode * aGMFNode; -// -// for ( int iElem = 0; iElem < nbElem; iElem++ ) { -// aGMFID = iElem + 1; -// if (ver == GmfFloat) { -// GmfGetLin(InpMsh, token, &VerTab_f[nbElem][0], &VerTab_f[nbElem][1], &VerTab_f[nbElem][2], &hybridShapeID[iElem]); -// aGMFNode = theMeshDS->AddNode(VerTab_f[nbElem][0], VerTab_f[nbElem][1], VerTab_f[nbElem][2]); -// } -// else { -// GmfGetLin(InpMsh, token, &VerTab_d[nbElem][0], &VerTab_d[nbElem][1], &VerTab_d[nbElem][2], &hybridShapeID[iElem]); -// aGMFNode = theMeshDS->AddNode(VerTab_d[nbElem][0], VerTab_d[nbElem][1], VerTab_d[nbElem][2]); -// } -// GMFNode[ aGMFID ] = aGMFNode; -// nodeAssigne[ aGMFID ] = 0; -// GMFNodeAssigne[ aGMFID ] = 0; -// } -// } -// else if (token == GmfCorners && nbElem > 0) { -// std::cout << " corners" << std::endl; -// for ( int iElem = 0; iElem < nbElem; iElem++ ) -// GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]]); -// } -// else if (token == GmfRidges && nbElem > 0) { -// std::cout << " ridges" << std::endl; -// for ( int iElem = 0; iElem < nbElem; iElem++ ) -// GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]]); -// } -// else if (token == GmfEdges && nbElem > 0) { -// std::cout << " edges" << std::endl; -// for ( int iElem = 0; iElem < nbElem; iElem++ ) -// GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &hybridShapeID[iElem]); -// } -// else if (token == GmfTriangles && nbElem > 0) { -// std::cout << " triangles" << std::endl; -// for ( int iElem = 0; iElem < nbElem; iElem++ ) -// GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &hybridShapeID[iElem]); -// } -// // else if (token == GmfQuadrilaterals && nbElem > 0) { -// // std::cout << " Quadrilaterals" << std::endl; -// // for ( int iElem = 0; iElem < nbElem; iElem++ ) -// // GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &hybridShapeID[iElem]); -// // } -// else if (token == GmfTetrahedra && nbElem > 0) { -// std::cout << " Tetrahedra" << std::endl; -// for ( int iElem = 0; iElem < nbElem; iElem++ ) -// GmfGetLin(InpMsh, token, -// &id[iElem*tabRef[token]], -// &id[iElem*tabRef[token]+1], -// &id[iElem*tabRef[token]+2], -// &id[iElem*tabRef[token]+3], -// &hybridShapeID[iElem]); -// } -// // else if (token == GmfHexahedra && nbElem > 0) { -// // std::cout << " Hexahedra" << std::endl; -// // for ( int iElem = 0; iElem < nbElem; iElem++ ) -// // GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], -// // &id[iElem*tabRef[token]+4], &id[iElem*tabRef[token]+5], &id[iElem*tabRef[token]+6], &id[iElem*tabRef[token]+7], &hybridShapeID[iElem]); -// // } -// -// switch (token) { -// case GmfCorners: -// case GmfRidges: -// case GmfEdges: -// case GmfTriangles: -// // case GmfQuadrilaterals: -// case GmfTetrahedra: -// // case GmfHexahedra: -// { -// int nodeDim, shapeID, *nodeID; -// const SMDS_MeshNode** node; -// // std::vector< SMDS_MeshNode* > enfNode( nbRef ); -// SMDS_MeshElement * aGMFElement; -// -// node = new const SMDS_MeshNode*[nbRef]; -// nodeID = new int[ nbRef ]; -// -// for ( int iElem = 0; iElem < nbElem; iElem++ ) -// { -// for ( int iRef = 0; iRef < nbRef; iRef++ ) -// { -// aGMFNodeID = id[iElem*tabRef[token]+iRef]; // read nbRef aGMFNodeID -// node [ iRef ] = GMFNode[ aGMFNodeID ]; -// nodeID[ iRef ] = aGMFNodeID; -// } -// -// switch (token) -// { -// case GmfCorners: { -// nodeDim = 1; -// gp_Pnt GMFPnt ( node[0]->X(), node[0]->Y(), node[0]->Z() ); -// for ( int i=0; iAddEdge( node[0], node[1] ); -// int iNode = 1; -// if ( GMFNodeAssigne[ nodeID[0] ] == 0 || GMFNodeAssigne[ nodeID[0] ] == 2 ) -// iNode = 0; -// shapeID = findEdgeID( node[iNode], theMeshDS, nbShapeEdge, tabEdge ); -// break; -// } -// case GmfRidges: -// break; -// case GmfTriangles: { -// nodeDim = 3; -// aGMFElement = theMeshDS->AddFace( node[0], node[1], node[2]); -// shapeID = -1; -// break; -// } -// // case GmfQuadrilaterals: { -// // nodeDim = 4; -// // aGMFElement = theMeshDS->AddFace( node[0], node[1], node[2], node[3] ); -// // shapeID = -1; -// // break; -// // } -// case GmfTetrahedra: { -// -// // IN WORK -// TopoDS_Shape aSolid; -// // We always run HYBRID with "to mesh holes"==TRUE but we must not create -// // tetras within holes depending on hypo option, -// // so we first check if aTet is inside a hole and then create it -// if ( nbTriangle > 1 ) { -// tetraShapeID = HOLE_ID; // negative tetraShapeID means not to create tetras if !toMeshHoles -// int aHybridShapeID = hybridShapeID[iElem] - IdShapeRef; -// if ( tabID[ aHybridShapeID ] == 0 ) { -// TopAbs_State state; -// aSolid = findShape(node, aSolid, tabShape, tabBox, nbShape, &state); -// if ( toMeshHoles || state == TopAbs_IN ) -// tetraShapeID = theMeshDS->ShapeToIndex( aSolid ); -// tabID[ aHybridShapeID ] = tetraShapeID; -// } -// else -// tetraShapeID = tabID[ aHybridShapeID ]; -// } -// else if ( nbShape > 1 ) { -// // Case where nbTriangle == 1 while nbShape == 2 encountered -// // with compound of 2 boxes and "To mesh holes"==False, -// // so there are no subdomains specified for each tetrahedron. -// // Try to guess a solid by a node already bound to shape -// tetraShapeID = 0; -// for ( int i=0; i<4 && tetraShapeID==0; i++ ) { -// if ( nodeAssigne[ nodeID[i] ] == 1 && -// node[i]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_3DSPACE && -// node[i]->getshapeId() > 1 ) -// { -// tetraShapeID = node[i]->getshapeId(); -// } -// } -// if ( tetraShapeID==0 ) { -// aSolid = findShape(node, aSolid, tabShape, tabBox, nbShape); -// tetraShapeID = theMeshDS->ShapeToIndex( aSolid ); -// } -// } -// // set new nodes and tetrahedron onto the shape -// for ( int i=0; i<4; i++ ) { -// if ( nodeAssigne[ nodeID[i] ] == 0 ) { -// if ( tetraShapeID != HOLE_ID ) -// theMeshDS->SetNodeInVolume( node[i], tetraShapeID ); -// nodeAssigne[ nodeID[i] ] = tetraShapeID; -// } -// } -// if ( toMeshHoles || tetraShapeID != HOLE_ID ) { -// aGMFElement = theMeshDS->AddVolume( node[1], node[0], node[2], node[3] ); -// theMeshDS->SetMeshElementOnShape( aGMFElement, tetraShapeID ); -// } -// -// // IN WORK -// -// nodeDim = 5; -// break; -// } -// // case GmfHexahedra: { -// // nodeDim = 6; -// // aGMFElement = theMeshDS->AddVolume( node[0], node[3], node[2], node[1], -// // node[4], node[7], node[6], node[5] ); -// // break; -// // } -// default: continue; -// } -// if (token != GmfRidges) -// { -// for ( int i=0; iSetNodeOnVertex( node[0], aVertex ); -// else if ( token == GmfEdges ) theMeshDS->SetNodeOnEdge( node[i], shapeID ); -// else if ( token == GmfTriangles ) theMeshDS->SetNodeOnFace( node[i], shapeID ); -// GMFNodeAssigne[ nodeID[i] ] = nodeDim; -// } -// } -// if ( token != "Corners" ) -// theMeshDS->SetMeshElementOnShape( aGMFElement, shapeID ); -// } -// } // for -// -// if ( !toMeshHoles ) { -// map ::iterator itOnNode = theHybridIdToNodeMap.find( nbVertices-(nbEnforcedVertices+nbEnforcedNodes) ); -// for ( ; itOnNode != theHybridIdToNodeMap.end(); ++itOnNode) { -// if ( nodeAssigne[ itOnNode->first ] == HOLE_ID ) -// theMeshDS->RemoveFreeNode( itOnNode->second, 0 ); -// } -// } -// -// delete [] node; -// delete [] nodeID; -// break; -// } // case GmfTetrahedra -// } // switch(token) -// } // for -// cout << std::endl; -// -// #ifdef WIN32 -// UnmapViewOfFile(mapPtr); -// CloseHandle(hMapObject); -// CloseHandle(fd); -// #else -// munmap(mapPtr, length); -// #endif -// close(fileOpen); -// -// delete [] tabID; -// delete [] tabCorner; -// delete [] tabEdge; -// delete [] nodeAssigne; -// delete [] GMFNodeAssigne; -// delete [] GMFNode; -// -// return true; -// } - //======================================================================= //function : addElemInMeshGroup