Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00045 #ifndef __vtkKWEObjectTreeNodeBase_h
00046 #define __vtkKWEObjectTreeNodeBase_h
00047
00048 #include "vtkKWESerializableObject.h"
00049 #include "vtkSmartPointer.h"
00050 #include "VTKEdgeConfigure.h"
00051
00052 class vtkInformation;
00053 class vtkInformationIntegerKey;
00054 class vtkInformationObjectBaseKey;
00055 class vtkInformationStringKey;
00056 class vtkKWEObjectTreePropertyBase;
00057 class vtkKWEObjectTreeNodeBaseChildren;
00058 class vtkKWEObjectTreeNodeIterator;
00059 class vtkKWESerializer;
00060
00061 class VTKEdge_FILTERING_EXPORT vtkKWEObjectTreeNodeBase : public vtkKWESerializableObject
00062 {
00063 public:
00064 static vtkKWEObjectTreeNodeBase* New();
00065 vtkTypeRevisionMacro(vtkKWEObjectTreeNodeBase, vtkKWESerializableObject);
00066 void PrintSelf(ostream& os, vtkIndent indent);
00067
00069
00070 virtual void SetNodeObject(vtkObject *object);
00071 vtkGetObjectMacro(NodeObject, vtkObject);
00073
00075 virtual unsigned int GetNumberOfChildren();
00076
00082 virtual int AddChild(vtkKWEObjectTreeNodeBase *childNode);
00083
00091 virtual int InsertChild(unsigned int index, vtkKWEObjectTreeNodeBase *childNode);
00092
00095 int RemoveChild(vtkKWEObjectTreeNodeBase *childNode);
00096
00099 int RemoveChild(unsigned int index);
00100
00102 vtkKWEObjectTreeNodeBase *GetChild(unsigned int index);
00103
00105
00107 vtkGetObjectMacro(Parent, vtkKWEObjectTreeNodeBase);
00109
00111 virtual bool IsDescendant(vtkKWEObjectTreeNodeBase *testNode);
00112
00115 int AddProperty(vtkKWEObjectTreePropertyBase *nodeProperty);
00116
00120 void GetAllProperties(vtkInformation *allProperties);
00121
00123
00128 vtkKWEObjectTreePropertyBase* GetProperty(vtkInformationObjectBaseKey *propertyKey,
00129 bool &inheritedProperty, bool includeInheritance = false);
00131
00134 int RemoveProperty(vtkInformationObjectBaseKey *propertyKey);
00135
00138 int RemoveProperty(vtkKWEObjectTreePropertyBase *nodeProperty);
00139
00141 void RemoveAllProperties();
00142
00144 int GetNumberOfProperties();
00145
00148 virtual void Modified();
00149
00153 virtual unsigned long GetMTime();
00154
00156
00157 vtkGetMacro(TreeModifiedTime, unsigned long);
00159
00161
00169 virtual bool IsEqualTo(vtkKWEObjectTreeNodeBase *testNode,
00170 bool checkDescendants, bool canBeSuperset = false,
00171 bool considerInheritedProperties = false);
00173
00176 virtual void Serialize(vtkKWESerializer*);
00177
00179
00180 const char *GetName();
00181 void SetName(const char *name);
00183
00185 const char *GetUUID();
00186
00188 void SetUUID(const char *uuid);
00189
00193 int CreateUUID();
00194
00197 void ClearUUID();
00198
00199
00200
00201
00202 enum NodeStates
00203 {
00204 ACTIVE_STATE,
00205 INACTIVE_STATE
00206 };
00207
00208 void SetStateToActive()
00209 { this->SetState(ACTIVE_STATE); }
00210 void SetStateToInactive()
00211 { this->SetState(INACTIVE_STATE); }
00212 void SetState(int nodeState);
00213 int GetState();
00214 const char *GetStateAsString();
00215
00217
00219 void InheritPropertiesOn()
00220 { this->SetInheritProperties(true); }
00221 void InheritPropertiesOff()
00222 { this->SetInheritProperties(false); }
00223 bool CanInheritProperties()
00224 { return this->GetInheritProperties(); }
00225 bool GetInheritProperties();
00226 void SetInheritProperties(bool inheritState);
00228
00229 static vtkInformationStringKey* NAME();
00230 static vtkInformationStringKey* UUID();
00231 static vtkInformationIntegerKey* STATE();
00232 static vtkInformationIntegerKey* INHERIT_PROPERTIES();
00233
00234
00235 protected:
00236 vtkKWEObjectTreeNodeBase();
00237 virtual ~vtkKWEObjectTreeNodeBase();
00238
00240 void SetParent(vtkKWEObjectTreeNodeBase *parent);
00241
00243
00245 friend class vtkKWEObjectTreeNodeIterator;
00246 void AddChildren(vtkKWEObjectTreeNodeIterator *iterator);
00248
00250
00252 friend class vtkKWEObjectTreePropertyBase;
00253 virtual void UpdateTreeModifiedTime(unsigned long treeTime);
00255
00259 void AddInheritedProperties(vtkInformation *allProperties);
00260
00264 int GetNumberOfInformationEntries(vtkInformation *infoObject);
00265
00267 vtkKWEObjectTreeNodeBaseChildren *Children;
00268
00270 vtkKWEObjectTreeNodeBase *Parent;
00271
00274 vtkInformation *Properties;
00275
00277 vtkInformation *Attributes;
00278
00280 unsigned long TreeModifiedTime;
00281
00283 vtkObject *NodeObject;
00284
00289 virtual void SerializeObject(vtkKWESerializer*);
00290
00291 private:
00292 vtkKWEObjectTreeNodeBase(const vtkKWEObjectTreeNodeBase&);
00293 void operator=(const vtkKWEObjectTreeNodeBase&);
00294
00295 bool RemoveAllPropertiesInternal();
00296 };
00297
00298 #endif