blob: 43c8fd9ba0badef5b4ccd67357a1ca9f4cd9c0ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// File: XmlMXCAFDoc_VolumeDriver.cxx
// Created: Fri Aug 24 20:46:58 2001
// Author: Alexnder GRIGORIEV
// Copyright: Open Cascade 2001
// History:
#include <XmlMXCAFDoc_VolumeDriver.ixx>
#include <XCAFDoc_Volume.hxx>
#include <XmlObjMgt.hxx>
//=======================================================================
//function : XmlMXCAFDoc_VolumeDriver
//purpose : Constructor
//=======================================================================
XmlMXCAFDoc_VolumeDriver::XmlMXCAFDoc_VolumeDriver
(const Handle(CDM_MessageDriver)& theMsgDriver)
: XmlMDF_ADriver (theMsgDriver, "xcaf", "Volume")
{}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) XmlMXCAFDoc_VolumeDriver::NewEmpty() const
{
return (new XCAFDoc_Volume());
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean XmlMXCAFDoc_VolumeDriver::Paste
(const XmlObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
XmlObjMgt_RRelocationTable& ) const
{
Standard_Real aValue;
XmlObjMgt_DOMString aRealStr = XmlObjMgt::GetStringValue (theSource);
if (XmlObjMgt::GetReal(aRealStr, aValue) == Standard_False) {
TCollection_ExtendedString aMessageString =
TCollection_ExtendedString("Cannot retrieve Volume attribute from \"")
+ aRealStr + "\"";
WriteMessage (aMessageString);
return Standard_False;
}
Handle(XCAFDoc_Volume) anInt = Handle(XCAFDoc_Volume)::DownCast(theTarget);
anInt->Set(aValue);
return Standard_True;
}
//=======================================================================
//function : Paste
//purpose : transient -> persistent (store)
//=======================================================================
void XmlMXCAFDoc_VolumeDriver::Paste (const Handle(TDF_Attribute)& theSource,
XmlObjMgt_Persistent& theTarget,
XmlObjMgt_SRelocationTable& ) const
{
Handle(XCAFDoc_Volume) anInt = Handle(XCAFDoc_Volume)::DownCast(theSource);
TCollection_AsciiString aValueStr (anInt->Get());
XmlObjMgt::SetStringValue (theTarget, aValueStr.ToCString());
}
|