| 1 | // Created on: 2000-08-30 |
| 2 | // Created by: data exchange team |
| 3 | // Copyright (c) 2000-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 | #ifndef _XCAFDoc_DocumentTool_HeaderFile |
| 17 | #define _XCAFDoc_DocumentTool_HeaderFile |
| 18 | |
| 19 | #include <Standard.hxx> |
| 20 | #include <Standard_Type.hxx> |
| 21 | |
| 22 | #include <TDF_Attribute.hxx> |
| 23 | #include <Standard_Boolean.hxx> |
| 24 | class Standard_GUID; |
| 25 | class TDF_Label; |
| 26 | class TDocStd_Document; |
| 27 | class XCAFDoc_ShapeTool; |
| 28 | class XCAFDoc_ColorTool; |
| 29 | class XCAFDoc_ClippingPlaneTool; |
| 30 | class XCAFDoc_LayerTool; |
| 31 | class XCAFDoc_DimTolTool; |
| 32 | class XCAFDoc_MaterialTool; |
| 33 | class XCAFDoc_ViewTool; |
| 34 | class TDF_Attribute; |
| 35 | class TDF_RelocationTable; |
| 36 | |
| 37 | |
| 38 | class XCAFDoc_DocumentTool; |
| 39 | DEFINE_STANDARD_HANDLE(XCAFDoc_DocumentTool, TDF_Attribute) |
| 40 | |
| 41 | //! Defines sections structure of an XDE document. |
| 42 | //! attribute marking CAF document as being DECAF document. |
| 43 | //! Creates the sections structure of the document. |
| 44 | class XCAFDoc_DocumentTool : public TDF_Attribute |
| 45 | { |
| 46 | |
| 47 | public: |
| 48 | |
| 49 | |
| 50 | Standard_EXPORT static const Standard_GUID& GetID(); |
| 51 | |
| 52 | //! Create (if not exist) DocumentTool attribute |
| 53 | //! on 0.1 label if <IsAcces> is true, else |
| 54 | //! on <L> label. |
| 55 | //! This label will be returned by DocLabel(); |
| 56 | //! If the attribute is already set it won't be reset on |
| 57 | //! <L> even if <IsAcces> is false. |
| 58 | //! ColorTool and ShapeTool attributes are also set by this method. |
| 59 | Standard_EXPORT static Handle(XCAFDoc_DocumentTool) Set (const TDF_Label& L, const Standard_Boolean IsAcces = Standard_True); |
| 60 | |
| 61 | Standard_EXPORT static Standard_Boolean IsXCAFDocument (const Handle(TDocStd_Document)& Doc); |
| 62 | |
| 63 | //! Returns label where the DocumentTool attribute is or |
| 64 | //! 0.1 if DocumentTool is not yet set. |
| 65 | Standard_EXPORT static TDF_Label DocLabel (const TDF_Label& acces); |
| 66 | |
| 67 | //! Returns sub-label of DocLabel() with tag 1. |
| 68 | Standard_EXPORT static TDF_Label ShapesLabel (const TDF_Label& acces); |
| 69 | |
| 70 | //! Returns sub-label of DocLabel() with tag 2. |
| 71 | Standard_EXPORT static TDF_Label ColorsLabel (const TDF_Label& acces); |
| 72 | |
| 73 | //! Returns sub-label of DocLabel() with tag 3. |
| 74 | Standard_EXPORT static TDF_Label LayersLabel (const TDF_Label& acces); |
| 75 | |
| 76 | //! Returns sub-label of DocLabel() with tag 4. |
| 77 | Standard_EXPORT static TDF_Label DGTsLabel (const TDF_Label& acces); |
| 78 | |
| 79 | //! Returns sub-label of DocLabel() with tag 5. |
| 80 | Standard_EXPORT static TDF_Label MaterialsLabel (const TDF_Label& acces); |
| 81 | |
| 82 | //! Returns sub-label of DocLabel() with tag 7. |
| 83 | Standard_EXPORT static TDF_Label ViewsLabel(const TDF_Label& acces); |
| 84 | |
| 85 | //! Returns sub-label of DocLabel() with tag 8. |
| 86 | Standard_EXPORT static TDF_Label ClippingPlanesLabel(const TDF_Label& acces); |
| 87 | |
| 88 | //! Creates (if it does not exist) ShapeTool attribute on ShapesLabel(). |
| 89 | Standard_EXPORT static Handle(XCAFDoc_ShapeTool) ShapeTool (const TDF_Label& acces); |
| 90 | |
| 91 | //! Creates (if it does not exist) ColorTool attribute on ColorsLabel(). |
| 92 | Standard_EXPORT static Handle(XCAFDoc_ColorTool) ColorTool (const TDF_Label& acces); |
| 93 | |
| 94 | //! Creates (if it does not exist) LayerTool attribute on LayersLabel(). |
| 95 | Standard_EXPORT static Handle(XCAFDoc_LayerTool) LayerTool (const TDF_Label& acces); |
| 96 | |
| 97 | //! Creates (if it does not exist) DimTolTool attribute on DGTsLabel(). |
| 98 | Standard_EXPORT static Handle(XCAFDoc_DimTolTool) DimTolTool (const TDF_Label& acces); |
| 99 | |
| 100 | //! Creates (if it does not exist) DimTolTool attribute on DGTsLabel(). |
| 101 | Standard_EXPORT static Handle(XCAFDoc_MaterialTool) MaterialTool (const TDF_Label& acces); |
| 102 | |
| 103 | //! Creates (if it does not exist) ViewTool attribute on ViewsLabel(). |
| 104 | Standard_EXPORT static Handle(XCAFDoc_ViewTool) ViewTool(const TDF_Label& acces); |
| 105 | |
| 106 | //! Creates (if it does not exist) ClippingPlaneTool attribute on ClippingPlanesLabel(). |
| 107 | Standard_EXPORT static Handle(XCAFDoc_ClippingPlaneTool) ClippingPlaneTool(const TDF_Label& acces); |
| 108 | |
| 109 | Standard_EXPORT XCAFDoc_DocumentTool(); |
| 110 | |
| 111 | //! to be called when reading this attribute from file |
| 112 | Standard_EXPORT void Init() const; |
| 113 | |
| 114 | Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; |
| 115 | |
| 116 | Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE; |
| 117 | |
| 118 | Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; |
| 119 | |
| 120 | Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE; |
| 121 | |
| 122 | DEFINE_STANDARD_RTTIEXT(XCAFDoc_DocumentTool,TDF_Attribute) |
| 123 | |
| 124 | protected: |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | private: |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | }; |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | #endif // _XCAFDoc_DocumentTool_HeaderFile |