#include <vector>
#include "marTypes.h"
+#include "wxVTKRenderWindowInteractor.h"
+//#include "include/vtkImageViewer2_XYZ.h"
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-
-class creaMaracasVisu_EXPORT vtkImageViewer2_XYZ{
-public:
- vtkImageViewer2_XYZ();
- ~vtkImageViewer2_XYZ();
-
- void SetExtentDimension(int x1,int x2, int y1,int y2, int z1,int z2);
- void SetXSlice(int slice);
- void SetYSlice(int slice);
- void SetZSlice(int slice);
- int GetXSlice();
- int GetYSlice();
- int GetZSlice();
- vtkImageViewer2 *GetVtkImageViewer2();
-
-private:
- int _x1,_x2,_y1,_y2,_z1,_z2;
- vtkImageViewer2 *_vtkimageviewer2;
-protected:
-};
-
-
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-class wxVtkBaseView;
-
-class creaMaracasVisu_EXPORT wxVTKRenderWindowInteractorPlus : public wxVTKRenderWindowInteractor
-{
-public:
- wxVTKRenderWindowInteractorPlus(wxWindow *parent ,wxVtkBaseView *_wxvtkbaseview);
- virtual ~wxVTKRenderWindowInteractorPlus();
-
- wxVTKRenderWindowInteractorPlus();
- void OnLeftDClick( wxMouseEvent& event );
- void OnRightDClick( wxMouseEvent& event );
- void OnMiddleDClick( wxMouseEvent& event );
- void OnMouseWheel( wxMouseEvent& event );
-
-
- // VTK
- static wxVTKRenderWindowInteractorPlus * New();
-
-protected:
-private:
- wxVtkBaseView *_wxvtkbaseview;
- DECLARE_EVENT_TABLE( );
-
-
-};
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
+/* JCP 14/05/09
+//#include "vtkInteractorStyleBaseView.h"
+//class vtkInteractorStyleBaseView;
+ */
-class vtkInteractorStyleBaseView;
+#include "vtkInteractorStyleImage.h"
class creaMaracasVisu_EXPORT wxVtkBaseView{
public:
virtual void RefreshView();
virtual vtkRenderer* GetRenderer();
virtual vtkRenderWindow* GetRenWin();
- virtual void TransfromeCoordScreenToWorld(double &X, double &Y, double &Z, int type=2);
+ virtual void TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false,int type=2);
+
+ //RaC 03-2010 Method used by TransFromCoordScreenToWorld
+ void TransCoordScreenToWorld(double &X, double &Y, double &Z,int type=2);
+
+ /* JCP 04/05/09
void SetInteractorStyleBaseView( vtkInteractorStyleBaseView* interactorStyle);
- vtkInteractorStyleBaseView* GetInteractorStyleBaseView();
+ */
+ void SetInteractorStyleBaseView( vtkInteractorStyleImage* interactorStyle);
+ /* JCP 04/05/09
+ *
+ vtkInteractorStyleBaseView* GetInteractorStyleBaseView();
+ */
+ vtkInteractorStyleImage* GetInteractorStyleBaseView();
virtual void GetSpacing(double spc[3]);
private:
wxWindow *_parent;
wxVTKRenderWindowInteractor *_iren;
- vtkInteractorStyleBaseView *_interactorStyle;
+ /**
+ * JCP 04/05/09
+ * vtkInteractorStyleImage *_interactorStyle;
+ */
+ vtkInteractorStyleImage *_interactorStyle;
protected:
};
-
-
-//------------------------------------------------------------------
//------------------------------------------------------------------
//------------------------------------------------------------------
-
-class vtkInteractorStyleBaseView;
-class manualInteractorWindowLevel;
-class vtkInfoTextImage;
-class vtkInfoTextImageInteractor;
-
//------------------------------------------------------------------
-class creaMaracasVisu_EXPORT wxVtk2DBaseView: public wxVtkBaseView{
-public:
- wxVtk2DBaseView(wxWindow *parent);
- virtual ~wxVtk2DBaseView();
- virtual void Configure(bool okimage=true);
- vtkImageViewer2_XYZ* _imageViewer2XYZ;
- vtkBaseData* GetVtkBaseData();
- void SetVtkBaseData(vtkBaseData *vtkbasedata);
- virtual void Refresh();
- virtual void ResetView();
- virtual int GetActualSlice();
- virtual void SetActualSlice(int slice);
- void SetInteractorStyleImage(vtkInteractorStyleBaseView *interactorstylebaseview);
-
- virtual vtkRenderer* GetRenderer();
- virtual vtkRenderWindow* GetRenWin();
- virtual void TransformCoordinate_spacing_ViewToModel(double &X,double &Y, double &Z);
- virtual void TransformCoordinate_spacing_ModelToView(double &X,double &Y, double &Z);
- virtual void GetSpacing(double spc[3]);
-
-
-private:
- vtkBaseData *_vtkbasedata;
-
- vtkInfoTextImage *_vtkIinfoTextImage;
- vtkInfoTextImageInteractor *_vtkIinfoTextImageInteractor;
-
-protected:
-
-};
-
-
-
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-
-//------------------------------------------------------------------
-
-class creaMaracasVisu_EXPORT InteractorStyleMaracas
-{
-public:
- InteractorStyleMaracas();
- virtual ~InteractorStyleMaracas();
-
- virtual InteractorStyleMaracas * Clone();
- void CopyAttributesTo( InteractorStyleMaracas *cloneObject );
-
-
- virtual bool OnChar();
- virtual bool OnMouseMove();
- virtual bool OnLeftButtonDown();
- virtual bool OnLeftButtonUp();
- virtual bool OnMiddleButtonDown();
- virtual bool OnMiddleButtonUp();
- virtual bool OnRightButtonDown();
- virtual bool OnRightButtonUp();
-
- virtual bool OnLeftDClick();
- virtual bool OnRightDClick();
- virtual bool OnMiddleDClick();
- virtual bool OnMouseWheel();
-
-
- void SetVtkInteractorStyleBaseView(vtkInteractorStyleBaseView* _vtkInteractorStyleBaseView);
- void RemoveVtkInteractorStyleBaseView();
- void SetActive(bool active);
- bool GetActive();
-
-protected:
- vtkInteractorStyleBaseView* _vtkInteractorStyleBaseView;
-private:
- bool _active;
-};
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-
-
-class creaMaracasVisu_EXPORT manualInteractorWindowLevel : public InteractorStyleMaracas {
-public:
- manualInteractorWindowLevel();
- virtual ~manualInteractorWindowLevel();
-protected:
-
- bool _stateWindowLevel;
- int _backPx;
- int _backPy;
- int _backWindow;
- int _backLevel;
-
- virtual bool OnMouseMove();
- virtual bool OnMiddleButtonDown();
- virtual bool OnMiddleButtonUp();
-};
-
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-class vtkInfoTextImage{
-public:
- vtkInfoTextImage();
- ~vtkInfoTextImage();
- void SetWxVtk2DBaseView(wxVtk2DBaseView *wxvtk2Dbaseview);
- void SetMarImageData(marImageData *marimagedata);
- void Configure();
- void PutPixelIntensity(int x, int y, int z);
- void PutPosition(int x, int y, int z);
- void PutColorLevel();
- void PutWindowLevel();
-
-
-protected:
-private:
-
- marImageData *_marimagedata;
- wxVtk2DBaseView *_wxvtk2Dbaseview;
- vtkTextActor *_vtkText_WindowLevel;
- vtkTextActor *_vtkText_ColorLevel;
- vtkTextActor *_vtkText_position;
- vtkTextActor *_vtkText_pixelIntensity;
-
- vtkTextActor *Create_Text_Label(int px, int py);
-};
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-class vtkInfoTextImageInteractor : public InteractorStyleMaracas{
-public:
- vtkInfoTextImageInteractor();
- virtual ~vtkInfoTextImageInteractor();
- void SetModelVtkInfoTextImage(vtkInfoTextImage *vtkinfotextimage);
- vtkInfoTextImage *GetVtkInfoTextImage();
-
-protected:
-
- virtual bool OnMouseMove();
-
-private:
- vtkInfoTextImage *_vtkinfotextimage;
-};
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-class vtkInteractorScrollZ : public InteractorStyleMaracas {
-public:
- vtkInteractorScrollZ();
- virtual ~vtkInteractorScrollZ();
-
- virtual bool OnMouseMove();
- virtual bool OnRightButtonDown();
- virtual bool OnRightButtonUp();
-
-
-
-protected:
- bool _stateFordware;
- int _fordwareX;
- int _fordwareY;
- int _sliceZ;
-
-private:
-
-};
-
-
-
-
-
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-class wxVtk3DBaseView;
-
-class creaMaracasVisu_EXPORT vtkInteractorStyleBaseView : public vtkInteractorStyleImage{
-public:
- vtkInteractorStyleBaseView();
- ~vtkInteractorStyleBaseView();
- static vtkInteractorStyleBaseView *New();
- virtual void OnChar();
- virtual void OnMouseMove();
- virtual void OnLeftButtonDown();
- virtual void OnLeftButtonUp();
- virtual void OnMiddleButtonDown();
- virtual void OnMiddleButtonUp();
- virtual void OnRightButtonDown();
- virtual void OnRightButtonUp();
-
- virtual void OnLeftDClick();
- virtual void OnRightDClick();
- virtual void OnMiddleDClick();
- virtual void OnMouseWheel();
-
- virtual void TransformCoordinate(double &X, double &Y, double &Z);
- void AddInteractorStyleMaracas(InteractorStyleMaracas* interactorStyleMaracas);
- void RemoveInteractorStyleMaracas(InteractorStyleMaracas* interactorStyleMaracas);
- void InsertInteractorStyleMaracas(int pos, InteractorStyleMaracas* interactorStyleMaracas);
- void CallLstInteractorStyleMaracas(int type);
-
- wxVtk2DBaseView *GetWxVtk2DBaseView();
- wxVtk3DBaseView *GetWxVtk3DBaseView();
- void SetwxVtkBaseView(wxVtkBaseView *wxvtkbaseview);
- void SetActiveAllInteractors(bool ok);
-
- void SetRefresh_waiting();
- void SetParent_refresh_waiting();
-
- bool GetRefresh_waiting();
- bool GetParent_refresh_waiting();
-
-
- void EvaluateToRefresh();
- void BlockRefresh();
- void UnBlockRefresh();
-
-protected:
- std::vector< InteractorStyleMaracas* > _lstInteractorStyleMaracas;
-
-private:
- bool _blockRefresh;
- bool _refresh_waiting;
- bool _parent_refresh_waiting;
- wxVtkBaseView *_wxvtkbaseview;
-};
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-class creaMaracasVisu_EXPORT vtkInteractorStyleBaseView2D : public vtkInteractorStyleBaseView{
-public:
- vtkInteractorStyleBaseView2D();
- ~vtkInteractorStyleBaseView2D();
- static vtkInteractorStyleBaseView2D *New();
- virtual void OnMouseMove();
- virtual void OnLeftButtonDown();
- virtual void OnLeftButtonUp();
- virtual void OnMiddleButtonDown();
- virtual void OnMiddleButtonUp();
- virtual void OnRightButtonDown();
- virtual void OnRightButtonUp();
-
-
-protected:
-
-private:
- manualInteractorWindowLevel *_manualinteractorwindowlevel;
- vtkInteractorScrollZ *_vtkInteractorScrollZ;
-
-};
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-class creaMaracasVisu_EXPORT vtkInteractorStyleBaseView3D : public vtkInteractorStyleBaseView {
-public:
- vtkInteractorStyleBaseView3D();
- ~vtkInteractorStyleBaseView3D();
- static vtkInteractorStyleBaseView3D *New();
-
- virtual void OnMouseMove () ;
- virtual void OnLeftButtonDown ();
- virtual void OnLeftButtonUp () ;
- virtual void OnMiddleButtonDown ();
- virtual void OnMiddleButtonUp () ;
- virtual void OnRightButtonDown () ;
- virtual void OnRightButtonUp () ;
-
-private:
-
-};
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-
-class creaMaracasVisu_EXPORT wxVtk3DBaseView: public wxVtkBaseView{
-public:
- wxVtk3DBaseView( wxWindow *parent );
- virtual ~wxVtk3DBaseView();
- vtkCamera* GetCamera();
- virtual vtkRenderer* GetRenderer();
- virtual vtkRenderWindow* GetRenWin();
- void Refresh();
- void Configure();
- virtual void GetSpacing(double spc[3]);
-
-private:
- bool _configure;
- vtkRenderer *_aRenderer;
- vtkRenderWindow *_renWin;
- vtkCamera *_aCamera;
-protected:
-};
-
-
-
#endif // __WX_VTK__BASE__VIEW__H
-
-
-