Salome HOME
17ffd0aee89d45f4e3738e55b0a6a9abe3ea6e79
[modules/med.git] / src / MedClient / src / FAMILYClient.cxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "FAMILYClient.hxx"
24 #include "MESHClient.hxx"
25 #include "UtilClient.hxx"
26 using namespace MEDMEM;
27 //=============================================================================
28 /*!
29  * Constructeur
30  */
31 //=============================================================================
32 FAMILYClient::FAMILYClient(const SALOME_MED::FAMILY_ptr S,
33                            GMESH * M) 
34   : SUPPORTClient(S, M), 
35     FAMILY(), 
36     IOR_Family(SALOME_MED::FAMILY::_duplicate(S))
37 {
38   SCRUTE(S);
39   SCRUTE(M);
40
41   blankCopy(false);
42 }
43 //=============================================================================
44 /*!
45  * Remplit les informations générales
46  */
47 //=============================================================================
48 void FAMILYClient::blankCopy(bool blankSupport)
49 {
50   if (blankSupport)
51     SUPPORTClient::blankCopy();
52
53   setIdentifier(IOR_Family->getIdentifier());
54
55   int nAttr, nGr, n;
56   int *i;
57   std::string *s;
58
59   nAttr = IOR_Family->getNumberOfAttributes();
60   setNumberOfAttributes(nAttr);
61
62   SALOME_TYPES::ListOfLong* attrId= IOR_Family->getAttributesIdentifiers();
63   convertCorbaArray(i, n, attrId);
64   delete attrId;
65   ASSERT(n == nAttr);
66   setAttributesIdentifiers(i);
67
68   attrId=IOR_Family->getAttributesValues();
69   i=0;
70   convertCorbaArray(i, n, attrId);
71   delete attrId;
72   ASSERT(n == _numberOfAttribute);
73   setAttributesValues(i);
74
75   SALOME_TYPES::ListOfString * attrDesc=IOR_Family->getAttributesDescriptions();
76   convertCorbaArray(s, n, attrDesc);
77   delete attrDesc;
78   ASSERT(n == _numberOfAttribute);
79   setAttributesDescriptions(s);
80
81   nGr = IOR_Family->getNumberOfGroups();
82   setNumberOfGroups(nGr);
83
84   attrDesc=IOR_Family->getGroupsNames();
85   s=0;
86   convertCorbaArray(s, n, attrDesc);
87   delete attrDesc;
88   ASSERT(n == _numberOfGroup);
89   setGroupsNames(s,true);
90
91   _complete = false;
92 }
93
94 //=============================================================================
95 /*!
96  * Remplit les informations générales
97  */
98 //=============================================================================
99 void FAMILYClient::fillCopy(bool fillSupport)
100 {
101   if (!_complete) {
102
103     if (fillSupport)
104       SUPPORTClient::fillCopy();
105
106     // Get other FAMILY attributes
107
108     _complete = true;
109   }
110 }
111
112 //=============================================================================
113 /*!
114  * Destructeur
115  */
116 //=============================================================================
117
118 FAMILYClient::~FAMILYClient()
119 {
120 }