Salome HOME
ENV: Windows porting.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeSequenceOfReal_i.cxx
1 //  File   : SALOMEDS_AttributeSequenceOfReal_i.cxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5
6 #include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
7 #include "SALOMEDS.hxx" 
8 #include <TColStd_HSequenceOfReal.hxx>
9
10 using namespace std;
11
12 void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other) 
13 {
14   SALOMEDS::Locker lock; 
15   CheckLocked();
16   Handle(TColStd_HSequenceOfReal) CasCadeSeq = new TColStd_HSequenceOfReal;
17   for (int i = 0; i < other.length(); i++) {
18     CasCadeSeq->Append(other[i]);
19   }
20   Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Assign(CasCadeSeq);
21 }
22  
23 SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence()
24 {
25   SALOMEDS::Locker lock; 
26   SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
27   Handle(SALOMEDSImpl_AttributeSequenceOfReal) CasCadeSeq = Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl);
28   CorbaSeq->length(CasCadeSeq->Length());
29   for (int i = 0; i < CasCadeSeq->Length(); i++) {
30     CorbaSeq[i] = CasCadeSeq->Value(i+1);;
31   }
32   return CorbaSeq._retn();
33 }
34  
35 void SALOMEDS_AttributeSequenceOfReal_i::Add(CORBA::Double value) 
36 {
37   SALOMEDS::Locker lock; 
38   CheckLocked();
39   Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Add(value);
40 }
41
42 void SALOMEDS_AttributeSequenceOfReal_i::Remove(CORBA::Long index) 
43 {
44   SALOMEDS::Locker lock; 
45   CheckLocked();
46   Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Remove(index);
47 }
48  
49 void SALOMEDS_AttributeSequenceOfReal_i::ChangeValue(CORBA::Long index, CORBA::Double value)
50 {
51   SALOMEDS::Locker lock; 
52   CheckLocked();
53   Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->ChangeValue(index, value);
54 }
55  
56 CORBA::Double SALOMEDS_AttributeSequenceOfReal_i::Value(CORBA::Short index) 
57 {
58   SALOMEDS::Locker lock; 
59   return Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Value(index);
60 }
61
62 CORBA::Long SALOMEDS_AttributeSequenceOfReal_i::Length() 
63 {
64   SALOMEDS::Locker lock; 
65   return Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Length();
66 }
67