vtkProstateNavStep.h

Go to the documentation of this file.
00001 /*==========================================================================
00002 
00003   Portions (c) Copyright 2008 Brigham and Women's Hospital (BWH) All Rights Reserved.
00004 
00005   See Doc/copyright/copyright.txt
00006   or http://www.slicer.org/copyright/copyright.txt for details.
00007 
00008   Program:   3D Slicer
00009   Module:    $HeadURL: $
00010   Date:      $Date: $
00011   Version:   $Revision: $
00012 
00013 ==========================================================================*/
00014 
00015 #ifndef __vtkProstateNavStep_h
00016 #define __vtkProstateNavStep_h
00017 
00018 #include "vtkKWWizardStep.h"
00019 #include "vtkProstateNav.h"
00020 #include "vtkCommand.h"
00021 
00022 #include "vtkObserverManager.h"
00023 #include "vtkMRMLProstateNavManagerNode.h"
00024 
00025 class vtkProstateNavGUI;
00026 class vtkProstateNavLogic;
00027 class vtkMRMLScene;
00028 
00029 class VTK_PROSTATENAV_EXPORT vtkProstateNavStep : public vtkKWWizardStep
00030 {
00031 public:
00032   static vtkProstateNavStep *New();
00033   vtkTypeRevisionMacro(vtkProstateNavStep,vtkKWWizardStep);
00034   void PrintSelf(ostream& os, vtkIndent indent);
00035 
00036   virtual void Register(vtkObject *o) { Superclass::Register(o); };
00037   virtual void UnRegister(vtkObjectBase *o) { Superclass::UnRegister(o); };
00038 
00039   // Description: 
00040   // Get/Set GUI
00041   vtkGetObjectMacro(GUI, vtkProstateNavGUI);
00042   vtkGetObjectMacro(Logic, vtkProstateNavLogic);
00043 
00044   virtual void SetGUI(vtkProstateNavGUI*);
00045   virtual void SetLogic(vtkProstateNavLogic*);
00046   virtual void TearDownGUI();
00047 
00048   vtkSetObjectMacro(ProstateNavManager, vtkMRMLProstateNavManagerNode);
00049   vtkGetObjectMacro(ProstateNavManager, vtkMRMLProstateNavManagerNode);
00050 
00051   vtkSetMacro(TotalSteps, int);
00052   vtkGetMacro(TotalSteps, int);
00053   vtkSetMacro(StepNumber, int);
00054   vtkGetMacro(StepNumber, int);
00055 
00056   void SetTitle(const char* title) {
00057     this->Title = title;
00058   }
00059 
00060   const char* GetTitle() {
00061     return this->Title.c_str();
00062   }
00063 
00064   void UpdateName();
00065 
00066 
00067   void SetInMRMLCallbackFlag (int flag) {
00068     this->InMRMLCallbackFlag = flag;
00069   }
00070   vtkGetMacro(InMRMLCallbackFlag, int);
00071   void SetInGUICallbackFlag (int flag) {
00072     this->InGUICallbackFlag = flag;
00073     }
00074   vtkGetMacro(InGUICallbackFlag, int);
00075 
00076   void SetAndObserveMRMLScene ( vtkMRMLScene *mrml )
00077     {
00078     vtkMRMLScene *oldValue = this->MRMLScene;
00079     this->MRMLObserverManager->SetAndObserveObject ( vtkObjectPointer( &this->MRMLScene), (vtkObject*)mrml );
00080     if ( oldValue != this->MRMLScene )
00081       {
00082       this->InvokeEvent (vtkCommand::ModifiedEvent);
00083       }
00084     }
00085 
00086   void SetAndObserveMRMLSceneEvents ( vtkMRMLScene *mrml, vtkIntArray *events )
00087     {
00088     vtkObject *oldValue = this->MRMLScene;
00089     this->MRMLObserverManager->SetAndObserveObjectEvents ( vtkObjectPointer( &this->MRMLScene), mrml, events );
00090     if ( oldValue != this->MRMLScene )
00091       {
00092       this->InvokeEvent (vtkCommand::ModifiedEvent);
00093       }
00094     }
00095 
00096 
00097   void SetTitleBackgroundColor (double r, double g, double b) {
00098     this->TitleBackgroundColor[0] = r;
00099     this->TitleBackgroundColor[1] = g;
00100     this->TitleBackgroundColor[2] = b;
00101   };
00102 
00103   void GetTitleBackgroundColor (double* r, double* g, double* b) {
00104     *r = this->TitleBackgroundColor[0];
00105     *g = this->TitleBackgroundColor[1];
00106     *b = this->TitleBackgroundColor[2];
00107   };
00108 
00109   // Description:
00110   // Reimplement the superclass's method (see vtkKWWizardStep).
00111   virtual void HideUserInterface();
00112   virtual void Validate();
00113   virtual int CanGoToSelf();
00114   virtual void ShowUserInterface();
00115   virtual void ProcessGUIEvents(vtkObject *caller, unsigned long event, void *callData) {};
00116   virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) {};
00117 
00118   virtual void UpdateGUI() {};
00119 
00120   void ShowWorkspaceModel(bool show);
00121   bool IsWorkspaceModelShown();
00122   void ShowRobotModel(bool show);
00123   bool IsRobotModelShown();
00124 
00125 protected:
00126   vtkProstateNavStep();
00127   ~vtkProstateNavStep();
00128 
00129   static void GUICallback(vtkObject *caller,
00130                           unsigned long eid, void *clientData, void *callData );
00131 
00132   static void MRMLCallback(vtkObject *caller,
00133                            unsigned long eid, void *clientData, void *callData );
00134 
00135 protected:
00136   
00137   double TitleBackgroundColor[3];
00138 
00139   int InGUICallbackFlag;
00140   int InMRMLCallbackFlag;
00141 
00142   vtkProstateNavGUI   *GUI;
00143   vtkProstateNavLogic *Logic;
00144   vtkMRMLScene        *MRMLScene;
00145 
00146   vtkCallbackCommand *GUICallbackCommand;
00147   vtkCallbackCommand *MRMLCallbackCommand;
00148   vtkObserverManager *MRMLObserverManager;
00149 
00150   vtkMRMLProstateNavManagerNode* ProstateNavManager;
00151 
00152   //BTX
00153   std::string Title;
00154   //ETX
00155   
00156   int TotalSteps;     // Total number of steps in the wizard
00157   int StepNumber;     // Step number for this step.
00158 
00159 private:
00160   vtkProstateNavStep(const vtkProstateNavStep&);
00161   void operator=(const vtkProstateNavStep&);
00162 
00163 };
00164 
00165 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1