Salome HOME
NRI : Remove dependence with VISU.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeSequenceOfInteger_i.cxx
1 using namespace std;
2 //  File      : SALOMEDS_AttributeSequenceOfInteger_i.cxx
3 //  Created   : Fri Jul 05 18:09:47 2002
4 //  Author    : Yves FRICAUD
5
6 //  Project   : SALOME
7 //  Module    : SALOMEDS
8 //  Copyright : Open CASCADE 2002
9 //  $Header$
10
11
12 #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
13 #include "SALOMEDS_SObject_i.hxx"
14 #include <TColStd_HSequenceOfInteger.hxx>
15
16
17 void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other) 
18 {
19   CheckLocked();
20   Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger;
21   for (int i = 0; i < other.length(); i++) {
22     CasCadeSeq->Append(other[i]);
23   }
24   Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Assign(CasCadeSeq);
25 }
26  
27 SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence()
28 {
29   SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
30   Handle(SALOMEDS_SequenceOfIntegerAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr);
31   CorbaSeq->length(CasCadeSeq->Length());
32   for (int i = 0; i < CasCadeSeq->Length(); i++) {
33     CorbaSeq[i] = CasCadeSeq->Value(i+1);;
34   }
35   return CorbaSeq._retn();
36 }
37  
38 void SALOMEDS_AttributeSequenceOfInteger_i::Add(CORBA::Long value) 
39 {
40   CheckLocked();
41   Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Add(value);
42 }
43
44 void SALOMEDS_AttributeSequenceOfInteger_i::Remove(CORBA::Long index) 
45 {
46   CheckLocked();
47   Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Remove(index);
48 }
49  
50 void SALOMEDS_AttributeSequenceOfInteger_i::ChangeValue(CORBA::Long index, CORBA::Long value)
51 {
52   CheckLocked();
53   Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->ChangeValue(index, value);
54 }
55  
56 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Value(CORBA::Short index) 
57 {
58   return Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Value(index);
59 }
60
61 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Length() 
62 {
63   return Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Length();
64 }