Salome HOME
IPAL21374 Add 0D element leads to visualization failure.
[modules/smesh.git] / src / SMESH_I / SMESH_MEDMesh_i.cxx
index 05ffe67013732b830356bd4234fbe0fc15c2db1e..9ee46fda3c0c8b9b17b6e94f1e037aaed5c7c42c 100644 (file)
@@ -1,29 +1,28 @@
-//  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
 //  File   : SMESH_MEDMesh_i.cxx
 //  Module : SMESH
-
+//
 #include "SMESH_MEDMesh_i.hxx"
 #include "SMESH_Mesh_i.hxx"
 
@@ -728,6 +727,22 @@ SMESH_MEDMesh_i::getBoundaryElements(SALOME_MED::medEntityMesh entity)
   return NULL;
 }
 //=============================================================================
+/*!
+ * CORBA:  Method return a reference on a support define on all the element of
+ *         an entity.
+ */
+//=============================================================================
+SALOME_MED::SUPPORT_ptr
+SMESH_MEDMesh_i::getSupportOnAll(SALOME_MED::medEntityMesh entity)
+  throw (SALOME::SALOME_Exception)
+{
+  MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!");
+
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+
+  return NULL;
+}
+//=============================================================================
 /*!
  * CORBA: Returns references for the support of the skin of the support
  * mySupport3D
@@ -863,8 +878,8 @@ void SMESH_MEDMesh_i::addInStudy(SALOMEDS::Study_ptr myStudy,
         * ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
         * ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
         * CORBA::ORB_var &orb = init(0,0);
-        * string iorStr = orb->object_to_string(myIor);
-        * //myBuilder->AddAttribute(newObj,SALOMEDS::IOR,iorStr.c_str());
+        * CORBA::String_var iorStr = orb->object_to_string(myIor);
+        * //myBuilder->AddAttribute(newObj,SALOMEDS::IOR,iorStr.in());
         * SALOMEDS::AttributeIOR_var aIOR = SALOMEDS::AttributeIOR::_narrow(
         * myBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"));
         * aIOR->SetValue(iorStr.c_str());
@@ -1137,9 +1152,15 @@ void SMESH_MEDMesh_i::createFamilies() throw(SALOME::SALOME_Exception)
                        SMESH_MEDFamily_i *famservant =
                                new SMESH_MEDFamily_i(famIdent, submesh_i,
                                famName, famDes, SALOME_MED::MED_NODE);
-                       SALOME_MED::FAMILY_ptr famille =
-                               SALOME_MED::FAMILY::_narrow(famservant->
-                               POA_SALOME_MED::FAMILY::_this());
+#ifdef WNT
+      SALOME_MED::FAMILY_ptr famille = SALOME_MED::FAMILY::_nil();
+      POA_SALOME_MED::FAMILY* servantbase = dynamic_cast<POA_SALOME_MED::FAMILY*>(famservant);
+      if ( servantbase )
+        famille = SALOME_MED::FAMILY::_narrow( servantbase->_this() );
+#else 
+               SALOME_MED::FAMILY_ptr famille = 
+        SALOME_MED::FAMILY::_narrow( famservant->POA_SALOME_MED::FAMILY::_this() );
+#endif
                        _families.push_back(famille);
                }
        }