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();
114 void SetItemName(vtkIdType itemID,
std::
string name);
117 std::
string GetItemName(vtkIdType itemID);
119 void SetItemLevel(vtkIdType itemID,
std::
string level);
121 std::
string GetItemLevel(vtkIdType itemID);
123 void SetItemOwnerPluginName(vtkIdType itemID,
std::
string ownerPluginName);
125 std::
string GetItemOwnerPluginName(vtkIdType itemID);
127 void SetItemExpanded(vtkIdType itemID,
bool expanded);
129 bool GetItemExpanded(vtkIdType itemID);
132 void SetItemUID(vtkIdType itemID,
std::
string uidName,
std::
string uidValue);
135 std::
string GetItemUID(vtkIdType itemID,
std::
string uidName);
138 void SetItemAttribute(vtkIdType itemID,
std::
string attributeName,
std::
string attributeValue);
141 bool RemoveItemAttribute(vtkIdType itemID,
std::
string attributeName);
144 std::
string GetItemAttribute(vtkIdType itemID,
std::
string attributeName);
147 std::vector<
std::
string> GetItemAttributeNames(vtkIdType itemID);
151 bool HasItemAttribute(vtkIdType itemID,
std::
string attributeName);
155 void ItemModified(vtkIdType itemID);
159 void RequestOwnerPluginSearch(vtkIdType itemID);
163 void RequestOwnerPluginSearch(
vtkMRMLNode* dataNode);
166 static vtkIdType GetInvalidItemID() {
return INVALID_ITEM_ID; }
173 void SetItemDataNode(vtkIdType itemID,
vtkMRMLNode* dataNode);
182 vtkIdType CreateItem(vtkIdType parentItemID,
vtkMRMLNode* dataNode);
189 vtkIdType CreateHierarchyItem(vtkIdType parentItemID, std::string name, std::string level);
194 vtkIdType CreateSubjectItem(vtkIdType parentItemID, std::string name);
199 vtkIdType CreateStudyItem(vtkIdType parentItemID, std::string name);
204 vtkIdType CreateFolderItem(vtkIdType parentItemID, std::string name);
210 bool RemoveItem(vtkIdType itemID,
bool removeDataNode=
true,
bool recursive=
true);
215 bool RemoveItemChildren(vtkIdType itemID,
bool removeDataNodes=
true,
bool recursive=
true);
220 void RemoveAllItems(
bool removeDataNode=
false);
223 void SetItemParent(vtkIdType itemID, vtkIdType parentItemID);
226 vtkIdType GetItemParent(vtkIdType itemID);
229 int GetItemPositionUnderParent(vtkIdType itemID);
232 vtkIdType GetItemByPositionUnderParent(vtkIdType parentItemID,
int position);
238 void GetItemChildren(vtkIdType itemID, std::vector<vtkIdType>& childIDs,
bool recursive=
false);
240 void GetItemChildren(vtkIdType itemID, vtkIdList* childIDs,
bool recursive=
false);
244 bool ReparentItemByDataNode(vtkIdType itemID,
vtkMRMLNode* newParentNode);
248 bool MoveItem(vtkIdType itemID, vtkIdType beforeItemID);
256 vtkIdType GetItemByUID(
const char* uidName,
const char* uidValue);
263 vtkIdType GetItemByUIDList(
const char* uidName,
const char* uidValue);
268 vtkIdType GetItemByDataNode(
vtkMRMLNode* dataNode);
274 vtkIdType GetItemChildWithName(vtkIdType parentItemID, std::string name);
281 void GetDataNodesInBranch(vtkIdType itemID, vtkCollection* dataNodeCollection,
const char* childClass=NULL);
292 void SetDisplayVisibilityForBranch(vtkIdType itemID,
int visible);
296 int GetDisplayVisibilityForBranch(vtkIdType itemID);
301 bool IsItemLevel(vtkIdType itemID, std::string level);
306 bool IsItemVirtualBranchParent(vtkIdType itemID);
314 std::string GetAttributeFromItemAncestor(vtkIdType itemID, std::string attributeName, std::string level=
"");
318 vtkIdType GetItemAncestorAtLevel(vtkIdType itemID, std::string level);
325 static void DeserializeUIDList(std::string uidListString, std::vector<std::string>& deserializedUIDList);
331 std::vector<vtkIdType> GetItemsReferencedFromItemByDICOM(vtkIdType itemID);
334 void GetItemsReferencedFromItemByDICOM(vtkIdType itemID, vtkIdList* referencingIdList);
340 std::vector<vtkIdType> GetItemsReferencingItemByDICOM(vtkIdType itemID);
343 void GetItemsReferencingItemByDICOM(vtkIdType itemID, vtkIdList* referencingIdList);
346 std::string GenerateUniqueItemName(std::string name);
349 int GetNumberOfItems();
353 int GetNumberOfItemChildren(vtkIdType itemID,
bool recursive=
false);
356 void PrintItem(vtkIdType itemID, ostream& os, vtkIndent indent);
360 static void ItemEventCallback(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
370 friend class vtkInternal;
static const std::string SUBJECTHIERARCHY_VERSION_ATTRIBUTE_NAME
static const vtkIdType INVALID_ITEM_ID
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.
Event invoked when item resolving starts (e.g. after scene import)
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.