From 52d8be26bf259b500ad6aed5c4e19b0f04755706 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 7 Sep 2005 04:37:37 +0000 Subject: [PATCH] PAL9022. Attach generated mesh elements to whatever meshed shape, SHELL or SOLID --- src/GHS3DPlugin_GHS3D.cxx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin_GHS3D.cxx index 3227f4f..47eed5f 100644 --- a/src/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin_GHS3D.cxx @@ -259,12 +259,7 @@ static bool readResult(FILE * theFile, char aBuffer[ GHS3DPlugin_BUFLENGTH ]; char * aPtr; int aLineNb = 0; - - // get shell to set nodes in - TopExp_Explorer exp( theShape, TopAbs_SHELL ); - TopoDS_Shell aShell = TopoDS::Shell( exp.Current() ); - if ( aShell.IsNull() ) - return false; + int shapeID = theMesh->ShapeToIndex( theShape ); // ---------------------------------------- // record 1: @@ -307,19 +302,18 @@ static bool readResult(FILE * theFile, // ID is not yet in theGhs3dIdToNodeMap ASSERT ( ID > nbInputNodes ); // it should be a new one SMDS_MeshNode * aNewNode = theMesh->AddNode( 0.,0.,0. ); // read XYZ later - theMesh->SetNodeInVolume( aNewNode, aShell ); - theGhs3dIdToNodeMap.insert - ( map ::value_type( ID, aNewNode )); + theMesh->SetNodeInVolume( aNewNode, shapeID ); + theGhs3dIdToNodeMap.insert ( make_pair( ID, aNewNode )); node[ iNode ] = aNewNode; } else { - node[ iNode ] = (*IdNode).second; + node[ iNode ] = IdNode->second; } } // create a tetrahedron with orientation as for MED SMDS_MeshElement* aTet = theMesh->AddVolume( node[1], node[0], node[2], node[3] ); - theMesh->SetMeshElementOnShape( aTet, theShape ); + theMesh->SetMeshElementOnShape( aTet, shapeID ); } // ------------------------ -- 2.39.2