]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_SkyLineArray.cxx
Salome HOME
NRI : Merge from V1_2.
[modules/med.git] / src / MEDMEM / MEDMEM_SkyLineArray.cxx
1 //  MED MEDMEM : MED files in memory
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : MEDMEM_SkyLineArray.cxx
25 //  Module : MED
26
27 using namespace std;
28 #include "MEDMEM_SkyLineArray.hxx"
29 #include "utilities.h"
30
31 MEDSKYLINEARRAY::MEDSKYLINEARRAY(): _count(0), _length(0),
32                                 _index((med_int*)NULL),_value((med_int*)NULL)
33 {
34   MESSAGE("Constructeur MEDSKYLINEARRAY sans parametre");
35 }
36
37 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const MEDSKYLINEARRAY &myArray):
38                                 _count(myArray._count),_length(myArray._length),
39                                 _index(_count+1),_value(_length)
40 {
41         BEGIN_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
42         memcpy(_index,myArray._index,sizeof(med_int)*(_count+1));
43         memcpy(_value,myArray._value,sizeof(med_int)*_length);
44         END_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
45 }
46
47 MEDSKYLINEARRAY::~MEDSKYLINEARRAY()
48 {
49   MESSAGE("Destructeur ~MEDSKYLINEARRAY");
50
51   //if (_index != NULL) delete [] _index;
52   //if (_value != NULL) delete [] _value;
53 }
54
55 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const med_int count, const med_int length):
56                                 _count(count), _length(length),
57                                 _index(_count+1),_value(_length)
58 {
59         MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
60 }
61
62 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const med_int count, const med_int length,
63                                  const med_int* index, const med_int* value):
64                                 _count(count), _length(length),
65                                 _index(_count+1),_value(_length)
66 {
67         MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
68         memcpy((med_int*)_index,index,sizeof(med_int)*(_count+1));
69         memcpy((med_int*)_value,value,sizeof(med_int)*_length);
70 }
71
72 //  void MEDSKYLINEARRAY::setMEDSKYLINEARRAY( const med_int count , const med_int length, med_int* index , med_int* value )
73 //  {
74 //    MESSAGE("void MEDSKYLINEARRAY::setMEDSKYLINEARRAY(count, length, index, value)");
75 //    _count  = count  ;
76 //    _length = length ;
77
78 //    //if (_index != NULL) delete [] _index;
79 //    //if (_value != NULL) delete [] _value;
80
81 //        _index.set(index);
82 //        _value.set(value);
83 //  }