From 362e7633ec1830800c63d61619ebb93098f21b43 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 8 Jun 2007 09:00:52 +0000 Subject: [PATCH] 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() --- src/SMESHDS/SMESHDS_Mesh.cxx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) 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 )); } //======================================================================= -- 2.39.2