From: eap Date: Wed, 7 Sep 2005 04:37:37 +0000 (+0000) Subject: PAL9022. Attach generated mesh elements to whatever meshed shape, SHELL or SOLID X-Git-Tag: ForTest2_3_1_0a2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=52d8be26bf259b500ad6aed5c4e19b0f04755706;p=plugins%2Fghs3dplugin.git PAL9022. Attach generated mesh elements to whatever meshed shape, SHELL or SOLID --- 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 ); } // ------------------------