973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
7fd59977 |
13 | |
7fd59977 |
14 | |
42cf5bc1 |
15 | #include <DDocStd_DrawDocument.hxx> |
16 | #include <Draw_Display.hxx> |
17 | #include <Draw_Drawable3D.hxx> |
18 | #include <Standard_Type.hxx> |
7fd59977 |
19 | #include <TCollection_AsciiString.hxx> |
42cf5bc1 |
20 | #include <TDF_Data.hxx> |
21 | #include <TDF_Tool.hxx> |
22 | #include <TDocStd_Document.hxx> |
7fd59977 |
23 | |
92efcf78 |
24 | IMPLEMENT_STANDARD_RTTIEXT(DDocStd_DrawDocument,DDF_Data) |
25 | |
7fd59977 |
26 | //======================================================================= |
27 | //function : Find |
28 | //purpose : |
29 | //======================================================================= |
35e08fe8 |
30 | Handle(DDocStd_DrawDocument) DDocStd_DrawDocument::Find (const Handle(TDocStd_Document)& /*Doc*/) |
7fd59977 |
31 | { |
32 | Handle(DDocStd_DrawDocument) adoc; |
33 | return adoc; |
34 | } |
35 | |
36 | |
37 | //======================================================================= |
38 | //function : DDocStd_DrawDocument |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | DDocStd_DrawDocument::DDocStd_DrawDocument (const Handle(TDocStd_Document)& Doc) |
43 | : DDF_Data(new TDF_Data), // Doc->GetData()) |
44 | myDocument(Doc) |
45 | { |
46 | DataFramework(Doc->GetData()); |
47 | } |
48 | |
49 | //======================================================================= |
50 | //function : GetDocument |
51 | //purpose : |
52 | //======================================================================= |
53 | |
54 | Handle(TDocStd_Document) DDocStd_DrawDocument::GetDocument() const |
55 | { |
56 | return myDocument; |
57 | } |
58 | |
59 | //======================================================================= |
60 | //function : DrawOn |
61 | //purpose : |
62 | //======================================================================= |
63 | |
35e08fe8 |
64 | void DDocStd_DrawDocument::DrawOn(Draw_Display& /*dis*/) const |
7fd59977 |
65 | { |
66 | } |
67 | |
68 | //======================================================================= |
69 | //function : Copy |
70 | //purpose : |
71 | //======================================================================= |
72 | |
73 | Handle(Draw_Drawable3D) DDocStd_DrawDocument::Copy() const |
74 | { |
75 | Handle(DDocStd_DrawDocument) D = new DDocStd_DrawDocument (myDocument); |
76 | return D; |
77 | } |
78 | |
79 | //======================================================================= |
80 | //function : Dump |
81 | //purpose : |
82 | //======================================================================= |
83 | |
84 | void DDocStd_DrawDocument::Dump (Standard_OStream& S) const |
85 | { |
a9dde4a3 |
86 | Handle(TDocStd_Document) STDDOC = myDocument; |
7fd59977 |
87 | if (!STDDOC.IsNull()) { |
88 | S << "TDocStd_Document\n"; |
89 | DDF_Data::Dump(S); |
90 | } |
91 | else { |
92 | S << myDocument->DynamicType()->Name() << " is not a CAF document" << endl; |
93 | } |
94 | } |
95 | |
96 | //======================================================================= |
97 | //function : Whatis |
98 | //purpose : |
99 | //======================================================================= |
100 | |
101 | void DDocStd_DrawDocument::Whatis(Draw_Interpretor& I) const |
102 | { |
103 | I << myDocument->DynamicType()->Name(); |
104 | } |
105 | |
106 | |