Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/yacs.git] / src / SALOMEDS / SALOMEDS_AttributeSequenceOfReal_i.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  File   : SALOMEDS_AttributeSequenceOfReal_i.cxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24
25 #include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
26 #include "SALOMEDS.hxx" 
27 #include <TColStd_HSequenceOfReal.hxx>
28
29 using namespace std;
30
31 void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other) 
32 {
33   SALOMEDS::Locker lock; 
34   CheckLocked();
35   Handle(TColStd_HSequenceOfReal) CasCadeSeq = new TColStd_HSequenceOfReal;
36   for (int i = 0; i < other.length(); i++) {
37     CasCadeSeq->Append(other[i]);
38   }
39   Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Assign(CasCadeSeq);
40 }
41  
42 SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence()
43 {
44   SALOMEDS::Locker lock; 
45   SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
46   Handle(SALOMEDSImpl_AttributeSequenceOfReal) CasCadeSeq = Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl);
47   CorbaSeq->length(CasCadeSeq->Length());
48   for (int i = 0; i < CasCadeSeq->Length(); i++) {
49     CorbaSeq[i] = CasCadeSeq->Value(i+1);;
50   }
51   return CorbaSeq._retn();
52 }
53  
54 void SALOMEDS_AttributeSequenceOfReal_i::Add(CORBA::Double value) 
55 {
56   SALOMEDS::Locker lock; 
57   CheckLocked();
58   Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Add(value);
59 }
60
61 void SALOMEDS_AttributeSequenceOfReal_i::Remove(CORBA::Long index) 
62 {
63   SALOMEDS::Locker lock; 
64   CheckLocked();
65   Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Remove(index);
66 }
67  
68 void SALOMEDS_AttributeSequenceOfReal_i::ChangeValue(CORBA::Long index, CORBA::Double value)
69 {
70   SALOMEDS::Locker lock; 
71   CheckLocked();
72   Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->ChangeValue(index, value);
73 }
74  
75 CORBA::Double SALOMEDS_AttributeSequenceOfReal_i::Value(CORBA::Short index) 
76 {
77   SALOMEDS::Locker lock; 
78   return Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Value(index);
79 }
80
81 CORBA::Long SALOMEDS_AttributeSequenceOfReal_i::Length() 
82 {
83   SALOMEDS::Locker lock; 
84   return Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Length();
85 }
86