1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 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 #include <inspector/DFBrowserPaneXDE_Tools.hxx>
18 #include <inspector/DFBrowserPane_AttributePaneAPI.hxx>
20 #include <TCollection_AsciiString.hxx>
21 #include <TDataStd_Name.hxx>
22 #include <TDF_ChildIterator.hxx>
23 #include <TDF_Tool.hxx>
24 #include <TDocStd_Document.hxx>
26 #include <Standard_GUID.hxx>
28 #include <XCAFDoc_Area.hxx>
29 #include <XCAFDoc_Centroid.hxx>
30 #include <XCAFDoc_Color.hxx>
31 #include <XCAFDoc_Datum.hxx>
32 #include <XCAFDoc_DocumentTool.hxx>
33 #include <XCAFDoc_GraphNode.hxx>
34 #include <XCAFDoc_Location.hxx>
35 #include <XCAFDoc_Material.hxx>
36 #include <XCAFDoc_Volume.hxx>
38 namespace DFBrowserPaneXDE_Tools
41 // =======================================================================
42 // function : IsXDEApplication
44 // =======================================================================
45 bool IsXDEApplication (const Handle(TDocStd_Application)& theApplication)
47 bool isXDEApp = false;
49 Handle(TDocStd_Document) aDocument;
50 Standard_Integer aNbDoc = theApplication->NbDocuments();
54 theApplication->GetDocument (1, aDocument);
55 if (aDocument.IsNull())
58 for (TDF_ChildIterator aLabelsIt (aDocument->Main().Root()); aLabelsIt.More() && !isXDEApp; aLabelsIt.Next())
60 const TDF_Label aLabel = aLabelsIt.Value();
63 Handle(TDF_Attribute) anAttribute;
64 aLabel.FindAttribute (XCAFDoc_DocumentTool::GetID(), anAttribute);
65 isXDEApp = !anAttribute.IsNull();