vtkMRMLEMSCollectionNode.h

Go to the documentation of this file.
00001 #ifndef __vtkMRMLEMSCollectionNode_h
00002 #define __vtkMRMLEMSCollectionNode_h
00003 
00004 #include "vtkMRML.h"
00005 #include "vtkMRMLNode.h"
00006 #include "vtkEMSegment.h"
00007 #include <list>
00008 #include <map>
00009 
00010 class VTK_EMSEGMENT_EXPORT vtkMRMLEMSCollectionNode : 
00011   public vtkMRMLNode
00012 {
00013 public:
00014   static vtkMRMLEMSCollectionNode *New();
00015   vtkTypeMacro(vtkMRMLEMSCollectionNode,vtkMRMLNode);
00016   void PrintSelf(ostream& os, vtkIndent indent);
00017 
00018   virtual vtkMRMLNode* CreateNodeInstance();
00019 
00020   // Description:
00021   // Set node attributes
00022   virtual void ReadXMLAttributes(const char** atts);
00023 
00024   // Description:
00025   // Write this node's information to a MRML file in XML format.
00026   virtual void WriteXML(ostream& of, int indent);
00027 
00028   // Description:
00029   // Copy the node's attributes to this object
00030   virtual void Copy(vtkMRMLNode *node);
00031 
00032   // Description:
00033   // Get node XML tag name (like , Model)
00034   virtual const char* GetNodeTagName() {return "EMSCollection";}
00035 
00036   // Description:
00037   // Updates this node if it depends on other nodes
00038   // when the node is deleted in the scene
00039   virtual void UpdateReferences();
00040 
00041   // Description:
00042   // Update the stored reference to another node in the scene
00043   virtual void UpdateReferenceID(const char *oldID, const char *newID);
00044 
00045   // Returns 1 if volume was added or 0 if the mapping between key and volumeNodeID existed 
00046   virtual int   AddNode(const char* key, const char* volumeNodeID);
00047   virtual int    GetNumberOfNodes() const;
00048 
00049   virtual void   RemoveAllNodes();
00050   virtual void   RemoveNodeByKey(const char* key);
00051   virtual void   RemoveNodeByNodeID(const char* key);
00052   virtual void   RemoveNthNode(int n);
00053 
00054   virtual const char*        GetNodeIDByKey(const char* key) const;
00055   virtual const char*        GetKeyByNodeID(const char* nodeID) const;
00056 
00057   virtual int                GetIndexByKey(const char* key) const;
00058   virtual int                GetIndexByNodeID(const char* nodeID) const;
00059 
00060   virtual const char*        GetNthNodeID(int n) const;
00061   virtual void               SetNthNodeID(int n, const char* nodeID);
00062 
00063   virtual const char*        GetNthKey(int n) const;
00064  
00065   virtual void  MoveNthNode(int n, int toIndex);
00066 
00067   virtual vtkMRMLNode*       GetNthNode(int n) const;
00068 
00069 protected:
00070   vtkMRMLEMSCollectionNode();
00071   ~vtkMRMLEMSCollectionNode();
00072   vtkMRMLEMSCollectionNode(const vtkMRMLEMSCollectionNode&);
00073   void operator=(const vtkMRMLEMSCollectionNode&);
00074 
00075   //BTX
00076   // provide mapping key->value and value->key
00077   typedef vtkstd::string                    KeyType;
00078   typedef vtkstd::string                    ValueType;
00079   typedef vtkstd::map<KeyType, ValueType>   MapType;
00080   mutable MapType                           KeyToNodeIDMap;
00081   mutable MapType                           NodeIDToKeyMap;
00082 
00083   // maintain order of keys
00084   typedef vtkstd::list<KeyType>             KeyListType;
00085   typedef KeyListType::iterator             KeyIterator;
00086   typedef KeyListType::const_iterator       KeyConstIterator;  
00087   mutable KeyListType                       KeyList;
00088   //ETX
00089 
00090 };
00091 
00092 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1