From: eap Date: Fri, 8 Jun 2007 09:00:52 +0000 (+0000) Subject: NPAL16132 (GHS3D execution failed in Salome version 4.0.0) X-Git-Tag: V4_1_0a1~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=362e7633ec1830800c63d61619ebb93098f21b43;p=modules%2Fsmesh.git NPAL16132 (GHS3D execution failed in Salome version 4.0.0) make each node in volume has it's own position but not set volume ID to static originSpacePosition() --- diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 9f48b7b15..4e7561755 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -32,7 +32,9 @@ #include "SMDS_VertexPosition.hxx" #include "SMDS_EdgePosition.hxx" #include "SMDS_FacePosition.hxx" +#include "SMDS_SpacePosition.hxx" #include "SMESHDS_GroupOnGeom.hxx" + #include #include #include @@ -850,6 +852,22 @@ bool SMESHDS_Mesh::add(const SMDS_MeshElement* elem, SMESHDS_SubMesh* subMesh ) return false; } +namespace { + + //================================================================================ + /*! + * \brief Creates a node position in volume + */ + //================================================================================ + + inline SMDS_PositionPtr volumePosition(int volId) + { + SMDS_SpacePosition* pos = new SMDS_SpacePosition(); + pos->SetShapeId( volId ); + return SMDS_PositionPtr(pos); + } +} + //======================================================================= //function : SetNodeOnVolume //purpose : @@ -858,7 +876,7 @@ void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode, const TopoDS_Shell & S) { if ( add( aNode, getSubmesh(S) )) - const_cast( aNode->GetPosition().get() )->SetShapeId( myCurSubID ); + aNode->SetPosition ( volumePosition( myCurSubID )); } //======================================================================= //function : SetNodeOnVolume @@ -868,7 +886,7 @@ void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode, const TopoDS_Solid & S) { if ( add( aNode, getSubmesh(S) )) - const_cast( aNode->GetPosition().get() )->SetShapeId( myCurSubID ); + aNode->SetPosition ( volumePosition( myCurSubID )); } //======================================================================= @@ -1154,7 +1172,7 @@ int SMESHDS_Mesh::ShapeToIndex(const TopoDS_Shape & S) const void SMESHDS_Mesh::SetNodeInVolume(const SMDS_MeshNode* aNode, int Index) { if ( add( aNode, getSubmesh( Index ))) - const_cast( aNode->GetPosition().get() )->SetShapeId( Index ); + ((SMDS_MeshNode*) aNode)->SetPosition( volumePosition( Index )); } //=======================================================================