vtkMRMLAnnotationNode.h

Go to the documentation of this file.
00001 // .NAME vtkMRMLAnnotationNode - MRML node to represent a fiber bundle from tractography in DTI data.
00002 // .SECTION Description
00003 // Annotation nodes contains control points, internally represented as vtkPolyData.
00004 // A Annotation node contains many control points  and forms the smallest logical unit of tractography 
00005 // that MRML will manage/read/write. Each control point has accompanying data.  
00006 // Visualization parameters for these nodes are controlled by the vtkMRMLAnnotationTextDisplayNode class.
00007 //
00008 
00009 #ifndef __vtkMRMLAnnotationNode_h
00010 #define __vtkMRMLAnnotationNode_h
00011 
00012 #include "qSlicermiAnnotationModuleExport.h"
00013 #include "vtkMRMLModelNode.h" 
00014 
00015 class vtkStringArray;
00016 class vtkMRMLStorageNode;
00017 class vtkMRMLAnnotationTextDisplayNode;
00018 
00019 class  Q_SLICER_QTMODULES_ANNOTATIONS_EXPORT vtkMRMLAnnotationNode : public vtkMRMLModelNode
00020 {
00021 public:
00022   static vtkMRMLAnnotationNode *New();
00023   vtkTypeMacro(vtkMRMLAnnotationNode,vtkMRMLModelNode);
00024   void PrintSelf(ostream& os, vtkIndent indent);
00025   // Description:
00026   // Just prints short summary 
00027   virtual void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1);
00028 
00029   //--------------------------------------------------------------------------
00030   // MRMLNode methods
00031   //--------------------------------------------------------------------------
00032 
00033   virtual vtkMRMLNode* CreateNodeInstance();
00034   // Description:
00035   // Get node XML tag name (like Volume, Model)
00036   virtual const char* GetNodeTagName() {return "Annotation";};
00037 
00038   // Description:
00039   // Read node attributes from XML file
00040   virtual void ReadXMLAttributes( const char** atts);
00041   
00042   // Description:
00043   // Write this node's information to a MRML file in XML format.
00044   virtual void WriteXML(ostream& of, int indent);
00045 
00046 
00047   // Description:
00048   // Copy the node's attributes to this object
00049   virtual void Copy(vtkMRMLNode *node);
00050 
00051   void UpdateScene(vtkMRMLScene *scene);
00052 
00053   // Description:
00054   // alternative method to propagate events generated in Display nodes
00055   virtual void ProcessMRMLEvents ( vtkObject * /*caller*/, 
00056                                    unsigned long /*event*/, 
00057                                    void * /*callData*/ );
00058 
00059 
00060   // Description:
00061   // Create default storage node or NULL if does not have one
00062   virtual vtkMRMLStorageNode* CreateDefaultStorageNode();  
00063 
00064   int AddText(const char *newText,int selectedFlag, int visibleFlag); 
00065   void SetText(int id, const char *newText,int selectedFlag, int visibleFlag);
00066   vtkStdString GetText(int id); 
00067   int DeleteText(int id); 
00068 
00069   int GetNumberOfTexts(); 
00070 
00071   //BTX
00072   enum 
00073   {
00074     TEXT_SELECTED = 0,
00075     TEXT_VISIBLE,
00076     NUM_TEXT_ATTRIBUTE_TYPES
00077   };
00078 
00079   virtual const char *GetAttributeTypesEnumAsString(int val);
00080   vtkDataArray* GetAnnotationAttributes(int att); 
00081   int GetAnnotationAttribute(vtkIdType id, int att);
00082   void SetAnnotationAttribute(vtkIdType id, int att, double value);
00083   int DeleteAttribute(vtkIdType idAttEntry,  vtkIdType idAttType);
00084 
00085   // Description:
00086   // Initializes all variables associated with annotations
00087   virtual void ResetAnnotations();
00088 
00089   // Description:
00090   // add display node if not already present
00091   void CreateAnnotationTextDisplayNode();
00092 
00093   vtkMRMLAnnotationTextDisplayNode* GetAnnotationTextDisplayNode();
00094  
00095   // Description:
00096   // Reference of this annotation - can be an image, model, scene ,  ... 
00097   vtkGetStringMacro (ReferenceNodeID);
00098   vtkSetStringMacro (ReferenceNodeID);
00099 
00100   // Description:
00101   // Select all elements defining an annotation 
00102   // overwrites *_SELECTED and *_VISIBLE when set to 0
00103   // do not have to define for Selected as already defined by Superclass 
00104   vtkGetMacro(Visible, int);
00105   vtkSetMacro(Visible, int);
00106   vtkBooleanMacro(Visible, int);
00107 
00108   // Description:
00109   // If set to 1 then parameters should not be changed 
00110   vtkGetMacro(Locked, int);
00111   void SetLocked(int init);
00112 
00113 protected:
00114   vtkMRMLAnnotationNode();
00115   ~vtkMRMLAnnotationNode();
00116   vtkMRMLAnnotationNode(const vtkMRMLAnnotationNode&);
00117   void operator=(const vtkMRMLAnnotationNode&);
00118 
00119   // Description:
00120   // Initializes Text as  well as attributes
00121   // void ResetAnnotations(); 
00122 
00123   // Description:
00124   // Only initializes attributes with ID
00125   void ResetAttributes(int id);
00126   // Description:
00127   // Initializes all attributes 
00128   void ResetTextAttributesAll(); 
00129   void SetAttributeSize(vtkIdType  id, vtkIdType n);
00130 
00131   vtkStringArray *TextList;
00132   char *ReferenceNodeID; 
00133 
00134   void CreatePolyData();
00135 
00136   int Visible;
00137   int Locked;
00138 
00139 };
00140 
00141 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1