X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_TypeDefs.hxx;h=afef61b906c5ef24c1eb0a4c8e9db1aad8980281;hp=f5c44e79a944fc0a76e0684fb92a1fd82a944543;hb=741a54331a691355c38e17548fbc14475cfe9b6b;hpb=21ea791049211d08356651965878a227b739c2ce;ds=sidebyside diff --git a/src/SMESHUtils/SMESH_TypeDefs.hxx b/src/SMESHUtils/SMESH_TypeDefs.hxx index f5c44e79a..afef61b90 100644 --- a/src/SMESHUtils/SMESH_TypeDefs.hxx +++ b/src/SMESHUtils/SMESH_TypeDefs.hxx @@ -137,13 +137,20 @@ struct SMESH_TNodeXYZ : public gp_XYZ { const SMDS_MeshNode* _node; double _xyz[3]; - SMESH_TNodeXYZ( const SMDS_MeshElement* e=0):gp_XYZ(0,0,0),_node(0) { + SMESH_TNodeXYZ( const SMDS_MeshElement* e=0):gp_XYZ(0,0,0),_node(0) + { + Set(e); + } + bool Set( const SMDS_MeshElement* e=0 ) + { if (e) { assert( e->GetType() == SMDSAbs_Node ); _node = static_cast(e); _node->GetXYZ(_xyz); // - thread safe getting coords SetCoord( _xyz[0], _xyz[1], _xyz[2] ); + return true; } + return false; } double Distance(const SMDS_MeshNode* n) const { return (SMESH_TNodeXYZ( n )-*this).Modulus(); } double SquareDistance(const SMDS_MeshNode* n) const { return (SMESH_TNodeXYZ( n )-*this).SquareModulus(); }