1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SALOMEDS_AttributeSequenceOfReal_i.cxx
21 // Author : Sergey RUIN
25 #include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
26 #include "SALOMEDS.hxx"
27 #include <TColStd_HSequenceOfReal.hxx>
31 void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other)
33 SALOMEDS::Locker lock;
35 Handle(TColStd_HSequenceOfReal) CasCadeSeq = new TColStd_HSequenceOfReal;
36 for (int i = 0; i < other.length(); i++) {
37 CasCadeSeq->Append(other[i]);
39 Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Assign(CasCadeSeq);
42 SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence()
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);;
51 return CorbaSeq._retn();
54 void SALOMEDS_AttributeSequenceOfReal_i::Add(CORBA::Double value)
56 SALOMEDS::Locker lock;
58 Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Add(value);
61 void SALOMEDS_AttributeSequenceOfReal_i::Remove(CORBA::Long index)
63 SALOMEDS::Locker lock;
65 Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Remove(index);
68 void SALOMEDS_AttributeSequenceOfReal_i::ChangeValue(CORBA::Long index, CORBA::Double value)
70 SALOMEDS::Locker lock;
72 Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->ChangeValue(index, value);
75 CORBA::Double SALOMEDS_AttributeSequenceOfReal_i::Value(CORBA::Short index)
77 SALOMEDS::Locker lock;
78 return Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Value(index);
81 CORBA::Long SALOMEDS_AttributeSequenceOfReal_i::Length()
83 SALOMEDS::Locker lock;
84 return Handle(SALOMEDSImpl_AttributeSequenceOfReal)::DownCast(_impl)->Length();