b311480e |
1 | // Created on: 2008-03-27 |
2 | // Created by: Sergey ZARITCHNY |
973c2be1 |
3 | // Copyright (c) 2008-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | #include <MDataStd_IntegerArrayRetrievalDriver_1.ixx> |
17 | #include <PDataStd_IntegerArray.hxx> |
18 | #include <PDataStd_IntegerArray_1.hxx> |
19 | #include <TDataStd_IntegerArray.hxx> |
20 | #include <MDataStd.hxx> |
21 | #include <CDM_MessageDriver.hxx> |
22 | |
23 | //======================================================================= |
24 | //function : MDataStd_IntegerArrayRetrievalDriver_1 |
25 | //purpose : |
26 | //======================================================================= |
27 | |
28 | MDataStd_IntegerArrayRetrievalDriver_1::MDataStd_IntegerArrayRetrievalDriver_1(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver) |
29 | {} |
30 | |
31 | |
32 | //======================================================================= |
33 | //function : VersionNumber |
34 | //purpose : |
35 | //======================================================================= |
36 | |
37 | Standard_Integer MDataStd_IntegerArrayRetrievalDriver_1::VersionNumber() const |
38 | { return 1; } |
39 | |
40 | |
41 | //======================================================================= |
42 | //function : SourceType |
43 | //purpose : |
44 | //======================================================================= |
45 | |
46 | Handle(Standard_Type) MDataStd_IntegerArrayRetrievalDriver_1::SourceType() const |
47 | { |
48 | static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_IntegerArray_1); |
49 | return sourceType; |
50 | } |
51 | |
52 | |
53 | //======================================================================= |
54 | //function : NewEmpty |
55 | //purpose : |
56 | //======================================================================= |
57 | |
58 | Handle(TDF_Attribute) MDataStd_IntegerArrayRetrievalDriver_1::NewEmpty () const { |
59 | |
60 | return new TDataStd_IntegerArray (); |
61 | } |
62 | |
63 | |
64 | //======================================================================= |
65 | //function : Paste |
66 | //purpose : |
67 | //======================================================================= |
68 | |
69 | void MDataStd_IntegerArrayRetrievalDriver_1::Paste(const Handle(PDF_Attribute)& Source, |
70 | const Handle(TDF_Attribute)& Target, |
71 | const Handle(MDF_RRelocationTable)& ) const |
72 | { |
73 | Handle(PDataStd_IntegerArray_1) S = Handle(PDataStd_IntegerArray_1)::DownCast (Source); |
74 | Handle(TDataStd_IntegerArray) T = Handle(TDataStd_IntegerArray)::DownCast (Target); |
75 | |
76 | Standard_Integer i, lower = S->Lower() , upper = S->Upper(); |
77 | T->Init(lower, upper); |
78 | |
79 | for(i = lower; i<=upper; i++) T->SetValue( i, S->Value(i) ); |
80 | T->SetDelta(S->GetDelta()); |
81 | } |
82 | |