Salome HOME
Removed includes and libraries of OCC
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeTreeNode.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  File   : SALOMEDSImpl_AttributeTreeNode.hxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24 #ifndef _SALOMEDSImpl_AttributeTreeNode_HeaderFile
25 #define _SALOMEDSImpl_AttributeTreeNode_HeaderFile
26
27 #include "DF_Attribute.hxx"
28 #include "DF_Label.hxx"
29 #include <string>
30 #include "SALOMEDSImpl_GenericAttribute.hxx"
31
32 class SALOMEDSImpl_AttributeTreeNode : public SALOMEDSImpl_GenericAttribute 
33 {
34 public:
35
36 Standard_EXPORT const static std::string& GetDefaultTreeID();
37 Standard_EXPORT static SALOMEDSImpl_AttributeTreeNode* Set(const DF_Label& L, const std::string& ID);
38
39 Standard_EXPORT SALOMEDSImpl_AttributeTreeNode();
40 Standard_EXPORT void SetFather(const SALOMEDSImpl_AttributeTreeNode* value);
41 Standard_EXPORT void SetPrevious(const SALOMEDSImpl_AttributeTreeNode* value);
42 Standard_EXPORT void SetNext(const SALOMEDSImpl_AttributeTreeNode* value);
43 Standard_EXPORT void SetFirst(const SALOMEDSImpl_AttributeTreeNode* value);
44 Standard_EXPORT void SetTreeID(const std::string& value);
45
46 Standard_EXPORT bool Append(SALOMEDSImpl_AttributeTreeNode* value);  
47 Standard_EXPORT bool Prepend(SALOMEDSImpl_AttributeTreeNode* value);
48 Standard_EXPORT bool Remove();
49 Standard_EXPORT bool InsertBefore(SALOMEDSImpl_AttributeTreeNode* value);
50 Standard_EXPORT bool InsertAfter(SALOMEDSImpl_AttributeTreeNode* value);
51
52 Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetFather() const { return myFather; }
53 Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetPrevious() const { return myPrevious; }
54 Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetNext() const { return myNext; }
55 Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetFirst() const { return myFirst; }
56
57 Standard_EXPORT bool HasFather() { return (myFather); }
58 Standard_EXPORT bool HasPrevious() { return (myPrevious); }
59 Standard_EXPORT bool HasNext() {return (myNext); }
60 Standard_EXPORT bool HasFirst() { return (myFirst); }
61 Standard_EXPORT const std::string& GetTreeID() { return ID(); }
62 Standard_EXPORT int Depth() const;
63 Standard_EXPORT bool IsRoot() const ;
64 Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* Root() const;
65 Standard_EXPORT bool IsAscendant (const SALOMEDSImpl_AttributeTreeNode* ofTN) const;
66 Standard_EXPORT bool IsDescendant(const SALOMEDSImpl_AttributeTreeNode* value) const;
67 Standard_EXPORT bool IsFather(const SALOMEDSImpl_AttributeTreeNode* value) const;
68 Standard_EXPORT bool IsChild(const SALOMEDSImpl_AttributeTreeNode* value) const;
69
70 Standard_EXPORT virtual std::string Save();
71 Standard_EXPORT virtual void Load(const std::string&); 
72 Standard_EXPORT virtual std::string Type(); 
73
74 Standard_EXPORT  const std::string& ID() const;
75 Standard_EXPORT  void Restore(DF_Attribute* with) ;
76 Standard_EXPORT  void Paste(DF_Attribute* into);
77 Standard_EXPORT  DF_Attribute* NewEmpty() const;
78 Standard_EXPORT ~SALOMEDSImpl_AttributeTreeNode() {;}
79
80 Standard_EXPORT virtual void AfterAddition();
81 Standard_EXPORT virtual void BeforeForget();
82
83 private:
84
85 std::string myTreeID; 
86 SALOMEDSImpl_AttributeTreeNode* myFather;
87 SALOMEDSImpl_AttributeTreeNode* myPrevious;
88 SALOMEDSImpl_AttributeTreeNode* myNext;
89 SALOMEDSImpl_AttributeTreeNode* myFirst;
90
91 friend class SALOMEDSImpl_ChildNodeIterator;
92
93 };
94
95 #endif