0026912: CLang 3.6.2 compiler warning [-Winconsistent-missing-override]
[occt.git] / src / BinTObjDrivers / BinTObjDrivers_XYZDriver.cxx
1 // Created on: 2004-11-24
2 // Created by: Michael SAZONOV
3 // Copyright (c) 2004-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // The original implementation Copyright: (C) RINA S.p.A
17
18
19 #include <BinTObjDrivers_XYZDriver.hxx>
20 #include <CDM_MessageDriver.hxx>
21 #include <TDF_Attribute.hxx>
22 #include <BinObjMgt_Persistent.hxx>
23 #include <TObj_TXYZ.hxx>
24
25
26 //=======================================================================
27 //function : BinTObjDrivers_XYZDriver
28 //purpose  : constructor
29 //=======================================================================
30
31 BinTObjDrivers_XYZDriver::BinTObjDrivers_XYZDriver
32                          (const Handle(CDM_MessageDriver)& theMessageDriver)
33 : BinMDF_ADriver( theMessageDriver, NULL)
34 {
35 }
36
37 //=======================================================================
38 //function : NewEmpty
39 //purpose  : Creates a new attribute
40 //=======================================================================
41
42 Handle(TDF_Attribute) BinTObjDrivers_XYZDriver::NewEmpty() const
43 {
44   return new TObj_TXYZ;
45 }
46
47 //=======================================================================
48 //function : Paste
49 //purpose  : Retrieve. Translate the contents of <theSource> and put it
50 //           into <theTarget>.
51 //=======================================================================
52
53 Standard_Boolean BinTObjDrivers_XYZDriver::Paste
54                          (const BinObjMgt_Persistent&  theSource,
55                           const Handle(TDF_Attribute)& theTarget,
56                           BinObjMgt_RRelocationTable&) const
57 {
58   Handle(TObj_TXYZ) aTarget = Handle(TObj_TXYZ)::DownCast(theTarget);
59   Standard_Real aX, aY, aZ;
60   if (! (theSource >> aX >> aY >> aZ))
61     return Standard_False;
62   aTarget->Set (gp_XYZ (aX, aY, aZ));
63   return Standard_True;
64 }
65
66 //=======================================================================
67 //function : Paste
68 //purpose  : Store. Translate the contents of <theSource> and put it
69 //           into <theTarget>
70 //=======================================================================
71
72 void BinTObjDrivers_XYZDriver::Paste
73                          (const Handle(TDF_Attribute)& theSource,
74                           BinObjMgt_Persistent&        theTarget,
75                           BinObjMgt_SRelocationTable&) const
76 {
77   Handle(TObj_TXYZ) aSource = Handle(TObj_TXYZ)::DownCast (theSource);
78   gp_XYZ aXYZ = aSource->Get();
79   theTarget << aXYZ.X() << aXYZ.Y() << aXYZ.Z();
80 }