From c5add157d78385b42e0ca5fe979eeca83202b695 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 25 Jun 2013 11:56:05 +0000 Subject: [PATCH] CoTech decision: move MEDWrapper from MED to SMESH MED.idl no more exists --- src/SMESH_I/Makefile.am | 7 - src/SMESH_I/SMESH_MEDFamily_i.cxx | 301 ------- src/SMESH_I/SMESH_MEDFamily_i.hxx | 92 --- src/SMESH_I/SMESH_MEDMesh_i.cxx | 1209 ---------------------------- src/SMESH_I/SMESH_MEDMesh_i.hxx | 262 ------ src/SMESH_I/SMESH_MEDSupport_i.cxx | 403 ---------- src/SMESH_I/SMESH_MEDSupport_i.hxx | 120 --- src/SMESH_I/SMESH_Mesh_i.cxx | 26 +- src/SMESH_I/SMESH_Mesh_i.hxx | 10 +- src/SMESH_I/SMESH_subMesh_i.cxx | 24 - src/SMESH_I/SMESH_subMesh_i.hxx | 4 - 11 files changed, 7 insertions(+), 2451 deletions(-) delete mode 100644 src/SMESH_I/SMESH_MEDFamily_i.cxx delete mode 100644 src/SMESH_I/SMESH_MEDFamily_i.hxx delete mode 100644 src/SMESH_I/SMESH_MEDMesh_i.cxx delete mode 100644 src/SMESH_I/SMESH_MEDMesh_i.hxx delete mode 100644 src/SMESH_I/SMESH_MEDSupport_i.cxx delete mode 100644 src/SMESH_I/SMESH_MEDSupport_i.hxx diff --git a/src/SMESH_I/Makefile.am b/src/SMESH_I/Makefile.am index b8208ff0b..d76a6c7dc 100644 --- a/src/SMESH_I/Makefile.am +++ b/src/SMESH_I/Makefile.am @@ -38,11 +38,8 @@ salomeinclude_HEADERS = \ SMESH_Hypothesis_i.hxx \ SMESH_PythonDump.hxx \ SMESH_Group_i.hxx \ - SMESH_MEDMesh_i.hxx \ SMESH_Filter_i.hxx \ SMESH_MeshEditor_i.hxx \ - SMESH_MEDFamily_i.hxx \ - SMESH_MEDSupport_i.hxx \ SMESH_Pattern_i.hxx \ SMESH_2smeshpy.hxx \ SMESH_NoteBook.hxx \ @@ -60,9 +57,6 @@ dist_libSMESHEngine_la_SOURCES = \ SMESH_Gen_i_1.cxx \ SMESH_DumpPython.cxx \ SMESH_Mesh_i.cxx \ - SMESH_MEDMesh_i.cxx \ - SMESH_MEDFamily_i.cxx \ - SMESH_MEDSupport_i.cxx \ SMESH_subMesh_i.cxx \ SMESH_MeshEditor_i.cxx \ SMESH_Hypothesis_i.cxx \ @@ -95,7 +89,6 @@ libSMESHEngine_la_CPPFLAGS = \ $(BOOST_CPPFLAGS) \ $(KERNEL_CXXFLAGS) \ $(GUI_CXXFLAGS) \ - $(MED_CXXFLAGS) \ $(GEOM_CXXFLAGS) \ -I$(srcdir)/../Controls \ -I$(srcdir)/../SMDS \ diff --git a/src/SMESH_I/SMESH_MEDFamily_i.cxx b/src/SMESH_I/SMESH_MEDFamily_i.cxx deleted file mode 100644 index ada90fd74..000000000 --- a/src/SMESH_I/SMESH_MEDFamily_i.cxx +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (C) 2007-2013 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. -// -// 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_MEDFamily_i.cxx -// Module : SMESH -// -#include "SMESH_MEDFamily_i.hxx" -#include "utilities.h" -#include "Utils_CorbaException.hxx" - -using namespace std; - -//============================================================================= -/*! - * Default constructor - */ -//============================================================================= -SMESH_MEDFamily_i::SMESH_MEDFamily_i() -{ - BEGIN_OF("Default Constructor SMESH_MEDFamily_i"); - END_OF("Default Constructor SMESH_MEDFamily_i"); -} -//============================================================================= -/*! - * constructor par recopie - */ -//============================================================================= -SMESH_MEDFamily_i::SMESH_MEDFamily_i(const SMESH_MEDFamily_i & f): - SMESH_MEDSupport_i(f._subMesh_i,f._name,f._description,f._entity), - _subMesh_i(f._subMesh_i), - _identifier(f._identifier), - _numberOfAttribute(f._numberOfAttribute), - _numberOfGroup(f._numberOfGroup), - _attributeValue(f._attributeValue) -{ - BEGIN_OF("Copy Constructor SMESH_MEDFamily_i"); - _attributeDescription=new string[_numberOfAttribute]; - for (int i=0;i<_numberOfAttribute;i++) { - _attributeDescription[i]=f._attributeDescription[i]; - }; - _groupName=new string[_numberOfGroup]; - for (int i=0;i<_numberOfAttribute;i++) { - _groupName[i]=f._groupName[i]; - }; - END_OF("Copy Constructor SMESH_MEDFamily_i"); -} -//============================================================================= -/*! - * Destructor - */ -//============================================================================= -SMESH_MEDFamily_i::~SMESH_MEDFamily_i() -{ -} -//============================================================================= -/*! - * Constructor - */ -//============================================================================= -SMESH_MEDFamily_i::SMESH_MEDFamily_i(int identifier, SMESH_subMesh_i* sm, - string name, string description, SALOME_MED::medEntityMesh entity): - SMESH_MEDSupport_i( sm, name, description, entity ), - - _subMesh_i(sm), - _identifier(identifier), - _numberOfAttribute(0), - _attributeIdentifier((int*)NULL), - _attributeValue((int*)NULL), - _attributeDescription((string*)NULL), - _numberOfGroup(0), - _groupName((string*)NULL) -{ - BEGIN_OF("Constructor SMESH_MEDFamily_i"); - END_OF("Constructor SMESH_MEDFamily_i"); -} -//============================================================================= -/*! - * CORBA: Accessor for Family's Identifier - */ -//============================================================================= - -CORBA::Long SMESH_MEDFamily_i::getIdentifier() -throw (SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ - SALOME::INTERNAL_ERROR); - return _identifier; - -} -//============================================================================= -/*! - * CORBA: Accessor for number of attributes - */ -//============================================================================= -CORBA::Long SMESH_MEDFamily_i::getNumberOfAttributes() -throw (SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ - SALOME::INTERNAL_ERROR); - return _numberOfAttribute; -} -//============================================================================= -/*! - * CORBA: Accessor for attributes identifiers - */ -//============================================================================= -SALOME_TYPES::ListOfLong* SMESH_MEDFamily_i::getAttributesIdentifiers() -throw (SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ - SALOME::INTERNAL_ERROR); - if (_numberOfAttribute == 0) - { - MESSAGE("Les familles SMESH n ont pas d attribut"); - THROW_SALOME_CORBA_EXCEPTION("No attributes"\ - ,SALOME::BAD_PARAM); - }; - - SALOME_TYPES::ListOfLong_var myseq= new SALOME_TYPES::ListOfLong; - myseq->length(_numberOfAttribute); - for (int i=0;i<_numberOfAttribute;i++) - { - myseq[i]=_attributeIdentifier[i]; - }; - return myseq._retn(); - -} -//============================================================================= -/*! - * CORBA: Accessor for attribute identifier I - */ -//============================================================================= -CORBA::Long SMESH_MEDFamily_i::getAttributeIdentifier(CORBA::Long i) - throw (SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ - SALOME::INTERNAL_ERROR); - MESSAGE("Les familles SMESH n ont pas d attribut"); - THROW_SALOME_CORBA_EXCEPTION("No attributes"\ - ,SALOME::BAD_PARAM); - if (_numberOfAttribute == 0) - { - MESSAGE("Les familles SMESH n ont pas d attribut"); - THROW_SALOME_CORBA_EXCEPTION("No attributes"\ - ,SALOME::BAD_PARAM); - }; - ASSERT (i <= _numberOfAttribute); - return _attributeIdentifier[i]; -} -//============================================================================= -/*! - * CORBA: Accessor for attributes values - */ -//============================================================================= -SALOME_TYPES::ListOfLong* SMESH_MEDFamily_i::getAttributesValues() - throw (SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ - SALOME::INTERNAL_ERROR); - - if (_numberOfAttribute == 0) - { - MESSAGE("Les familles SMESH n ont pas d attribut"); - THROW_SALOME_CORBA_EXCEPTION("No attributes"\ - ,SALOME::BAD_PARAM); - }; - - SALOME_TYPES::ListOfLong_var myseq= new SALOME_TYPES::ListOfLong; - myseq->length(_numberOfAttribute); - for (int i=0;i<_numberOfAttribute;i++) - { - myseq[i]=_attributeValue[i]; - }; - return myseq._retn(); -} -//============================================================================= -/*! - * CORBA: Accessor for attribute value I - */ -//============================================================================= -CORBA::Long SMESH_MEDFamily_i::getAttributeValue(CORBA::Long i) - throw (SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ - SALOME::INTERNAL_ERROR); - if (_numberOfAttribute == 0) - { - MESSAGE("Les familles SMESH n ont pas d attribut"); - THROW_SALOME_CORBA_EXCEPTION("No attributes"\ - ,SALOME::BAD_PARAM); - } - - ASSERT (i <= _numberOfAttribute); - return _attributeValue[i]; -} -//============================================================================= -/*! - * CORBA: Accessor for attributes desriptions - */ -//============================================================================= -SALOME_TYPES::ListOfString * SMESH_MEDFamily_i::getAttributesDescriptions() - throw (SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ - SALOME::INTERNAL_ERROR); - if (_numberOfAttribute == 0) - { - MESSAGE("Les familles SMESH n ont pas d attribut"); - THROW_SALOME_CORBA_EXCEPTION("No attributes"\ - ,SALOME::BAD_PARAM); - } - SALOME_TYPES::ListOfString_var myseq = new SALOME_TYPES::ListOfString; - for (int i=0;i<_numberOfAttribute;i++) - { - myseq[i]=CORBA::string_dup(_attributeDescription[i].c_str()); - } - return myseq._retn(); -} -//============================================================================= -/*! - * CORBA: Accessor for attribute description i - */ -//============================================================================= -char * SMESH_MEDFamily_i::getAttributeDescription( CORBA::Long i) - throw (SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ - SALOME::INTERNAL_ERROR); - if (_numberOfAttribute == 0) - { - MESSAGE("Les familles SMESH n ont pas d attribut"); - THROW_SALOME_CORBA_EXCEPTION("No attributes"\ - ,SALOME::BAD_PARAM); - } - ASSERT (i <= _numberOfAttribute); - return CORBA::string_dup(_attributeDescription[i].c_str()); -} -//============================================================================= -/*! - * CORBA: Accessor for the number of groups - */ -//============================================================================= -CORBA::Long SMESH_MEDFamily_i::getNumberOfGroups() - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!! NOT YET IMPLEMENTED !!!!"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); - return 0; -} -//============================================================================= -/*! - * CORBA: Accessor for the name of the group i - */ -//============================================================================= -char * SMESH_MEDFamily_i::getGroupName( CORBA::Long i) - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!! NOT YET IMPLEMENTED !!!!"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); - return NULL; -} -//============================================================================= -/*! - * CORBA: Accessor for all the groups name - */ -//============================================================================= -SALOME_TYPES::ListOfString* SMESH_MEDFamily_i::getGroupsNames() - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!! NOT YET IMPLEMENTED !!!!"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); - return NULL; -} diff --git a/src/SMESH_I/SMESH_MEDFamily_i.hxx b/src/SMESH_I/SMESH_MEDFamily_i.hxx deleted file mode 100644 index f4ec0749f..000000000 --- a/src/SMESH_I/SMESH_MEDFamily_i.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (C) 2007-2013 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. -// -// 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_MEDFamily_i.hxx -// Module : SMESH -// -#ifndef SMESH_MED_FAMILY_I_HXX_ -#define SMESH_MED_FAMILY_I_HXX_ - -#include "SMESH.hxx" - -#include "SMESH_MEDSupport_i.hxx" - -#include - -class SMESH_I_EXPORT SMESH_MEDFamily_i: - public virtual POA_SALOME_MED::FAMILY, - public virtual SMESH_MEDSupport_i -{ -protected : - SMESH_MEDFamily_i(); - ~SMESH_MEDFamily_i(); - - ::SMESH_subMesh_i* _subMesh_i; - - // Values - int _identifier; - int _numberOfAttribute; - int * _attributeIdentifier; - int * _attributeValue; - std::string * _attributeDescription; - int _numberOfGroup ; - std::string * _groupName ; - - -public : - - // Constructors and associated internal methods - SMESH_MEDFamily_i(int identifier, SMESH_subMesh_i* sm, - std::string name, std::string description, SALOME_MED::medEntityMesh entity ); - SMESH_MEDFamily_i(const SMESH_MEDFamily_i & f); - - // IDL Methods - void setProtocol(SALOME::TypeOfCommunication typ) {} - void release() {} - SALOME::SenderInt_ptr getSenderForNumber(SALOME_MED::medGeometryElement) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForNumberIndex() {return SALOME::SenderInt::_nil();} - - CORBA::Long getIdentifier() - throw (SALOME::SALOME_Exception); - CORBA::Long getNumberOfAttributes() - throw (SALOME::SALOME_Exception); - SALOME_TYPES::ListOfLong* getAttributesIdentifiers() - throw (SALOME::SALOME_Exception); - CORBA::Long getAttributeIdentifier(CORBA::Long i) - throw (SALOME::SALOME_Exception); - SALOME_TYPES::ListOfLong* getAttributesValues() - throw (SALOME::SALOME_Exception); - CORBA::Long getAttributeValue(CORBA::Long i) - throw (SALOME::SALOME_Exception); - SALOME_TYPES::ListOfString* getAttributesDescriptions() - throw (SALOME::SALOME_Exception); - char* getAttributeDescription( CORBA::Long i) - throw (SALOME::SALOME_Exception); - CORBA::Long getNumberOfGroups() - throw (SALOME::SALOME_Exception); - char * getGroupName( CORBA::Long i) - throw (SALOME::SALOME_Exception); - SALOME_TYPES::ListOfString* getGroupsNames() - throw (SALOME::SALOME_Exception); -}; -#endif /* MED_FAMILY_I_HXX_ */ diff --git a/src/SMESH_I/SMESH_MEDMesh_i.cxx b/src/SMESH_I/SMESH_MEDMesh_i.cxx deleted file mode 100644 index 367a58a73..000000000 --- a/src/SMESH_I/SMESH_MEDMesh_i.cxx +++ /dev/null @@ -1,1209 +0,0 @@ -// Copyright (C) 2007-2013 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. -// -// 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_Gen_i.hxx" -#include "SMESH_Mesh_i.hxx" - -#include "SMESHDS_Mesh.hxx" -#include "SMESHDS_SubMesh.hxx" - -#include "SMESH_MEDSupport_i.hxx" -#include "SMESH_MEDFamily_i.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -extern "C" -{ -#include -} - -using namespace std; - -//============================================================================= -/*! - * Default constructor - */ -//============================================================================= -// PN Est-ce un const ? -SMESH_MEDMesh_i::SMESH_MEDMesh_i() -{ - BEGIN_OF("Default Constructor SMESH_MEDMesh_i"); - END_OF("Default Constructor SMESH_MEDMesh_i"); -} - -//============================================================================= -/*! - * Destructor - */ -//============================================================================= -SMESH_MEDMesh_i::~SMESH_MEDMesh_i() -{ -} - -//============================================================================= -/*! - * Constructor - */ -//============================================================================= -SMESH_MEDMesh_i::SMESH_MEDMesh_i(::SMESH_Mesh_i * m_i):_meshId(""), - _compte(false), - _creeFamily(false), - _famIdent(0), - _indexElts(0), - _indexEnts(0) -{ - BEGIN_OF("Constructor SMESH_MEDMesh_i"); - - _mesh_i = m_i; - _meshDS = _mesh_i->GetImpl().GetMeshDS(); - - END_OF("Constructor SMESH_MEDMesh_i"); -} - -//============================================================================= -/*! - * CORBA: Accessor for Name - */ -//============================================================================= -char *SMESH_MEDMesh_i::getName() throw(SALOME::SALOME_Exception) -{ - if (_meshDS == NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - - try - { - SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::Study_var study = gen->GetCurrentStudy(); - SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( study, _mesh_i->_this()); - if ( meshSO->_is_nil() ) - return CORBA::string_dup("toto"); - - CORBA::String_var name = meshSO->GetName(); - - return CORBA::string_dup( name.in() ); - } - catch(...) - { - MESSAGE("Exception en accedant au nom"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } - return 0; -} - -//============================================================================= -/*! - * CORBA: Accessor for corbaindex cuisine interne - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::getCorbaIndex()throw(SALOME::SALOME_Exception) -{ - MESSAGE("Non Implemente"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); -} - -//============================================================================= -/*! - * CORBA: Accessor for Space Dimension - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::getSpaceDimension()throw(SALOME::SALOME_Exception) -{ - // PN : Il semblerait que la dimension soit fixee a 3 - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - return 3; -} - -//============================================================================= -/*! - * CORBA: Accessor for Mesh Dimension - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::getMeshDimension()throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - // PN : Il semblerait que la dimension soit fixee a 3 - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - return 3; -} -//============================================================================= -/*! - * CORBA: Accessor for the boolean _isAGrid - */ -//============================================================================= -CORBA::Boolean SMESH_MEDMesh_i::getIsAGrid() throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!!!! NOT YET IMPLEMENTED !!!!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - return false; -} -//============================================================================= -/*! - * CORBA: Accessor for the connectivities, to see if they exist - */ -//============================================================================= -CORBA::Boolean -SMESH_MEDMesh_i::existConnectivity(SALOME_MED::medConnectivity connectivityType, - SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!!!! IMPLEMENTED BUT ONLY PARTIALLY !!!!!!"); - - - return false; - -} -//============================================================================= -/*! - * CORBA: Accessor for Coordinate - */ -//============================================================================= -CORBA::Double SMESH_MEDMesh_i::getCoordinate(CORBA::Long Number, CORBA::Long Axis) - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!!!! NOT YET IMPLEMENTED !!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - return 0.0; -} -//============================================================================= -/*! - * CORBA: Accessor for Coordinates System - */ -//============================================================================= -char *SMESH_MEDMesh_i::getCoordinatesSystem() throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - // PN : En dur. Non encore prevu - try - { - string systcoo = "CARTESIEN"; - return CORBA::string_dup(systcoo.c_str()); - } - catch(...) - { - MESSAGE("Exception en accedant au maillage"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } -} - -//============================================================================= -/*! - * CORBA: Accessor for Coordinates - */ -//============================================================================= -SALOME_TYPES::ListOfDouble * SMESH_MEDMesh_i::getCoordinates -(SALOME_MED::medModeSwitch typeSwitch) throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - SALOME_TYPES::ListOfDouble_var myseq = new SALOME_TYPES::ListOfDouble; - try - { - // PN : En dur - int spaceDimension = 3; - int nbNodes = _meshDS->NbNodes(); - SCRUTE(nbNodes); - myseq->length(nbNodes * spaceDimension); - int i = 0; - - SMDS_NodeIteratorPtr itNodes=_meshDS->nodesIterator(); - while(itNodes->more()) - { - const SMDS_MeshNode* node = itNodes->next(); - - if (typeSwitch == SALOME_MED::MED_FULL_INTERLACE) - { - myseq[i * 3] = node->X(); - myseq[i * 3 + 1] = node->Y(); - myseq[i * 3 + 2] = node->Z(); - SCRUTE(myseq[i * 3]); - SCRUTE(myseq[i * 3 + 1]); - SCRUTE(myseq[i * 3 + 2]); - } - else - { - ASSERT(typeSwitch == SALOME_MED::MED_NO_INTERLACE); - myseq[i] = node->X(); - myseq[i + nbNodes] = node->Y(); - myseq[i + (nbNodes * 2)] = node->Z(); - SCRUTE(myseq[i]); - SCRUTE(myseq[i + nbNodes]); - SCRUTE(myseq[i + (nbNodes * 2)]); - } - i++; - } - } - catch(...) - { - MESSAGE("Exception en accedant aux coordonnees"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } - return myseq._retn(); -} - -//============================================================================= -/*! - * CORBA: Accessor for Coordinates Names - */ -//============================================================================= -SALOME_TYPES::ListOfString * -SMESH_MEDMesh_i::getCoordinatesNames()throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - SALOME_TYPES::ListOfString_var myseq = new SALOME_TYPES::ListOfString; - try - { - // PN : en dur - int spaceDimension = 3; - myseq->length(spaceDimension); - myseq[0] = CORBA::string_dup("x"); - myseq[1] = CORBA::string_dup("y"); - myseq[2] = CORBA::string_dup("z"); - } - catch(...) - { - MESSAGE("Exception en accedant aux noms des coordonnees"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } - return myseq._retn(); - -} - -//============================================================================= -/*! - * CORBA: Accessor for Coordinates Units - */ -//============================================================================= -SALOME_TYPES::ListOfString * -SMESH_MEDMesh_i::getCoordinatesUnits()throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - SALOME_TYPES::ListOfString_var myseq = new SALOME_TYPES::ListOfString; - try - { - // PN : en dur - int spaceDimension = 3; - myseq->length(spaceDimension); - myseq[0] = CORBA::string_dup("m"); - myseq[1] = CORBA::string_dup("m"); - myseq[2] = CORBA::string_dup("m"); - } - catch(...) - { - MESSAGE("Exception en accedant aux unites des coordonnees"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } - return myseq._retn(); -} - -//============================================================================= -/*! - * CORBA: Accessor for Number of Nodes - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::getNumberOfNodes()throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - try - { - return _meshDS->NbNodes(); - } - catch(...) - { - MESSAGE("Exception en accedant au nombre de noeuds"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } -} - -//============================================================================= -/*! - * CORBA: Accessor for number of Types - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::getNumberOfTypes(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - try - { - if (!_compte) - calculeNbElts(); - int retour = 0; - if (_mapNbTypes.find(entity) != _mapNbTypes.end()) - retour = _mapNbTypes[entity]; - return retour; - } - catch(...) - { - MESSAGE("Exception en accedant au nombre de Types"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } -} - -//============================================================================= -/*! - * CORBA: Accessor for existing geometry element types - * Not implemented for MED_ALL_ENTITIES - */ -//============================================================================= -SALOME_MED::medGeometryElement_array * -SMESH_MEDMesh_i::getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME:: - SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - if (entity == SALOME_MED::MED_ALL_ENTITIES) - THROW_SALOME_CORBA_EXCEPTION("Not implemented for MED_ALL_ENTITIES", - SALOME::BAD_PARAM); - if (!_compte) - calculeNbElts(); - SALOME_MED::medGeometryElement_array_var myseq = - new SALOME_MED::medGeometryElement_array; - try - { - if (_mapNbTypes.find(entity) == _mapNbTypes.end()) - THROW_SALOME_CORBA_EXCEPTION("No Such Entity in the mesh", - SALOME::BAD_PARAM); - int nbTypes = _mapNbTypes[entity]; - - myseq->length(nbTypes); - - if (_mapIndToVectTypes.find(entity) == _mapIndToVectTypes.end()) - THROW_SALOME_CORBA_EXCEPTION("No Such Entity in the mesh", - SALOME::INTERNAL_ERROR); - - int index = _mapIndToVectTypes[entity]; - ASSERT(_TypesId[index].size() != 0); - int i = 0; - vector < SALOME_MED::medGeometryElement >::iterator it; - for (it = _TypesId[index].begin(); it != _TypesId[index].end(); it++) - { - myseq[i++] = *it; - }; - } - catch(...) - { - MESSAGE("Exception en accedant aux differents types"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } - return myseq._retn(); -} - -//============================================================================= -/*! - * CORBA: Returns number of elements of type medGeometryElement - * Not implemented for MED_ALL_ELEMENTS - * implemented for MED_ALL_ENTITIES - * - * Dans cette implementation, il n est pas prevu de tenir compte du entity - * qui ne doit pas pouvoir avoir deux valeurs differentes pour un geomElement - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::getNumberOfElements(SALOME_MED:: - medEntityMesh entity, - SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - if (geomElement == SALOME_MED::MED_ALL_ELEMENTS) - THROW_SALOME_CORBA_EXCEPTION("Not implemented for MED_ALL_ELEMENTS", - SALOME::BAD_PARAM); - if (!_compte) - calculeNbElts(); - - try - { - int retour = 0; - if (_mapIndToSeqElts.find(geomElement) != _mapIndToSeqElts.end()) - { - int index = _mapIndToSeqElts[geomElement]; - - retour = _seq_elemId[index]->length(); - } - return retour; - } - catch(...) - { - MESSAGE("Exception en accedant au nombre d élements"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", - SALOME::INTERNAL_ERROR); - } -} - -//============================================================================= -/*! - * CORBA: Accessor for connectivities - */ -//============================================================================= -SALOME_TYPES::ListOfLong * -SMESH_MEDMesh_i::getConnectivity(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - if (mode != SALOME_MED::MED_NODAL) - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); - /*if (typeSwitch == SALOME_MED::MED_NO_INTERLACE) - THROW_SALOME_CORBA_EXCEPTION("Not Yet Implemented", SALOME::BAD_PARAM);*/ - if (!_compte) - calculeNbElts(); - - // Faut-il renvoyer un pointeur vide ??? - if (_mapIndToSeqElts.find(geomElement) != _mapIndToSeqElts.end()) - THROW_SALOME_CORBA_EXCEPTION("No Such Element in the mesh", - SALOME::BAD_PARAM); - - int index = _mapIndToSeqElts[geomElement]; - - return _seq_elemId[index]._retn(); -} - -//============================================================================= -/*! - * CORBA: Accessor for connectivities - */ -//============================================================================= -SALOME_TYPES::ListOfLong * -SMESH_MEDMesh_i::getConnectivityIndex(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception) -{ - MESSAGE("Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: Find an element corresponding to the given connectivity - */ -//============================================================================= -CORBA::Long -SMESH_MEDMesh_i::getElementNumber(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement type, - const SALOME_TYPES::ListOfLong & connectivity) - throw(SALOME::SALOME_Exception) -{ - MESSAGE("getElementNumber(): Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return -1; -} - -//============================================================================= -/*! - * CORBA: Accessor for Ascendant connectivities - * not implemented for MED_ALL_ENTITIES and MED_MAILLE - */ -//============================================================================= -SALOME_TYPES::ListOfLong * -SMESH_MEDMesh_i::getReverseConnectivity(SALOME_MED:: - medConnectivity mode) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: Accessor for connectivities - */ -//============================================================================= -SALOME_TYPES::ListOfLong * -SMESH_MEDMesh_i::getReverseConnectivityIndex(SALOME_MED:: - medConnectivity mode) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: Returns number of families within the mesh - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::getNumberOfFamilies(SALOME_MED:: - medEntityMesh entity) throw(SALOME::SALOME_Exception) -{ - if (_creeFamily == false) - createFamilies(); - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - return _families.size(); -} - -//============================================================================= -/*! - * CORBA: Returns number of groups within the mesh - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::getNumberOfGroups(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - MESSAGE(" Pas d implementation des groupes dans SMESH"); - return 0; -} - -//============================================================================= -/*! - * CORBA: Returns references for families within the mesh - */ -//============================================================================= -SALOME_MED::Family_array * -SMESH_MEDMesh_i::getFamilies(SALOME_MED:: - medEntityMesh entity) throw(SALOME::SALOME_Exception) -{ - if (_creeFamily == false) - createFamilies(); - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - SALOME_MED::Family_array_var myseq = new SALOME_MED::Family_array; - int nbfam = _families.size(); - myseq->length(nbfam); - int i = 0; - vector < SALOME_MED::FAMILY_ptr >::iterator it; - for (it = _families.begin(); it != _families.end(); it++) - { - myseq[i++] = *it; - }; - return myseq._retn(); -} - -//============================================================================= -/*! - * CORBA: Returns references for family i within the mesh - */ -//============================================================================= -SALOME_MED::FAMILY_ptr SMESH_MEDMesh_i::getFamily(SALOME_MED:: - medEntityMesh entity, CORBA::Long i) throw(SALOME::SALOME_Exception) -{ - if (_creeFamily == false) - createFamilies(); - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - - SCRUTE(_families[i]->getName()); - MESSAGE(" SMESH_MEDMesh_i::getFamily " << i) return _families[i]; -} - -//============================================================================= -/*! - * CORBA: Returns references for groups within the mesh - */ -//============================================================================= -SALOME_MED::Group_array * -SMESH_MEDMesh_i::getGroups(SALOME_MED::medEntityMesh entity) throw(SALOME:: - SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - MESSAGE(" Pas d implementation des groupes dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("No group implementation", SALOME::BAD_PARAM); -} - -//============================================================================= -/*! - * CORBA: Returns references for group i within the mesh - */ -//============================================================================= -SALOME_MED::GROUP_ptr SMESH_MEDMesh_i::getGroup(SALOME_MED:: - medEntityMesh entity, CORBA::Long i) throw(SALOME::SALOME_Exception) -{ - if (_mesh_i == 0) - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - MESSAGE(" Pas d implementation des groupes dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("No group implementation", SALOME::BAD_PARAM); -} -//============================================================================= -/*! - * CORBA: Returns references for the global numbering index - */ -//============================================================================= -SALOME_TYPES::ListOfLong* -SMESH_MEDMesh_i::getGlobalNumberingIndex(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 boundary elements of type - * entity - */ -//============================================================================= -SALOME_MED::SUPPORT_ptr -SMESH_MEDMesh_i::getBoundaryElements(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - 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 - */ -//============================================================================= -SALOME_MED::SUPPORT_ptr -SMESH_MEDMesh_i::getSkin(SALOME_MED::SUPPORT_ptr mySupport3D) - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - return NULL; -} -//============================================================================= -/*! - * CORBA: - */ -//============================================================================= -SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getVolume(SALOME_MED:: - SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: - */ -//============================================================================= -SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getArea(SALOME_MED:: - SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: - */ -//============================================================================= -SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getLength(SALOME_MED:: - SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: - */ -//============================================================================= -SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getNormal(SALOME_MED:: - SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: - */ -//============================================================================= -SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getBarycenter(SALOME_MED:: - SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Pas Implemente dans SMESH"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: - */ -//============================================================================= -SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getNeighbourhood(SALOME_MED:: - SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Non Implemente"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * CORBA: add the Mesh in the StudyManager - * PN Pas Implemente - */ -//============================================================================= -void SMESH_MEDMesh_i::addInStudy(SALOMEDS::Study_ptr myStudy, - SALOME_MED::GMESH_ptr myIor) throw(SALOME::SALOME_Exception) -{ - BEGIN_OF("MED_Mesh_i::addInStudy"); - if (_meshId != "") - { - MESSAGE("Mesh already in Study"); - THROW_SALOME_CORBA_EXCEPTION("Mesh already in Study", SALOME::BAD_PARAM); - } - END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)"); -} - -//============================================================================= -/*! - * CORBA: write mesh in a med file - */ -//============================================================================= -void SMESH_MEDMesh_i::write(CORBA::Long i, const char *driverMeshName) - throw(SALOME::SALOME_Exception) -{ - MESSAGE("Non Implemente"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); -} - -//============================================================================= -/*! - * CORBA: read mesh in a med file - */ -//============================================================================= -void SMESH_MEDMesh_i::read(CORBA::Long i) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Non Implemente"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); -} - -//============================================================================= -/*! - * CORBA : release driver - */ -//============================================================================= -void SMESH_MEDMesh_i::rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Non Implemente"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); -} - -//============================================================================= -/*! - * CORBA : attach driver - */ -//============================================================================= -CORBA::Long SMESH_MEDMesh_i::addDriver(SALOME_MED::medDriverTypes driverType, - const char *fileName, const char *meshName) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Non Implemente"); - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - return 0; -} - -//============================================================================= -/*! - * Calcule le Nb d'elements par entite geometrique - */ -//============================================================================= -void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception) -{ - if (!_compte) - { - _compte = true; - - _mapNbTypes[SALOME_MED::MED_NODE] = 1; - // On compte les aretes MED_SEG2 ou MED_SEG3 - // On range les elements dans les vecteurs correspondants - - _mapIndToSeqElts[SALOME_MED::MED_SEG2] = _indexElts++; - _mapIndToSeqElts[SALOME_MED::MED_SEG3] = _indexElts++; - _mapIndToVectTypes[SALOME_MED::MED_EDGE] = _indexEnts++; - - int trouveSeg2 = 0; - int trouveSeg3 = 0; - SALOME_MED::medGeometryElement medElement; - - SMDS_EdgeIteratorPtr itEdges=_meshDS->edgesIterator(); - while(itEdges->more()) - { - const SMDS_MeshEdge* elem = itEdges->next(); - int nb_of_nodes = elem->NbNodes(); - - switch (nb_of_nodes) - { - case 2: - { - medElement = SALOME_MED::MED_SEG2; - if (trouveSeg2 == 0) - { - trouveSeg2 = 1; - _TypesId[SALOME_MED::MED_EDGE]. - push_back(SALOME_MED::MED_SEG2); - } - break; - } - case 3: - { - medElement = SALOME_MED::MED_SEG3; - if (trouveSeg3 == 0) - { - trouveSeg3 = 1; - _TypesId[SALOME_MED::MED_EDGE]. - push_back(SALOME_MED::MED_SEG3); - } - break; - } - } - int index = _mapIndToSeqElts[medElement]; - SCRUTE(index); - // Traitement de l arete - - int longueur = _seq_elemId[index]->length(); - _seq_elemId[index]->length(longueur + nb_of_nodes); - - SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator(); - - for(int k=0; itn->more(); k++) - _seq_elemId[index][longueur + k] = itn->next()->GetID()+1; - } - - _mapNbTypes[SALOME_MED::MED_EDGE] = trouveSeg2 + trouveSeg3; - - // On compte les faces MED_TRIA3, MED_HEXA8, MED_TRIA6 - // On range les elements dans les vecteurs correspondants - int trouveTria3 = 0; - int trouveTria6 = 0; - int trouveQuad4 = 0; - - _mapIndToSeqElts[SALOME_MED::MED_TRIA3] = _indexElts++; - _mapIndToSeqElts[SALOME_MED::MED_TRIA6] = _indexElts++; - _mapIndToSeqElts[SALOME_MED::MED_QUAD4] = _indexElts++; - _mapIndToVectTypes[SALOME_MED::MED_FACE] = _indexEnts++; - - SMDS_FaceIteratorPtr itFaces=_meshDS->facesIterator(); - while(itFaces->more()) - { - const SMDS_MeshFace * elem = itFaces->next(); - int nb_of_nodes = elem->NbNodes(); - - switch (nb_of_nodes) - { - case 3: - { - medElement = SALOME_MED::MED_TRIA3; - if (trouveTria3 == 0) - { - trouveTria3 = 1; - _TypesId[SALOME_MED::MED_FACE]. - push_back(SALOME_MED::MED_TRIA3); - } - break; - } - case 4: - { - medElement = SALOME_MED::MED_QUAD4; - if (trouveQuad4 == 0) - { - trouveQuad4 = 1; - _TypesId[SALOME_MED::MED_FACE]. - push_back(SALOME_MED::MED_QUAD4); - } - break; - } - case 6: - { - medElement = SALOME_MED::MED_TRIA6; - if (trouveTria6 == 0) - { - trouveTria6 = 1; - _TypesId[SALOME_MED::MED_FACE]. - push_back(SALOME_MED::MED_TRIA6); - } - break; - } - } - int index = _mapIndToSeqElts[medElement]; - SCRUTE(index); - - // Traitement de la face - // Attention La numérotation des noeuds Med commence a 1 - - int longueur = _seq_elemId[index]->length(); - _seq_elemId[index]->length(longueur + nb_of_nodes); - - SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator(); - - for(int k=0; itn->more(); k++) - _seq_elemId[index][longueur + k] = itn->next()->GetID()+1; - } //itFaces - - _mapNbTypes[SALOME_MED::MED_FACE] = - trouveTria3 + trouveTria6 + trouveQuad4; - - _mapIndToSeqElts[SALOME_MED::MED_HEXA8] = _indexElts++; - _mapIndToVectTypes[SALOME_MED::MED_CELL] = _indexEnts++; - int index = _mapIndToSeqElts[medElement]; - - int trouveHexa8 = 0; - - SMDS_VolumeIteratorPtr itVolumes=_meshDS->volumesIterator(); - while(itVolumes->more()) - { - const SMDS_MeshVolume * elem = itVolumes->next(); - - int nb_of_nodes = elem->NbNodes(); - medElement = SALOME_MED::MED_HEXA8; - ASSERT(nb_of_nodes == 8); - - if (trouveHexa8 == 0) - { - trouveHexa8 = 1; - _TypesId[SALOME_MED::MED_CELL].push_back(SALOME_MED::MED_HEXA8); - }; - // Traitement de la maille - int longueur = _seq_elemId[index]->length(); - _seq_elemId[index]->length(longueur + nb_of_nodes); - - SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator(); - for(int k=0; itn->more(); k++) - _seq_elemId[index][longueur + k] = itn->next()->GetID()+1; - } - - _mapNbTypes[SALOME_MED::MED_CELL] = trouveHexa8; - _mapNbTypes[SALOME_MED::MED_ALL_ENTITIES] - = - trouveHexa8 + trouveTria3 + trouveTria6 + trouveQuad4 + trouveSeg2 + - trouveSeg3; - }// fin du _compte -}; - -//============================================================================= -/*! - * Creation des familles - */ -//============================================================================= -void SMESH_MEDMesh_i::createFamilies() throw(SALOME::SALOME_Exception) -{ - Unexpect aCatch(SALOME_SalomeException); - string famDes = ("Je ne sais pas"); - string famName0 = "Famille_"; - string famName; - char numero[10]; - - if (_creeFamily == false) - { - _creeFamily = true; - //SMESH_subMesh_i *subMeshServant; - - map < int, SMESH_subMesh_i * >::iterator it; - for (it = _mesh_i->_mapSubMesh_i.begin(); - it != _mesh_i->_mapSubMesh_i.end(); it++) - { - SMESH_subMesh_i *submesh_i = (*it).second; - int famIdent = (*it).first; - - ASSERT(famIdent < 999999999); - sprintf(numero, "%d\n", famIdent); - famName = famName0 + numero; - - SMESH_MEDFamily_i *famservant = - new SMESH_MEDFamily_i(famIdent, submesh_i, - famName, famDes, SALOME_MED::MED_NODE); -#ifdef WNT - SALOME_MED::FAMILY_ptr famille = SALOME_MED::FAMILY::_nil(); - POA_SALOME_MED::FAMILY* servantbase = dynamic_cast(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); - } - } -}; -//============================================================================= -/*! - * Gives informations of the considered mesh. - */ -//============================================================================= -SALOME_MED::GMESH::meshInfos * SMESH_MEDMesh_i::getMeshGlobal() - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - return NULL; -} - -//================================================================================ -/*! - * \brief Converts this GMESH into MESH - */ -//================================================================================ - -SALOME_MED::MESH_ptr SMESH_MEDMesh_i::convertInMESH() throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - return NULL; -} - -//============================================================================= -/*! - * Gives informations on coordinates of the considered mesh. - */ -//============================================================================= -SALOME_MED::GMESH::coordinateInfos * SMESH_MEDMesh_i::getCoordGlobal() - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - return NULL; -} -//============================================================================= -/*! - * Gives informations on connectivities of the considered mesh for the entity - * entity. - */ -//============================================================================= -SALOME_MED::MESH::connectivityInfos * -SMESH_MEDMesh_i::getConnectGlobal(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - return NULL; -} -//============================================================================= -/*! - * Gives the type of the element number of entity entity - */ -//============================================================================= -SALOME_MED::medGeometryElement -SMESH_MEDMesh_i::getElementType(SALOME_MED::medEntityMesh entity, - CORBA::Long number) - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!"); - - THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM); - - return (SALOME_MED::medGeometryElement) 0; -} diff --git a/src/SMESH_I/SMESH_MEDMesh_i.hxx b/src/SMESH_I/SMESH_MEDMesh_i.hxx deleted file mode 100644 index db415bcfe..000000000 --- a/src/SMESH_I/SMESH_MEDMesh_i.hxx +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (C) 2007-2013 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. -// -// 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.hxx -// Module : SMESH -// -#ifndef _MED_SMESH_MESH_I_HXX_ -#define _MED_SMESH_MESH_I_HXX_ - -#include "SMESH.hxx" - -#include -#include CORBA_SERVER_HEADER(MED) -#include -#include -#include - -#include "SMESHDS_Mesh.hxx" - -#include "SMDS_MeshElement.hxx" -#include "SMDS_MeshNode.hxx" -#include "SALOME_GenericObj_i.hh" - -#define MED_NBR_GEOMETRIE_MAILLE 15 -#define MED_NBR_TYPE 5 - -class SMESH_Mesh_i; - -class SMESH_I_EXPORT SMESH_MEDMesh_i: - public virtual POA_SALOME_MED::MESH, - public virtual SALOME::GenericObj_i -{ -protected: - // C++ object containing values - ::SMESH_Mesh_i * _mesh_i; - SMESHDS_Mesh *_meshDS; - - std::string _meshId; - bool _compte; - bool _creeFamily; - int _indexElts; - int _indexEnts; - int _famIdent; - - std::map < SALOME_MED::medGeometryElement, int >_mapIndToSeqElts; - SALOME_TYPES::ListOfLong_var _seq_elemId[MED_NBR_GEOMETRIE_MAILLE]; - - std::map < SALOME_MED::medEntityMesh, int >_mapNbTypes; - std::map < SALOME_MED::medEntityMesh, int >_mapIndToVectTypes; - std::vector < SALOME_MED::medGeometryElement > - _TypesId[MED_NBR_GEOMETRIE_MAILLE]; - - std::vector < SALOME_MED::FAMILY_ptr > _families; -public: - - // Constructors and associated internal methods - SMESH_MEDMesh_i(); - SMESH_MEDMesh_i(SMESH_Mesh_i * m); - ~SMESH_MEDMesh_i(); - - // IDL Methods - void setProtocol(SALOME::TypeOfCommunication typ) {} - void release() {} - SALOME::SenderDouble_ptr getSenderForCoordinates(SALOME_MED::medModeSwitch) {return SALOME::SenderDouble::_nil();} - SALOME::SenderInt_ptr getSenderForConnectivity(SALOME_MED::medConnectivity, - SALOME_MED::medEntityMesh, - SALOME_MED::medGeometryElement) - { - return SALOME::SenderInt::_nil(); - } - SALOME::SenderInt_ptr getSenderForConnectivityIndex(SALOME_MED::medConnectivity, - SALOME_MED::medEntityMesh, - SALOME_MED::medGeometryElement) - { - return SALOME::SenderInt::_nil(); - } - SALOME::SenderInt_ptr getSenderForPolygonsConnectivity(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolygonsConnectivityIndex(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolyhedronConnectivity(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolyhedronIndex(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolyhedronFacesIndex() {return SALOME::SenderInt::_nil();} - - char *getName() throw(SALOME::SALOME_Exception); - CORBA::Long getSpaceDimension() throw(SALOME::SALOME_Exception); - - CORBA::Long getMeshDimension() throw(SALOME::SALOME_Exception); - - CORBA::Boolean getIsAGrid() throw (SALOME::SALOME_Exception); - - CORBA::Boolean - existConnectivity(SALOME_MED::medConnectivity connectivityType, - SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - char *getCoordinatesSystem() throw(SALOME::SALOME_Exception); - - CORBA::Double getCoordinate(CORBA::Long Number, CORBA::Long Axis) - throw (SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfDouble * getCoordinates(SALOME_MED::medModeSwitch typeSwitch) - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfString * getCoordinatesNames() - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfString * getCoordinatesUnits() - throw(SALOME::SALOME_Exception); - - CORBA::Long getNumberOfNodes() throw(SALOME::SALOME_Exception); - - CORBA::Long getNumberOfTypes(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::medGeometryElement_array * - getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME:: - SALOME_Exception); - - SALOME_MED::medGeometryElement - getElementType(SALOME_MED::medEntityMesh entity, - CORBA::Long number) - throw (SALOME::SALOME_Exception); - - CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfLong * - getConnectivity(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfLong * - getConnectivityIndex(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfLong* - getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement type, - const SALOME_TYPES::ListOfLong & connectivity) - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfLong * - getReverseConnectivity(SALOME_MED::medConnectivity mode) - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfLong * - getReverseConnectivityIndex(SALOME_MED::medConnectivity mode) - throw(SALOME::SALOME_Exception); - - // Family and Group - CORBA::Long getNumberOfFamilies(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::Family_array * - getFamilies(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity, - CORBA::Long i) - throw(SALOME::SALOME_Exception); - - SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::GROUP_ptr getGroup(SALOME_MED::medEntityMesh entity, - CORBA::Long i) - throw(SALOME::SALOME_Exception); - - SALOME_MED::SUPPORT_ptr - getBoundaryElements(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - SALOME_MED::SUPPORT_ptr - getSupportOnAll(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - SALOME_MED::SUPPORT_ptr getSkin(SALOME_MED::SUPPORT_ptr mySupport3D) - throw (SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getVolume(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getArea(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getLength(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getNormal(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getBarycenter(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getNeighbourhood(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - // Others - void addInStudy(SALOMEDS::Study_ptr myStudy, - SALOME_MED::GMESH_ptr myIor) - throw(SALOME::SALOME_Exception); - CORBA::Long addDriver(SALOME_MED::medDriverTypes driverType, - const char *fileName, const char *meshName) - throw(SALOME::SALOME_Exception); - void rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception); - void read(CORBA::Long i) throw(SALOME::SALOME_Exception); - void write(CORBA::Long i, const char *driverMeshName) - throw(SALOME::SALOME_Exception); - - // Cuisine interne - CORBA::Long getCorbaIndex() - throw(SALOME::SALOME_Exception); - - SALOME_MED::GMESH::meshInfos * getMeshGlobal() - throw (SALOME::SALOME_Exception); - - bool areEquals(SALOME_MED::GMESH_ptr other) { return false;}; - - SALOME_MED::MESH_ptr convertInMESH() throw (SALOME::SALOME_Exception); - - SALOME_MED::GMESH::coordinateInfos * getCoordGlobal() - throw (SALOME::SALOME_Exception); - - SALOME_MED::MESH::connectivityInfos * - getConnectGlobal(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - // - void calculeNbElts() throw(SALOME::SALOME_Exception); - void createFamilies() throw(SALOME::SALOME_Exception); -}; - -#endif /* _MED_MESH_I_HXX_ */ diff --git a/src/SMESH_I/SMESH_MEDSupport_i.cxx b/src/SMESH_I/SMESH_MEDSupport_i.cxx deleted file mode 100644 index 803ffa67f..000000000 --- a/src/SMESH_I/SMESH_MEDSupport_i.cxx +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (C) 2007-2013 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. -// -// 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_MEDSupport_i.cxx -// Module : SMESH -// -#include "SMESH_MEDSupport_i.hxx" -#include "utilities.h" -#include "Utils_CorbaException.hxx" -#include "Utils_ExceptHandlers.hxx" - -#include "SMESHDS_Mesh.hxx" - -#include "SMESH_subMesh.hxx" -#include "SMESH_Mesh_i.hxx" -#include "SMESH_subMesh_i.hxx" -#include "SMESH_Gen_i.hxx" - -#include - -using namespace std; - - -//============================================================================= -/*! - * Default constructor - */ -//============================================================================= -SMESH_MEDSupport_i::SMESH_MEDSupport_i() -{ - BEGIN_OF("Default Constructor SMESH_MEDSupport_i"); - END_OF("Default Constructor SMESH_MEDSupport_i"); -} - -//============================================================================= -/*! - * Constructor - */ -//============================================================================= -SMESH_MEDSupport_i::SMESH_MEDSupport_i(SMESH_subMesh_i * sm, string name, - string description, SALOME_MED::medEntityMesh entity) - :_subMesh_i(sm), _name(name), _description(description), _entity(entity), - _seqNumber(false), _seqLength(0) -{ - BEGIN_OF("Constructor SMESH_MEDSupport_i"); - - int subMeshId = sm->GetId(); - - MESSAGE(" subMeshId " << subMeshId); - - SMESH_Mesh_i* mesh_i = SMESH::DownCast( sm->GetMesh() ); - _subMesh = mesh_i->GetImpl().GetSubMeshContaining( subMeshId ); - - if (_entity == SALOME_MED::MED_NODE) - { - _numberOfGeometricType = 1; - _geometricType = new SALOME_MED::medGeometryElement[1]; - _geometricType[0] = SALOME_MED::MED_NONE; - } - else - { - MESSAGE("Pas implemente dans cette version"); - THROW_SALOME_CORBA_EXCEPTION - ("Seules les familles de noeuds sont implementees ", - SALOME::BAD_PARAM); - } - - END_OF("Constructor SMESH_MEDSupport_i"); -} - -//============================================================================= -/*! - * Constructor - */ -//============================================================================= -SMESH_MEDSupport_i:: -SMESH_MEDSupport_i(const SMESH_MEDSupport_i & s):_subMesh(s._subMesh), -_name(s._name), _description(s._description), _entity(s._entity), -_seqNumber(false), _seqLength(0) -{ - BEGIN_OF("Constructor SMESH_MEDSupport_i"); - - END_OF("Constructor SMESH_MEDSupport_i"); -} - -//============================================================================= -/*! - * Destructor - */ -//============================================================================= - -SMESH_MEDSupport_i::~SMESH_MEDSupport_i() -{ -} - -//============================================================================= -/*! - * CORBA: Accessor for Corba Index - */ -//============================================================================= - -CORBA::Long SMESH_MEDSupport_i::getCorbaIndex()throw(SALOME::SALOME_Exception) -{ - if (_subMesh == NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - MESSAGE("Not implemented for SMESH_i"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented ", SALOME::BAD_PARAM); - -} - -//============================================================================= -/*! - * CORBA: Accessor for Name - */ -//============================================================================= - -char *SMESH_MEDSupport_i::getName() throw(SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - return CORBA::string_dup(_name.c_str()); - -} - -//============================================================================= -/*! - * CORBA: Accessor for Description - */ -//============================================================================= - -char *SMESH_MEDSupport_i::getDescription() throw(SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - return CORBA::string_dup(_description.c_str()); -} - -//============================================================================= -/*! - * CORBA: Accessor for Mesh - */ -//============================================================================= - -SALOME_MED::GMESH_ptr SMESH_MEDSupport_i::getMesh()throw(SALOME:: - SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - - return _subMesh_i->GetMesh()->GetMEDMesh(); -} - -//============================================================================= -/*! - * CORBA: boolean indicating if support concerns all elements - */ -//============================================================================= - -CORBA::Boolean SMESH_MEDSupport_i::isOnAllElements()throw(SALOME:: - SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - if (_seqNumber == false) - { - if (_entity != SALOME_MED::MED_NONE) - { - _seqLength = _subMesh_i->GetNumberOfNodes(/*all=*/false); - _seqNumber = true; - } - else - { - MESSAGE("Only Node Families are implemented "); - THROW_SALOME_CORBA_EXCEPTION("Not implemented Yet ", - SALOME::BAD_PARAM); - } - } - try - { - _isOnAllElements = (_seqLength == _subMesh->GetFather()->NbNodes()); - } - catch(...) - { - MESSAGE("unable to acces related Mesh"); - THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", - SALOME::INTERNAL_ERROR); - }; - return _isOnAllElements; -} - -//============================================================================= -/*! - * CORBA: Accessor for type of support's entity - */ -//============================================================================= - -SALOME_MED::medEntityMesh SMESH_MEDSupport_i::getEntity()throw(SALOME:: - SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - return _entity; -} - -//============================================================================= -/*! - * CORBA: Accessor for types of geometry elements - */ -//============================================================================= - -SALOME_MED::medGeometryElement_array * - SMESH_MEDSupport_i::getTypes()throw(SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - SALOME_MED::medGeometryElement_array_var myseq = - new SALOME_MED::medGeometryElement_array; - try - { - int mySeqLength = _numberOfGeometricType; - myseq->length(mySeqLength); - for (int i = 0; i < mySeqLength; i++) - { - myseq[i] = _geometricType[i]; - } - } - catch(...) - { - MESSAGE("Exception lors de la recherche des differents types"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support Types", - SALOME::INTERNAL_ERROR); - } - return myseq._retn(); -} - -//============================================================================= -/*! - * CORBA: Number of different types of geometry elements - * existing in the support - */ -//============================================================================= -CORBA::Long SMESH_MEDSupport_i::getNumberOfElements(SALOME_MED:: - medGeometryElement geomElement) throw(SALOME::SALOME_Exception) -{ - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - return _numberOfGeometricType; - -} - -//============================================================================= -/*! - * CORBA: get Nodes - */ -//============================================================================= - -SALOME_TYPES::ListOfLong * SMESH_MEDSupport_i::getNumber( - SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception) -{ - Unexpect aCatch(SALOME_SalomeException); - if (_subMesh==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", - SALOME::INTERNAL_ERROR); - - // A changer s'il ne s agit plus seulement de famille de noeuds - if (geomElement != SALOME_MED::MED_NONE) - THROW_SALOME_CORBA_EXCEPTION("Not implemented", SALOME::BAD_PARAM); - - SALOME_TYPES::ListOfLong_var myseq = new SALOME_TYPES::ListOfLong; - - int i = 0; - myseq->length(_subMesh_i->GetNumberOfNodes(/*all=*/false)); - - if ( _subMesh->GetSubMeshDS() ) - { - SMDS_NodeIteratorPtr it = _subMesh->GetSubMeshDS()->GetNodes(); - while(it->more()) - { - myseq[i] = it->next()->GetID(); - i++; - }; - } - - SCRUTE(myseq->length()); - MESSAGE("End of SMESH_MEDSupport_i::getNumber"); - return myseq._retn(); - -} - -//============================================================================= -/*! - * CORBA: get Nodes from file - */ -//============================================================================= - -SALOME_TYPES::ListOfLong * SMESH_MEDSupport_i::getNumberFromFile( - SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception) -{ - return getNumber(geomElement); -} - -//============================================================================= -/*! - * CORBA: Global Nodes Index (optionnaly designed by the user) - * CORBA: ?????????????????????????????? - */ -//============================================================================= - -SALOME_TYPES::ListOfLong * - SMESH_MEDSupport_i::getNumberIndex()throw(SALOME::SALOME_Exception) -{ - MESSAGE("Not implemented for SMESH_i"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); - return NULL; -} -//============================================================================= -/*! - * CORBA: Array containing indexes for elements included in the support - */ -//============================================================================= - -CORBA::Long SMESH_MEDSupport_i::getNumberOfGaussPoint(SALOME_MED:: - medGeometryElement geomElement) throw(SALOME::SALOME_Exception) -{ - MESSAGE("Not implemented for SMESH_i"); - return 0; -} -//============================================================================= -/*! - * Gives the number of types of elements included in the support - */ -//============================================================================= -CORBA::Long SMESH_MEDSupport_i::getNumberOfTypes() - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!! NOT YET IMPLEMENTED !!!!"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); - return 0; -} -//============================================================================= -/*! - * Gives CORBA: Array containing the numbers of Gauss point of elements - * included in the support - */ -//============================================================================= -SALOME_TYPES::ListOfLong* SMESH_MEDSupport_i::getNumbersOfGaussPoint() - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!! NOT YET IMPLEMENTED !!!!"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); - return NULL; -} -//============================================================================= -/*! - * build the object which will contain all the boundary elements of the mesh. - */ -//============================================================================= -void SMESH_MEDSupport_i::getBoundaryElements() - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!! NOT YET IMPLEMENTED !!!!"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); -} -//============================================================================= -/*! - * Gives information on the support - */ -//============================================================================= -SALOME_MED::SUPPORT::supportInfos * SMESH_MEDSupport_i::getSupportGlobal() - throw (SALOME::SALOME_Exception) -{ - MESSAGE("!!! NOT YET IMPLEMENTED !!!!"); - THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); - return NULL; -} diff --git a/src/SMESH_I/SMESH_MEDSupport_i.hxx b/src/SMESH_I/SMESH_MEDSupport_i.hxx deleted file mode 100644 index d8c1c8349..000000000 --- a/src/SMESH_I/SMESH_MEDSupport_i.hxx +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (C) 2007-2013 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. -// -// 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_MEDSupport_i.hxx -// Module : SMESH -// -#ifndef _MED_SMESH_MEDSUPPORT_I_HXX_ -#define _MED_SMESH_MEDSUPPORT_I_HXX_ - -#include "SMESH.hxx" - -#include -#include CORBA_SERVER_HEADER(MED) -#include - -#include "SMESHDS_Mesh.hxx" -#include "SMESHDS_SubMesh.hxx" -#include "SMDS_MeshElement.hxx" -#include "SMDS_MeshNode.hxx" - -#include "SMESH_MEDSupport_i.hxx" -#include "SALOME_GenericObj_i.hh" -class SMESH_subMesh; -class SMESH_subMesh_i; - -class SMESH_I_EXPORT SMESH_MEDSupport_i: - public virtual POA_SALOME_MED::SUPPORT, public virtual SALOME::GenericObj_i -{ - public: - -// Constructors and associated internal methods - SMESH_MEDSupport_i(SMESH_subMesh_i * sm, - std::string name, std::string description, SALOME_MED::medEntityMesh entity); - SMESH_MEDSupport_i(const SMESH_MEDSupport_i & s); - -// IDL Methods - char *getName() throw(SALOME::SALOME_Exception); - char *getDescription() throw(SALOME::SALOME_Exception); - SALOME_MED::GMESH_ptr getMesh() throw(SALOME::SALOME_Exception); - CORBA::Boolean isOnAllElements() throw(SALOME::SALOME_Exception); - SALOME_MED::medEntityMesh getEntity() throw(SALOME::SALOME_Exception); - CORBA::Long - getNumberOfElements(SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); - - CORBA::Long getNumberOfTypes() throw (SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfLong * - getNumber(SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); - - /*! - * Same function as getNumber. - */ - SALOME_TYPES::ListOfLong * - getNumberFromFile(SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfLong * getNumberIndex() - throw(SALOME::SALOME_Exception); - - CORBA::Long - getNumberOfGaussPoint(SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); - - SALOME_TYPES::ListOfLong* getNumbersOfGaussPoint() - throw (SALOME::SALOME_Exception); - - SALOME_MED::medGeometryElement_array *getTypes() - throw(SALOME::SALOME_Exception); - - void getBoundaryElements() throw (SALOME::SALOME_Exception); - - CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception); - - SALOME_MED::SUPPORT::supportInfos * getSupportGlobal() - throw (SALOME::SALOME_Exception); - - void createSeq() throw(SALOME::SALOME_Exception); - - public: //public field - SMESH_subMesh_i * _subMesh_i; - ::SMESH_subMesh * _subMesh; - - std::string _name; - std::string _description; - bool _isOnAllElements; - bool _seqNumber; - int _seqLength; - - SALOME_MED::medEntityMesh _entity; - SALOME_MED::medGeometryElement * _geometricType; - int _numberOfGeometricType; - - protected: - SMESH_MEDSupport_i(); - ~SMESH_MEDSupport_i(); -}; - -#endif /* _MED_MEDSUPPORT_I_HXX_ */ diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index c5aaf0d5b..c6bb913d7 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -43,7 +43,6 @@ #include "SMESH_Gen_i.hxx" #include "SMESH_Group.hxx" #include "SMESH_Group_i.hxx" -#include "SMESH_MEDMesh_i.hxx" #include "SMESH_MeshEditor.hxx" #include "SMESH_MeshEditor_i.hxx" #include "SMESH_MeshPartDS.hxx" @@ -383,7 +382,7 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName ) int major, minor, release; if( !MED::getMEDVersion( theFileName, major, minor, release ) ) major = minor = release = -1; - _medFileInfo = new SALOME_MED::MedFileInfo(); + _medFileInfo = new SMESH::MedFileInfo(); _medFileInfo->fileName = theFileName; _medFileInfo->fileSize = 0; #ifdef WIN32 @@ -3007,23 +3006,6 @@ void SMESH_Mesh_i::ExportGMF(::SMESH::SMESH_IDSource_ptr meshPart, << withRequiredGroups << ")"; } -//============================================================================= -/*! - * Return implementation of SALOME_MED::MESH interfaces - */ -//============================================================================= - -SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()throw(SALOME::SALOME_Exception) -{ - Unexpect aCatch(SALOME_SalomeException); - if ( _preMeshInfo ) - _preMeshInfo->FullLoadFromFile(); - - SMESH_MEDMesh_i *aMedMesh = new SMESH_MEDMesh_i(this); - SALOME_MED::MESH_var aMesh = aMedMesh->_this(); - return aMesh._retn(); -} - //============================================================================= CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception) @@ -4340,11 +4322,11 @@ SMESH::ListOfGroups* SMESH_Mesh_i::GetGroups(const list& groupIDs) const */ //============================================================================= -SALOME_MED::MedFileInfo* SMESH_Mesh_i::GetMEDFileInfo() +SMESH::MedFileInfo* SMESH_Mesh_i::GetMEDFileInfo() { - SALOME_MED::MedFileInfo_var res( _medFileInfo ); + SMESH::MedFileInfo_var res( _medFileInfo ); if ( !res.operator->() ) { - res = new SALOME_MED::MedFileInfo; + res = new SMESH::MedFileInfo; res->fileName = ""; res->fileSize = res->major = res->minor = res->release = -1; } diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index 68d60d0e1..831b7ba20 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -34,7 +34,6 @@ #include CORBA_SERVER_HEADER(SMESH_Group) #include CORBA_SERVER_HEADER(SMESH_Hypothesis) #include CORBA_CLIENT_HEADER(GEOM_Gen) -#include CORBA_CLIENT_HEADER(MED) #include "SMESH_Hypothesis.hxx" #include "SMESH_Mesh.hxx" @@ -265,9 +264,6 @@ public: const char* file, CORBA::Boolean isascii) throw (SALOME::SALOME_Exception); - SALOME_MED::MESH_ptr GetMEDMesh() - throw (SALOME::SALOME_Exception); - CORBA::Long NbNodes() throw (SALOME::SALOME_Exception); @@ -562,7 +558,7 @@ public: /*! * Returns information about imported MED file */ - virtual SALOME_MED::MedFileInfo* GetMEDFileInfo(); + virtual SMESH::MedFileInfo* GetMEDFileInfo(); /*! * Sets list of notebook variables used for Mesh operations separated by ":" symbol @@ -648,8 +644,8 @@ private: std::map _mapSubMeshIor; std::map _mapGroups; std::map _mapHypo; - SALOME_MED::MedFileInfo_var _medFileInfo; - SMESH_PreMeshInfo* _preMeshInfo; // mesh info before full loading from study file + SMESH::MedFileInfo_var _medFileInfo; + SMESH_PreMeshInfo* _preMeshInfo; // mesh info before full loading from study file SMESH_PreMeshInfo* & changePreMeshInfo() { return _preMeshInfo; } friend class SMESH_PreMeshInfo; diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 3dab3db5b..21dfcc2e6 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -485,30 +485,6 @@ GEOM::GEOM_Object_ptr SMESH_subMesh_i::GetSubShape() return aShapeObj._retn(); } -//============================================================================= -/*! - * - */ -//============================================================================= -SALOME_MED::FAMILY_ptr SMESH_subMesh_i::GetFamily() - throw (SALOME::SALOME_Exception) -{ - Unexpect aCatch(SALOME_SalomeException); - if ( _preMeshInfo ) - _preMeshInfo->FullLoadFromFile(); - SALOME_MED::MESH_var MEDMesh = GetFather()->GetMEDMesh(); - - SALOME_MED::Family_array_var families = - MEDMesh->getFamilies(SALOME_MED::MED_NODE); - - for ( int i = 0; i < families->length(); i++ ) { - if ( families[i]->getIdentifier() == ( _localId ) ) - return families[i]; - } - - return SALOME_MED::FAMILY::_nil(); -} - //============================================================================= /*! * diff --git a/src/SMESH_I/SMESH_subMesh_i.hxx b/src/SMESH_I/SMESH_subMesh_i.hxx index 39d6d2677..adacb074c 100644 --- a/src/SMESH_I/SMESH_subMesh_i.hxx +++ b/src/SMESH_I/SMESH_subMesh_i.hxx @@ -34,7 +34,6 @@ #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_Hypothesis) #include CORBA_CLIENT_HEADER(GEOM_Gen) -#include CORBA_CLIENT_HEADER(MED) #include "SALOME_GenericObj_i.hh" #include "SMESH_Mesh_i.hxx" @@ -80,9 +79,6 @@ public: CORBA::Long GetId(); - SALOME_MED::FAMILY_ptr GetFamily() - throw (SALOME::SALOME_Exception); - // ========================= // interface SMESH_IDSource -- 2.39.2