vtkMRMLAnnotationAngleNode.h
Go to the documentation of this file.00001 #ifndef __vtkMRMLAnnotationAngleNode_h
00002 #define __vtkMRMLAnnotationAngleNode_h
00003
00004 #include "qSlicermiAnnotationModuleExport.h"
00005 #include "vtkMRMLAnnotationLinesNode.h"
00006
00007 class vtkMatrix4x4;
00008 class vtkAbstractTransform;
00009 class vtkMRMLScene;
00010
00011 class Q_SLICER_QTMODULES_ANNOTATIONS_EXPORT vtkMRMLAnnotationAngleNode : public vtkMRMLAnnotationLinesNode
00012 {
00013 public:
00014 static vtkMRMLAnnotationAngleNode *New();
00015 vtkTypeMacro(vtkMRMLAnnotationAngleNode,vtkMRMLAnnotationLinesNode);
00016
00017
00018 void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1);
00019
00020
00021
00022
00023
00024 virtual vtkMRMLNode* CreateNodeInstance();
00025
00026
00027 virtual const char* GetNodeTagName() {return "AnnotationAngle";};
00028
00029
00030
00031 virtual void ReadXMLAttributes( const char** atts);
00032
00033
00034
00035 virtual void WriteXML(ostream& of, int indent);
00036
00037
00038
00039
00040 virtual void Copy(vtkMRMLNode *node);
00041
00042 void UpdateScene(vtkMRMLScene *scene);
00043
00044
00045
00046 virtual void ProcessMRMLEvents ( vtkObject * ,
00047 unsigned long ,
00048 void * );
00049
00050
00051
00052
00053 double* GetPosition1() {return this->GetControlPointCoordinates(0);}
00054
00055 int SetPosition1(double newControl[3]) { return this->SetControlPoint(0, newControl) ; }
00056
00057 int SetPosition1(double nC1, double nC2, double nC3) {
00058 double newControl[3] = {nC1,nC2,nC3};
00059 return this->SetPosition1(newControl) ;
00060 }
00061
00062 double* GetPosition2() {return this->GetControlPointCoordinates(1);}
00063 int SetPosition2(double newControl[3]) { return this->SetControlPoint(1, newControl);}
00064
00065 int SetPosition2(double nC1, double nC2, double nC3) {
00066 double newControl[3] = {nC1,nC2,nC3};
00067 return this->SetPosition2(newControl) ;
00068 }
00069
00070 double* GetPositionCenter() { return this->GetControlPointCoordinates(2);}
00071 int SetPositionCenter(double newControl[3]) { return this->SetControlPoint(2, newControl);}
00072
00073 int SetPositionCenter(double nC1, double nC2, double nC3) {
00074 double newControl[3] = {nC1,nC2,nC3};
00075 return this->SetPositionCenter(newControl) ;
00076 }
00077
00078
00079
00080 vtkGetStringMacro(LabelFormat);
00081 vtkSetStringMacro(LabelFormat);
00082
00083
00084
00085 double GetLabelScale();
00086 void SetLabelScale(double init);
00087
00088
00089
00090 int GetLabelVisibility();
00091 void SetLabelVisibility(int flag);
00092
00093 int SetAngle(vtkIdType line1Id, vtkIdType line2Id, int sel, int vis);
00094
00095
00096 int GetRay1Visibility() {return this->GetAnnotationAttribute(0,vtkMRMLAnnotationLinesNode::LINE_VISIBLE);}
00097 void SetRay1Visibility(int flag) { this->SetAnnotationAttribute(0,vtkMRMLAnnotationLinesNode::LINE_VISIBLE,flag);}
00098 int GetRay2Visibility() {return this->GetAnnotationAttribute(1,vtkMRMLAnnotationLinesNode::LINE_VISIBLE);}
00099 void SetRay2Visibility(int flag) { this->SetAnnotationAttribute(1,vtkMRMLAnnotationLinesNode::LINE_VISIBLE,flag);}
00100
00101 int GetArcVisibility() { return this->GetLabelVisibility();}
00102 void SetArcVisibility(int flag) { this->SetLabelVisibility(flag);}
00103
00104
00105
00106 vtkGetMacro(Resolution, int);
00107 vtkSetMacro(Resolution, int);
00108
00109
00110
00111 double *GetPointColour();
00112 void SetPointColour( double initColor[3]);
00113
00114
00115
00116 double *GetLineColour();
00117 void SetLineColour(double newColor[3]);
00118
00119
00120
00121 double *GetLabelTextColour();
00122 void SetLabelTextColour(double initColor[3]);
00123
00124
00125
00126 virtual bool CanApplyNonLinearTransforms() { return true; }
00127 virtual void ApplyTransform(vtkMatrix4x4* transformMatrix);
00128 virtual void ApplyTransform(vtkAbstractTransform* transform);
00129
00130
00131
00132 virtual vtkMRMLStorageNode* CreateDefaultStorageNode();
00133
00134 void Initialize(vtkMRMLScene* mrmlScene);
00135
00136
00137
00138 vtkGetStringMacro(ModelID1);
00139 vtkSetStringMacro(ModelID1);
00140 vtkGetStringMacro(ModelID2);
00141 vtkSetStringMacro(ModelID2);
00142 vtkGetStringMacro(ModelIDCenter);
00143 vtkSetStringMacro(ModelIDCenter);
00144
00145
00146 int GetVisibility() {return this->GetVisible();}
00147 void SetVisibility(int flag) {this->SetVisible(flag);}
00148
00149 void SetAngleMeasurement(double val);
00150 double GetAngleMeasurement();
00151
00152 enum
00153 {
00154 AngleNodeAddedEvent = 0,
00155 ValueModifiedEvent,
00156 };
00157
00158 protected:
00159 vtkMRMLAnnotationAngleNode();
00160 ~vtkMRMLAnnotationAngleNode();
00161 vtkMRMLAnnotationAngleNode(const vtkMRMLAnnotationAngleNode&);
00162 void operator=(const vtkMRMLAnnotationAngleNode&);
00163
00164
00165
00166 int Resolution;
00167 char* LabelFormat;
00168
00169 int SetControlPoint(int id, double newControl[3]);
00170
00171 int AddControlPoint(double newControl[3],int selectedFlag, int visibleFlag);
00172
00173
00174
00175
00176 char *ModelID1;
00177 char *ModelID2;
00178 char *ModelIDCenter;
00179 double angleMeasurement;
00180
00181 };
00182
00183 #endif