From e339065f45b28fe942c46c46edf18eea9c5b50a2 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 7 Sep 2005 04:33:54 +0000 Subject: [PATCH] PAL9022. Attach generated mesh elements to whatever meshed shape, SHELL or SOLID --- src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx index db0c493..c6c23a1 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx @@ -125,16 +125,6 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, SMESHDS_Mesh* meshDS = aMesh.GetMeshDS(); - // get a shell from aShape - TopoDS_Shell aShell; - TopExp_Explorer exp(aShape,TopAbs_SHELL); - if ( exp.More() ) - aShell = TopoDS::Shell(exp.Current()); - - if ( aShell.IsNull() || !aMesh.GetSubMesh( aShell )) { - INFOS( "NETGENPlugin_NETGEN_3D::Compute(), bad shape"); - return false; - } // ------------------------------------------------------------------- // get triangles on aShell and make a map of nodes to Netgen node IDs // ------------------------------------------------------------------- @@ -271,13 +261,14 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, nodeVec[ n_id->second ] = n_id->first; // create and insert new nodes into nodeVec int nodeIndex = Netgen_NbOfNodes; + int shapeID = meshDS->ShapeToIndex( aShape ); for ( ; nodeIndex <= Netgen_NbOfNodesNew; ++nodeIndex ) { Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point ); SMDS_MeshNode * node = meshDS->AddNode(Netgen_point[0], Netgen_point[1], Netgen_point[2]); - meshDS->SetNodeInVolume(node, aShell); + meshDS->SetNodeInVolume(node, shapeID); nodeVec[nodeIndex] = node; } @@ -289,7 +280,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, nodeVec[ Netgen_tetrahedron[1] ], nodeVec[ Netgen_tetrahedron[2] ], nodeVec[ Netgen_tetrahedron[3] ]); - meshDS->SetMeshElementOnShape(elt, aShell); + meshDS->SetMeshElementOnShape(elt, shapeID ); } }