28 #ifndef __vtkMRMLSubjectHierarchyNode_h 29 #define __vtkMRMLSubjectHierarchyNode_h 35 class vtkCallbackCommand;
66 SubjectHierarchyItemAddedEvent = 62000,
80 SubjectHierarchyEndResolveEvent
86 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
91 virtual
void ReadItemFromXML(const
char** atts);
93 virtual
void WriteXML(ostream& of,
int indent) VTK_OVERRIDE;
95 virtual
void WriteNodeBodyXML(ostream& of,
int indent) VTK_OVERRIDE;
101 virtual const
char* GetNodeTagName() VTK_OVERRIDE;
110 vtkIdType GetSceneItemID();
117 void SetItemName(vtkIdType itemID,
std::
string name);
120 std::
string GetItemName(vtkIdType itemID);
122 void SetItemLevel(vtkIdType itemID,
std::
string level);
124 std::
string GetItemLevel(vtkIdType itemID);
126 void SetItemOwnerPluginName(vtkIdType itemID,
std::
string ownerPluginName);
128 std::
string GetItemOwnerPluginName(vtkIdType itemID);
130 void SetItemExpanded(vtkIdType itemID,
bool expanded);
132 bool GetItemExpanded(vtkIdType itemID);
135 void SetItemUID(vtkIdType itemID,
std::
string uidName,
std::
string uidValue);
138 std::
string GetItemUID(vtkIdType itemID,
std::
string uidName);
141 void SetItemAttribute(vtkIdType itemID,
std::
string attributeName,
std::
string attributeValue);
144 bool RemoveItemAttribute(vtkIdType itemID,
std::
string attributeName);
147 std::
string GetItemAttribute(vtkIdType itemID,
std::
string attributeName);
150 std::vector<
std::
string> GetItemAttributeNames(vtkIdType itemID);
154 bool HasItemAttribute(vtkIdType itemID,
std::
string attributeName);
158 void ItemModified(vtkIdType itemID);
162 void RequestOwnerPluginSearch(vtkIdType itemID);
166 void RequestOwnerPluginSearch(
vtkMRMLNode* dataNode);
169 static vtkIdType GetInvalidItemID() {
return INVALID_ITEM_ID; }
178 vtkIdType CreateItem(vtkIdType parentItemID,
vtkMRMLNode* dataNode);
185 vtkIdType CreateHierarchyItem(vtkIdType parentItemID, std::string name, std::string level);
190 vtkIdType CreateSubjectItem(vtkIdType parentItemID, std::string name);
195 vtkIdType CreateStudyItem(vtkIdType parentItemID, std::string name);
200 vtkIdType CreateFolderItem(vtkIdType parentItemID, std::string name);
206 bool RemoveItem(vtkIdType itemID,
bool removeDataNode=
true,
bool recursive=
true);
211 bool RemoveItemChildren(vtkIdType itemID,
bool removeDataNodes=
true,
bool recursive=
true);
216 void RemoveAllItems(
bool removeDataNode=
false);
219 void SetItemParent(vtkIdType itemID, vtkIdType parentItemID);
222 vtkIdType GetItemParent(vtkIdType itemID);
225 int GetItemPositionUnderParent(vtkIdType itemID);
228 vtkIdType GetItemByPositionUnderParent(vtkIdType parentItemID,
int position);
234 void GetItemChildren(vtkIdType itemID, std::vector<vtkIdType>& childIDs,
bool recursive=
false);
236 void GetItemChildren(vtkIdType itemID, vtkIdList* childIDs,
bool recursive=
false);
240 bool ReparentItemByDataNode(vtkIdType itemID,
vtkMRMLNode* newParentNode);
244 bool MoveItem(vtkIdType itemID, vtkIdType beforeItemID);
252 vtkIdType GetItemByUID(
const char* uidName,
const char* uidValue);
259 vtkIdType GetItemByUIDList(
const char* uidName,
const char* uidValue);
264 vtkIdType GetItemByDataNode(
vtkMRMLNode* dataNode);
270 vtkIdType GetItemChildWithName(vtkIdType parentItemID, std::string name);
277 void GetDataNodesInBranch(vtkIdType itemID, vtkCollection* dataNodeCollection,
const char* childClass=NULL);
288 void SetDisplayVisibilityForBranch(vtkIdType itemID,
int visible);
292 int GetDisplayVisibilityForBranch(vtkIdType itemID);
297 bool IsItemLevel(vtkIdType itemID, std::string level);
302 bool IsItemVirtualBranchParent(vtkIdType itemID);
310 std::string GetAttributeFromItemAncestor(vtkIdType itemID, std::string attributeName, std::string level=
"");
314 vtkIdType GetItemAncestorAtLevel(vtkIdType itemID, std::string level);
321 static void DeserializeUIDList(std::string uidListString, std::vector<std::string>& deserializedUIDList);
327 std::vector<vtkIdType> GetItemsReferencedFromItemByDICOM(vtkIdType itemID);
330 void GetItemsReferencedFromItemByDICOM(vtkIdType itemID, vtkIdList* referencingIdList);
336 std::vector<vtkIdType> GetItemsReferencingItemByDICOM(vtkIdType itemID);
339 void GetItemsReferencingItemByDICOM(vtkIdType itemID, vtkIdList* referencingIdList);
342 std::string GenerateUniqueItemName(std::string name);
345 int GetNumberOfItems();
349 int GetNumberOfItemChildren(vtkIdType itemID,
bool recursive=
false);
352 void PrintItem(vtkIdType itemID, ostream& os, vtkIndent indent);
356 static void ItemEventCallback(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
366 friend class vtkInternal;
static const std::string SUBJECTHIERARCHY_VERSION_ATTRIBUTE_NAME
static const vtkIdType INVALID_ITEM_ID
Event invoked when item resolving starts (e.g. after scene import)
vtkSmartPointer< vtkCallbackCommand > ItemEventCallbackCommand
Command handling events from subject hierarchy items.
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
MRML node to represent a complete subject hierarchy tree.
A set of MRML Nodes that supports serialization and undo/redo.
static const std::string SUBJECTHIERARCHY_NAME_VALUE_SEPARATOR
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
static const std::string SUBJECTHIERARCHY_SEPARATOR
Abstract Superclass for all specific types of MRML nodes.