vtkMRMLRobotNode.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __vtkMRMLRobotNode_h
00015 #define __vtkMRMLRobotNode_h
00016
00017 #include "vtkOpenIGTLinkIFWin32Header.h"
00018 #include "vtkMRML.h"
00019 #include "vtkMRMLNode.h"
00020 #include "vtkMRMLStorageNode.h"
00021
00022 #include "vtkObject.h"
00023 #include "vtkProstateNavWin32Header.h"
00024
00025 #include "vtkMRMLLinearTransformNode.h"
00026
00027 class vtkMRMLModelNode;
00028 class vtkMRMLScalarVolumeNode;
00029 class vtkSlicerApplication;
00030 class vtkProstateNavTargetDescriptor;
00031 struct NeedleDescriptorStruct;
00032
00033 class VTK_PROSTATENAV_EXPORT vtkMRMLRobotNode : public vtkMRMLTransformableNode
00034 {
00035
00036 public:
00037
00038
00039
00040
00041
00042
00043
00044
00045 enum {
00046 ChangeStatusEvent = 200907,
00047 ChangeTargetEvent = 200908,
00048 RobotMovedEvent = 200910
00049 };
00050
00051 enum STATUS_ID {
00052 StatusOff=0,
00053 StatusOk,
00054 StatusWarning,
00055 StatusError
00056 };
00057
00058 struct StatusDescriptor
00059 {
00060 std::string text;
00061 STATUS_ID indicator;
00062 };
00063
00064
00068 virtual bool CanApplyNonLinearTransforms();
00069 virtual void ApplyTransform(vtkAbstractTransform* transform);
00070 virtual void ApplyTransform(vtkMatrix4x4* transformMatrix);
00071
00072 public:
00073
00074
00075
00076
00077
00078 static vtkMRMLRobotNode *New();
00079 vtkTypeMacro(vtkMRMLRobotNode,vtkMRMLTransformableNode);
00080 virtual vtkMRMLNode* CreateNodeInstance();
00081
00082 void PrintSelf(ostream& os, vtkIndent indent);
00083
00084
00085
00086 virtual void ReadXMLAttributes( const char** atts);
00087
00088
00089
00090 virtual void WriteXML(ostream& of, int indent);
00091
00092
00093
00094 virtual void Copy(vtkMRMLNode *node);
00095
00096
00097
00098
00099 virtual void UpdateScene(vtkMRMLScene *);
00100
00101
00102
00103 virtual void UpdateReferenceID(const char *oldID, const char *newID);
00104
00105
00106
00107
00108 virtual void UpdateReferences();
00109
00110 virtual void RemoveChildNodes();
00111
00112
00113
00114 virtual const char* GetNodeTagName()
00115 {return "Robot";};
00116
00117
00118 virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData );
00119
00120 virtual const char* GetWorkflowStepsString()
00121 {return "PointTargeting PointVerification"; };
00122
00123
00124
00125 vtkGetStringMacro(TargetTransformNodeID);
00126 vtkMRMLTransformNode* GetTargetTransformNode();
00127 void SetAndObserveTargetTransformNodeID(const char *transformNodeID);
00128
00129 virtual int Init(vtkSlicerApplication* app, const char* moduleShareDir);
00130
00131 virtual int MoveTo(const char *transformNodeId) { return 0; };
00132
00133 virtual void SwitchStep(const char *stepName) {};
00134
00135 virtual int OnTimer() {return 1; };
00136
00137
00138
00139
00140
00141 virtual bool GetNeedleDirectionAtTarget(vtkProstateNavTargetDescriptor *targetDesc, NeedleDescriptorStruct *needle, double* needleDirection) { return false; };
00142
00143 virtual bool ShowRobotAtTarget(vtkProstateNavTargetDescriptor *targetDesc, NeedleDescriptorStruct *needle) { return false; };
00144
00145 virtual std::string GetTargetInfoText(vtkProstateNavTargetDescriptor *targetDesc, NeedleDescriptorStruct *needle) { return ""; };
00146
00147 static void SplitTargetInfoText(const std::string targetInfoText, std::string &mainInfo, std::string &additionalInfo);
00148 static std::string GetTargetInfoSectionSeparator() { return "-----\n"; };
00149
00150
00151
00152
00153
00154 virtual bool GetRobotBaseTransform(vtkMatrix4x4* transform) { return false; };
00155
00156 virtual int PerformRegistration(vtkMRMLScalarVolumeNode* volumeNode) { return 0; };
00157
00158
00159 virtual int PerformRegistration(vtkMRMLScalarVolumeNode* volumeNode, int param1, int param2) { return 0; };
00160
00161
00162
00163 virtual const char* GetCalibrationObjectModelId() {return ""; };
00164 virtual const char* GetCalibrationObjectTransformId() { return ""; };
00165
00166
00167
00168 virtual const char* GetWorkspaceObjectModelId() {return ""; };
00169
00170
00171
00172 virtual const char* GetRobotModelId() {return ""; };
00173
00174 int GetStatusDescriptorCount();
00175
00176
00177
00178
00179 int GetStatusDescriptor(unsigned int index, std::string &text, STATUS_ID &indicator);
00180
00181
00182 protected:
00183
00184
00185
00186
00187 vtkMRMLRobotNode();
00188 virtual ~vtkMRMLRobotNode();
00189 vtkMRMLRobotNode(const vtkMRMLRobotNode&);
00190 void operator=(const vtkMRMLRobotNode&);
00191
00192 vtkSetReferenceStringMacro(TargetTransformNodeID);
00193 char *TargetTransformNodeID;
00194 vtkMRMLTransformNode* TargetTransformNode;
00195
00196
00197 std::vector<StatusDescriptor> StatusDescriptors;
00198 std::string ModuleShareDirectory;
00199
00200
00201 protected:
00202
00203
00204
00205 };
00206
00207 #endif
00208