Back to index

salome-med  6.5.0
FAMILYClient.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #include "FAMILYClient.hxx"
00024 #include "MESHClient.hxx"
00025 #include "UtilClient.hxx"
00026 using namespace MEDMEM;
00027 //=============================================================================
00031 //=============================================================================
00032 FAMILYClient::FAMILYClient(const SALOME_MED::FAMILY_ptr S,
00033                            GMESH * M) 
00034   : SUPPORTClient(S, M), 
00035     FAMILY(), 
00036     IOR_Family(SALOME_MED::FAMILY::_duplicate(S))
00037 {
00038   SCRUTE(S);
00039   SCRUTE(M);
00040 
00041   blankCopy(false);
00042 }
00043 //=============================================================================
00047 //=============================================================================
00048 void FAMILYClient::blankCopy(bool blankSupport)
00049 {
00050   if (blankSupport)
00051     SUPPORTClient::blankCopy();
00052 
00053   setIdentifier(IOR_Family->getIdentifier());
00054 
00055   int nAttr, nGr, n;
00056   int *i;
00057   std::string *s;
00058 
00059   nAttr = IOR_Family->getNumberOfAttributes();
00060   setNumberOfAttributes(nAttr);
00061 
00062   SALOME_TYPES::ListOfLong* attrId= IOR_Family->getAttributesIdentifiers();
00063   convertCorbaArray(i, n, attrId);
00064   delete attrId;
00065   ASSERT(n == nAttr);
00066   setAttributesIdentifiers(i);
00067 
00068   attrId=IOR_Family->getAttributesValues();
00069   i=0;
00070   convertCorbaArray(i, n, attrId);
00071   delete attrId;
00072   ASSERT(n == _numberOfAttribute);
00073   setAttributesValues(i);
00074 
00075   SALOME_TYPES::ListOfString * attrDesc=IOR_Family->getAttributesDescriptions();
00076   convertCorbaArray(s, n, attrDesc);
00077   delete attrDesc;
00078   ASSERT(n == _numberOfAttribute);
00079   setAttributesDescriptions(s);
00080 
00081   nGr = IOR_Family->getNumberOfGroups();
00082   setNumberOfGroups(nGr);
00083 
00084   attrDesc=IOR_Family->getGroupsNames();
00085   s=0;
00086   convertCorbaArray(s, n, attrDesc);
00087   delete attrDesc;
00088   ASSERT(n == _numberOfGroup);
00089   setGroupsNames(s,true);
00090 
00091   _complete = false;
00092 }
00093 
00094 //=============================================================================
00098 //=============================================================================
00099 void FAMILYClient::fillCopy(bool fillSupport)
00100 {
00101   if (!_complete) {
00102 
00103     if (fillSupport)
00104       SUPPORTClient::fillCopy();
00105 
00106     // Get other FAMILY attributes
00107 
00108     _complete = true;
00109   }
00110 }
00111 
00112 //=============================================================================
00116 //=============================================================================
00117 
00118 FAMILYClient::~FAMILYClient()
00119 {
00120 }