1 // Created on: 2001-08-24
2 // Created by: Alexnder GRIGORIEV
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // modified 13.04.2009 Sergey Zaritchny
18 #include <BinMDataXtd_GeometryDriver.hxx>
19 #include <BinObjMgt_Persistent.hxx>
20 #include <Message_Messenger.hxx>
21 #include <Standard_Type.hxx>
22 #include <TDataXtd_Geometry.hxx>
23 #include <TDF_Attribute.hxx>
25 IMPLEMENT_STANDARD_RTTIEXT(BinMDataXtd_GeometryDriver,BinMDF_ADriver)
27 //=======================================================================
28 //function : BinMDataXtd_GeometryDriver
29 //purpose : Constructor
30 //=======================================================================
31 BinMDataXtd_GeometryDriver::BinMDataXtd_GeometryDriver
32 (const Handle(Message_Messenger)& theMsgDriver)
33 : BinMDF_ADriver (theMsgDriver, NULL)
36 //=======================================================================
39 //=======================================================================
40 Handle(TDF_Attribute) BinMDataXtd_GeometryDriver::NewEmpty() const
42 return (new TDataXtd_Geometry());
45 //=======================================================================
48 //=======================================================================
49 Standard_Boolean BinMDataXtd_GeometryDriver::Paste
50 (const BinObjMgt_Persistent& theSource,
51 const Handle(TDF_Attribute)& theTarget,
52 BinObjMgt_RRelocationTable& ) const
54 Handle(TDataXtd_Geometry) aT =
55 Handle(TDataXtd_Geometry)::DownCast (theTarget);
57 Standard_Integer aType;
58 Standard_Boolean ok = theSource >> aType;
60 aT->SetType ((TDataXtd_GeometryEnum) aType);
65 //=======================================================================
68 //=======================================================================
69 void BinMDataXtd_GeometryDriver::Paste (const Handle(TDF_Attribute)& theSource,
70 BinObjMgt_Persistent& theTarget,
71 BinObjMgt_SRelocationTable& ) const
73 Handle(TDataXtd_Geometry) aG = Handle(TDataXtd_Geometry)::DownCast(theSource);
74 theTarget << (Standard_Integer) aG->GetType();