Salome HOME
IPAL52943: "Apply and Close" button does not active on symmetry dialog box
[modules/smesh.git] / src / SMESHUtils / SMESH_TypeDefs.hxx
index 532805027ab7143196e675816c723efbff5ff095..afef61b906c5ef24c1eb0a4c8e9db1aad8980281 100644 (file)
@@ -80,7 +80,7 @@ namespace SMESHUtils
   struct Deleter
   {
     TOBJ* _obj;
-    Deleter( TOBJ* obj ): _obj( obj ) {}
+    Deleter( TOBJ* obj = (TOBJ*)NULL ): _obj( obj ) {}
     ~Deleter() { delete _obj; _obj = 0; }
   private:
     Deleter( const Deleter& );
@@ -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<const SMDS_MeshNode*>(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(); }