1 // File: MXCAFDoc_GraphNodeStorageDriver.cxx
2 // Created: Fri Sep 29 10:46:06 2000
3 // Author: data exchange team
4 // <det@nordox.nnov.matra-dtv.fr>
7 #include <MXCAFDoc_GraphNodeStorageDriver.ixx>
9 #include <XCAFDoc_GraphNode.hxx>
10 #include <PXCAFDoc_GraphNode.hxx>
11 #include <Standard_NoSuchObject.hxx>
14 //=======================================================================
15 //function : Constructor
17 //=======================================================================
19 MXCAFDoc_GraphNodeStorageDriver::MXCAFDoc_GraphNodeStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver) : MDF_ASDriver (theMsgDriver)
23 //=======================================================================
24 //function : VersionNumber
26 //=======================================================================
28 Standard_Integer MXCAFDoc_GraphNodeStorageDriver::VersionNumber() const
32 //=======================================================================
33 //function : SourceType
35 //=======================================================================
37 Handle(Standard_Type) MXCAFDoc_GraphNodeStorageDriver::SourceType() const
38 { return STANDARD_TYPE(XCAFDoc_GraphNode); }
41 //=======================================================================
44 //=======================================================================
46 Handle(PDF_Attribute) MXCAFDoc_GraphNodeStorageDriver::NewEmpty() const
47 { return new PXCAFDoc_GraphNode(); }
50 //=======================================================================
53 //=======================================================================
55 void MXCAFDoc_GraphNodeStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
56 const Handle(PDF_Attribute)& Target,
57 const Handle(MDF_SRelocationTable)& RelocTable) const
59 Handle(XCAFDoc_GraphNode) S = Handle(XCAFDoc_GraphNode)::DownCast (Source);
60 Handle(PXCAFDoc_GraphNode) T = Handle(PXCAFDoc_GraphNode)::DownCast (Target);
62 Handle (PXCAFDoc_GraphNode) TF;
63 Handle (XCAFDoc_GraphNode) F;
66 for ( i = 1; i <= S->NbFathers(); i++) {
69 if (!RelocTable->HasRelocation(F, TF)) {
70 Standard_NoSuchObject::Raise("MXCAFDoc_GraphNodeStorageDriver::Paste");
76 for ( i = 1; i <= S->NbChildren(); i++) {
79 if (!RelocTable->HasRelocation(F, TF)) {
80 Standard_NoSuchObject::Raise("MXCAFDoc_GraphNodeStorageDriver::Paste");
86 T->SetGraphID(S->ID());