Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLModelHierarchyLogic.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLModelHierarchyLogic.h,v $
10  Date: $Date: 2010-02-15 16:35:35 -0500 (Mon, 15 Feb 2010) $
11  Version: $Revision: 12142 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLModelHierarchyLogic_h
16 #define __vtkMRMLModelHierarchyLogic_h
17 
18 // MRML includes
19 #include <vtkMRMLAbstractLogic.h>
20 //#include <vtkMRML.h>
21 //#include <vtkMRMLModelNode.h>
24 //#include <vtkMRMLModelHierarchyNode.h>
25 
26 // STD includes
27 #include <cstdlib>
28 #include <vector>
29 
30 typedef std::vector< vtkMRMLModelHierarchyNode *> vtkMRMLModelHierarchyNodeList;
31 
36 class VTK_MRML_LOGIC_EXPORT vtkMRMLModelHierarchyLogic : public vtkMRMLAbstractLogic
37 {
38 public:
42 
46  vtkMRMLModelHierarchyNode* GetModelHierarchyNode(const char *modelNodeID);
47 
51  {
52  this->UpdateModelToHierarchyMap();
53  return (int)this->ModelHierarchyNodes.size();
54  };
55 
58  void GetHierarchyChildrenNodes(vtkMRMLModelHierarchyNode *parentNode,
59  vtkMRMLModelHierarchyNodeList &childrenNodes);
64  vtkMRMLModelHierarchyNodeList GetHierarchyChildrenNodes(vtkMRMLModelHierarchyNode *parentNode);
65 
69  {
70  ModelHierarchyNodesMTime = 0;
71  HierarchyChildrenNodesMTime = 0;
72  }
73 
78  static void SetChildrenVisibility(vtkMRMLDisplayableHierarchyNode *displayableHierarchyNode,
79  const char *displayableNodeClass, const char *displayNodeClass,
80  int visibility);
81 
86  vtkSetMacro(ChildrenVisibilitySetBatchUpdateThreshold, int);
87  vtkGetMacro(ChildrenVisibilitySetBatchUpdateThreshold, int);
88 
89 protected:
93  void operator=(const vtkMRMLModelHierarchyLogic&);
94 
96  virtual void SetMRMLSceneInternal(vtkMRMLScene* newScene) VTK_OVERRIDE;
97 
99  virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode* removedNode) VTK_OVERRIDE;
100 
104  int UpdateModelToHierarchyMap();
105 
106  void UpdateHierarchyChildrenMap();
107 
108  std::map<std::string, vtkMRMLModelHierarchyNode *> ModelHierarchyNodes;
109  typedef std::map<std::string, std::vector< vtkMRMLModelHierarchyNode *> > HierarchyChildrenNodesType;
110  HierarchyChildrenNodesType HierarchyChildrenNodes;
111 
114 
116 };
117 
118 #endif
Superclass for MRML logic classes.
HierarchyChildrenNodesType HierarchyChildrenNodes
std::vector< vtkMRMLModelHierarchyNode * > vtkMRMLModelHierarchyNodeList
std::map< std::string, std::vector< vtkMRMLModelHierarchyNode * > > HierarchyChildrenNodesType
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode *)
virtual void SetMRMLSceneInternal(vtkMRMLScene *newScene)
int GetNumberOfModelsInHierarchy()
Return number of model that are in a hierarchy.
MRML node to represent a hierarchyu of models.
void HierarchyIsModified()
Call this to update the cache when hierarchy is modified.
Slicer logic class for volumes manipulation.
MRML node to represent a hierarchy of displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
static vtkMRMLAbstractLogic * New()
std::map< std::string, vtkMRMLModelHierarchyNode * > ModelHierarchyNodes