]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
5fbab3eedb7363684bccf1e2054e18cc5a9efda5
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVtkMPR2DView.cxx
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #include "wxVtkMPR2DView.h"
27
28 #include "vtkInteractorStyleBaseView.h"
29
30 #include "vtkCellArray.h"
31 #include "vtkImageActor.h"
32
33 #ifdef WIN32
34 #include <mathdefs.h>
35 using namespace gtm;
36 #endif
37
38 wxVtkMPR2DView::wxVtkMPR2DView( wxWindow *parent, int direction)
39  :wxVtk2DBaseView(parent)
40 {
41         _backX                  = -99999;
42         _backY                  = -99999;
43         _backZ                  = -99999;
44         _direction              = direction;
45         _ptsA                   = NULL;
46         _lineAActor             = NULL;
47         _lineAMapper    = NULL;
48         _pdA                    = NULL;
49         _ptsB                   = NULL;
50         _lineBActor             = NULL;
51         _lineBMapper    = NULL;
52         _pdB                    = NULL;
53         _interactorstylemprview = NULL;
54 }
55
56 //-------------------------------------------------------------------
57 wxVtkMPR2DView::~wxVtkMPR2DView()
58 {
59         if (_ptsA!=NULL)            { _ptsA                 -> Delete(); }
60         if (_lineAActor!=NULL)  { _lineAActor   -> Delete(); }
61         if (_lineAMapper!=NULL) { _lineAMapper  -> Delete(); }
62         if (_pdA!=NULL)             { _pdA                  -> Delete(); }
63         if (_ptsB!=NULL)            { _ptsB                 -> Delete(); }
64         if (_lineBActor!=NULL)  { _lineBActor   -> Delete(); }
65         if (_lineBMapper!=NULL) { _lineBMapper  -> Delete(); }
66         if (_pdB!=NULL)             { _pdB                  -> Delete(); }
67 }
68 //-------------------------------------------------------------------
69 vtkMPRBaseData *wxVtkMPR2DView::GetVtkmprbasedata()
70 {
71         return (vtkMPRBaseData*)GetVtkBaseData();
72 }
73 //-------------------------------------------------------------------
74 void wxVtkMPR2DView::Configure()
75 {
76         wxVtk2DBaseView::Configure();
77         int x1,x2,y1,y2,z1,z2;
78         GetVtkmprbasedata()     -> GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
79         double spc[3];
80         vtkImageData* img =  GetVtkmprbasedata()->GetImageData();
81         if(_interactorstylemprview==NULL)
82         {
83                 _interactorstylemprview = new vtkInteractorStyleMPRView();
84                 ((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _interactorstylemprview );
85         }
86
87         if(img!=NULL){
88                 double* origin = img->GetOrigin();
89                 img->GetExtent(x1,x2,y1,y2,z1,z2);
90                 img->GetSpacing(spc);
91                 x1 += origin[0];
92                 x2 += origin[0];
93                 y1 += origin[1];
94                 y2 += origin[1];
95                 z1 += origin[2];
96                 z2 += origin[2];
97                 x1 = (int)(x1*spc[0]);
98                 y1 = (int)(y1*spc[1]);
99                 z1 = (int)(z1*spc[2]);
100
101                 x2 = (int)(x2*spc[0]);
102                 y2 = (int)(y2*spc[1]);
103                 z2 = (int)(z2*spc[2]);
104
105                 _visibleAxis = true;
106         }
107
108         // Axe A
109         if(_lineAActor==NULL){
110                 _lineAActor = vtkActor::New();
111                 _lineAActor->GetProperty()->SetDiffuseColor(1,0,0);
112                 _lineAActor->GetProperty()->SetLineWidth(0.5);
113
114                 _ptsA = vtkPoints::New();
115                 _ptsA->SetNumberOfPoints(2);
116                 _ptsA->SetPoint(0, -1000        , -1000 , -1000 );
117                 _ptsA->SetPoint(1,  1000        ,  1000 ,  1000 );
118                 _pdA = vtkPolyData::New();
119                 _lineAMapper = vtkPolyDataMapper::New();
120                 _lineAMapper->SetInput(_pdA);
121                 _lineAMapper->ImmediateModeRenderingOn();
122                 _lineAActor->SetMapper(_lineAMapper);
123         }
124
125         vtkCellArray *linesA = vtkCellArray::New();
126         linesA->InsertNextCell(2);
127         linesA->InsertCellPoint(0);
128         linesA->InsertCellPoint(1);
129         _pdA->SetPoints( _ptsA );
130         _pdA->SetLines( linesA );
131         linesA->Delete();  //do not delete lines ??
132 //              _lineAActor->GetProperty()->BackfaceCullingOn();
133
134
135 // Axe B
136         if(_lineBActor==NULL){
137                 _lineBActor                                             =       vtkActor::New();
138                 _lineBActor->GetProperty()->SetDiffuseColor(1,0,0);
139                 _lineBActor->GetProperty()->SetLineWidth(0.5);
140                 _lineBMapper                                    =       vtkPolyDataMapper::New();
141                 _lineBActor->SetMapper(_lineBMapper);
142                 _ptsB = vtkPoints::New();
143                 _ptsB->SetNumberOfPoints(2);
144                 _ptsB->SetPoint(0, -1000        , -1000 , -1000 );
145                 _ptsB->SetPoint(1,  1000        ,  1000 ,  1000 );
146 //              _lineBActor->GetProperty()->BackfaceCullingOn();
147         }
148
149         vtkCellArray *linesB;
150         linesB = vtkCellArray::New();
151         linesB->InsertNextCell(2);
152         linesB->InsertCellPoint(0);
153         linesB->InsertCellPoint(1);
154         _pdB = vtkPolyData::New();
155         _pdB->SetPoints( _ptsB );
156         _pdB->SetLines( linesB );
157         linesB->Delete();  //do not delete lines ??
158         _lineBMapper->SetInput(_pdB);
159         _lineBMapper->ImmediateModeRenderingOn();
160         if(_imageViewer2XYZ){
161                 _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
162                 _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor );
163                 vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera();
164
165         //EED 17Avril2009
166     //EED 21 mars 2012  FLIP problem  ..PLOP..
167
168                 if (_direction==0) {  // YZ
169                         camera->SetViewUp               (   0   ,    0          ,     1         );
170                         camera->SetPosition             ( 10000,(y1+y2)/2       , (z1+z2)/2     );
171                         camera->SetFocalPoint   (   0   , (y1+y2)/2     , (z1+z2)/2     );
172                         camera->SetParallelScale( (z2-z1)/3.0 );
173                 }
174
175                 if (_direction==1) { // XZ
176                         camera->SetViewUp               (       0               ,       0       ,       1               );
177                         camera->SetPosition             ((x1+x2)/2      , -10000        , (z1+z2)/2     );
178                         camera->SetFocalPoint   ((x1+x2)/2      ,   0   , (z1+z2)/2     );
179                         camera->SetParallelScale( (x2-x1)/3.0 );
180                 }
181
182                 if (_direction==2) {  // XY
183                         camera->SetViewUp               (       0               ,       -1              ,       0       );
184                         camera->SetPosition             ((x1+x2)/2      , (y1+y2)/2     , -10000);
185                         camera->SetFocalPoint   ((x1+x2)/2      , (y1+y2)/2     ,       0       );
186                         camera->SetParallelScale( (x2-x1)/3.0 );
187                 }
188
189 /*
190                 if (_direction==0) {    // YZ
191                         camera->SetViewUp               (   0   ,     1         ,     0         );
192                         camera->SetPosition             (  10000,(y1+y2)/2      , (z1+z2)/2     );
193                         camera->SetFocalPoint   (   0   , (y1+y2)/2     , (z1+z2)/2     );
194                         camera->SetParallelScale( (z2-z1)/3.0 );
195                 }
196
197                 if (_direction==1) {    // XZ
198                         camera->SetViewUp               (       0               ,       0       ,       -1              );
199                         camera->SetPosition             ((x1+x2)/2      , 10000 , (z1+z2)/2     );
200                         camera->SetFocalPoint   ((x1+x2)/2      ,   0   , (z1+z2)/2     );
201                         camera->SetParallelScale( (x2-x1)/3.0 );
202                 }
203
204                 if (_direction==2) {    // XY
205                         camera->SetViewUp               (       0               ,       1               ,       0       );
206                         camera->SetPosition             ((x1+x2)/2      , (y1+y2)/2     ,  10000);
207                         camera->SetFocalPoint   ((x1+x2)/2      , (y1+y2)/2     ,       0       );
208                         camera->SetParallelScale( (x2-x1)/3.0 );
209                 }
210 */
211
212         //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow (160);
213         //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel (800);
214         }
215 }
216
217 void wxVtkMPR2DView::SetVisibleAxis(bool ok)
218 {
219         if (ok!=_visibleAxis)
220         {
221                 _visibleAxis=ok;
222                 if (_visibleAxis==true)
223                 {
224                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
225                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor );
226                 }
227                 if (_visibleAxis==false)
228                 {
229                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->RemoveActor( _lineAActor );
230                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->RemoveActor( _lineBActor );
231                 }
232
233         }
234 }
235
236 //-------------------------------------------------------------------
237 void wxVtkMPR2DView::Refresh()
238 {
239         //wxVtk2DBaseView::Refresh();
240         int x1 = 0,x2 = 0,y1 = 0,y2 = 0,z1 = 0,z2 = 0;
241
242 //EED 02/08/2013
243 //      int x = 0, y = 0, z = 0;
244         double x = 0, y = 0, z = 0;
245
246         int xx = 0, yy = 0, zz = 0;
247         double *spc     = 0;
248         double *origin  = 0;
249         
250         double xx1,yy1,zz1,xx2,yy2,zz2;
251         
252         vtkImageData* img = GetVtkmprbasedata()->GetImageData();
253         if(img!=NULL){
254                 origin = img->GetOrigin();
255                 img->GetExtent(x1,x2,y1,y2,z1,z2);
256                 spc = img->GetSpacing();
257                 x1 += origin[0];
258                 x2 += origin[0];
259                 y1 += origin[1];
260                 y2 += origin[1];
261                 z1 += origin[2];
262                 z2 += origin[2];
263                 
264                 xx1 =           x1*spc[0];
265                 yy1 =           y1*spc[1];
266                 zz1 =           z1*spc[2];
267                 
268                 xx2 =           x2*spc[0];
269                 yy2 =           y2*spc[1];
270                 zz2 =           z2*spc[2];
271                 
272                 x1 = (int)(x1*spc[0]);
273                 y1 = (int)(y1*spc[1]);
274                 z1 = (int)(z1*spc[2]);
275                 
276                 x2      = (int)(x2*spc[0]);
277                 y2      = (int)(y2*spc[1]);
278                 z2      = (int)(z2*spc[2]);
279
280                 xx = (int)(GetVtkmprbasedata()->GetX());
281                 yy = (int)(GetVtkmprbasedata()->GetY());
282                 zz = (int)(GetVtkmprbasedata()->GetZ());
283
284 //EED 02/08/2013
285 //              x =  round(xx*spc[0]);
286 //              y =  round(yy*spc[1]);
287 //              z =  round(zz*spc[2]);
288
289                 x =  xx*spc[0];
290                 y =  yy*spc[1];
291                 z =  zz*spc[2];
292
293
294                 if ((xx!=_backX) || (yy!=_backY) || (zz!=_backZ)) {
295
296                         if (_direction==0) {    // YZ
297                                 if(_imageViewer2XYZ)
298                                 {
299                                         _imageViewer2XYZ->SetXSlice( (int)(GetVtkmprbasedata()->GetX()) );
300                                 }
301 //EED 21 mars 2012  FLIP probleme  ..PLOP..
302                                 //_ptsA->SetPoint(0, x2, y1  , z );
303                                 //_ptsA->SetPoint(1, x2, y2  , z );
304                                 //_ptsB->SetPoint(0, x2, y   , z1);
305                                 //_ptsB->SetPoint(1, x2, y   , z2);
306                                 _ptsA->SetPoint(0, xx2, yy1  , z  );
307                                 _ptsA->SetPoint(1, xx2, yy2  , z  );
308                                 _ptsB->SetPoint(0, xx2, y    , zz1);
309                                 _ptsB->SetPoint(1, xx2, y    , zz2);
310                         }
311                         if (_direction==1) {    // XZ
312                                 if(_imageViewer2XYZ)
313                                 {
314                                         _imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) );
315                                 }
316 //EED 21 mars 2012  FLIP probleme  ..PLOP..
317                             //_ptsA->SetPoint(0, x1 , y2 , z );
318                                 //_ptsA->SetPoint(1, x2 , y2 , z );
319                                 //_ptsB->SetPoint(0, x  , y2 , z1);
320                                 //_ptsB->SetPoint(1, x  , y2 , z2);
321                             _ptsA->SetPoint(0, xx1 , y1 , z  );
322                                 _ptsA->SetPoint(1, xx2 , y1 , z  );
323                                 _ptsB->SetPoint(0, x   , y1 , zz1);
324                                 _ptsB->SetPoint(1, x   , y1 , zz2);
325                         }
326                         if (_direction==2) {    // XY
327                                 if(_imageViewer2XYZ)
328                                 {
329                                         _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) );
330                                 }
331                         //      _ptsA->SetPoint(0, x1 , y , -z2 );
332                         //      _ptsA->SetPoint(1, x2 , y , -z2 );
333                         //      _ptsB->SetPoint(0, x  , y1, -z2 );
334                         //      _ptsB->SetPoint(1, x  , y2, -z2 );
335
336                                 
337 //EED 21 mars 2012  FLIP probleme  ..PLOP..
338                                 //_ptsA->SetPoint(0, x1 , y , z2 );
339                                 //_ptsA->SetPoint(1, x2 , y , z2 );
340                                 //_ptsB->SetPoint(0, x  , y1, z2 );
341                                 //_ptsB->SetPoint(1, x  , y2, z2 );
342                                 
343                                 _ptsA->SetPoint(0, xx1 , y  , z1 );
344                                 _ptsA->SetPoint(1, xx2 , y  , z1 );
345                                 _ptsB->SetPoint(0, x   , yy1, z1 );
346                                 _ptsB->SetPoint(1, x   , yy2, z1 );
347                                 
348                                 
349                         }
350                         _backX=xx;
351                         _backY=yy;
352                         _backZ=zz;
353                 }
354
355
356 //EED 2016/02/19
357         vtkImageActor *imageactor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor();
358         imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() );
359
360 //EED 01nov2012
361                 UpdateColorWindowLevel();
362                 wxVtkBaseView::Refresh();
363         }
364 }
365 //-------------------------------------------------------------------
366 int wxVtkMPR2DView::GetActualSlice()   // virtual
367 {
368         int result;
369         if (_direction==0)
370         {
371                 result = (int)(GetVtkmprbasedata()->GetX());
372         }
373         if (_direction==1)
374         {
375                 result = (int)(GetVtkmprbasedata()->GetY());
376         }
377         if (_direction==2)
378         {
379                 result = (int)(GetVtkmprbasedata()->GetZ());
380         }
381         return result;
382 }
383 //-------------------------------------------------------------------
384 void wxVtkMPR2DView::SetActualSlice(int slice)   // virtual
385 {
386         if (_direction==0)
387         {
388                 GetVtkmprbasedata()->SetX(slice);
389         }
390         if (_direction==1)
391         {
392                 GetVtkmprbasedata()->SetY(slice);
393         }
394         if (_direction==2)
395         {
396                 GetVtkmprbasedata()->SetZ(slice);
397         }
398 }
399 //-------------------------------------------------------------------
400 bool wxVtkMPR2DView::IfMouseTouchX(double x, double y, double z)
401 {
402         double delta=5;
403         bool result=false;
404         if (_direction==0)
405         {
406         }
407         if (_direction==1)
408         {
409                 if (( x<GetVtkmprbasedata()->GetX()+delta ) && ( x>GetVtkmprbasedata()->GetX()-delta ))
410                 {
411                         result = true;
412                 }
413         }
414         if (_direction==2)
415         {
416                 if (( x<GetVtkmprbasedata()->GetX()+delta ) && ( x>GetVtkmprbasedata()->GetX()-delta ))
417                 {
418                         result = true;
419                 }
420         }
421         return result;
422 }
423 //-------------------------------------------------------------------
424 bool wxVtkMPR2DView::IfMouseTouchY(double x, double y, double z)
425 {
426         double delta=5;
427         bool result=false;
428         if (_direction==0)
429         {
430                 if (( y<GetVtkmprbasedata()->GetY()+delta ) && ( y>GetVtkmprbasedata()->GetY()-delta ))
431                 {
432                         result = true;
433                 }
434         }
435         if (_direction==1)
436         {
437         }
438         if (_direction==2)
439         {
440                 if (( y<GetVtkmprbasedata()->GetY()+delta ) && ( y>GetVtkmprbasedata()->GetY()-delta ))
441                 {
442                         result = true;
443                 }
444         }
445         return result;
446 }
447 //-------------------------------------------------------------------
448 bool wxVtkMPR2DView::IfMouseTouchZ(double x, double y, double z)
449 {
450         double delta=5;
451         bool result=false;
452         if (_direction==0)
453         {
454                 if (( z<GetVtkmprbasedata()->GetZ()+delta ) && ( z>GetVtkmprbasedata()->GetZ()-delta ))
455                 {
456                         result = true;
457                 }
458         }
459         if (_direction==1)
460         {
461                 if (( z<GetVtkmprbasedata()->GetZ()+delta ) && ( z>GetVtkmprbasedata()->GetZ()-delta ))
462                 {
463                         result = true;
464                 }
465         }
466         if (_direction==2)
467         {
468         }
469         return result;
470 }
471 //-------------------------------------------------------------------
472 void wxVtkMPR2DView::MoveX(double x, double y, double z)
473 {
474         if (_direction==0)
475         {
476         }
477         if (_direction==1)
478         {
479                 GetVtkmprbasedata()->SetX(x);
480         }
481         if (_direction==2)
482         {
483                 GetVtkmprbasedata()->SetX(x);
484         }
485 }
486 //-------------------------------------------------------------------
487 void wxVtkMPR2DView::MoveY(double x, double y, double z)
488 {
489         if (_direction==0)
490         {
491                 GetVtkmprbasedata()->SetY(y);
492         }
493         if (_direction==1)
494         {
495         }
496         if (_direction==2)
497         {
498                 GetVtkmprbasedata()->SetY(y);
499         }
500 }
501 //-------------------------------------------------------------------
502 void wxVtkMPR2DView::MoveZ(double x, double y, double z)
503 {
504         if (_direction==0)
505         {
506                 GetVtkmprbasedata()->SetZ(z);
507         }
508         if (_direction==1)
509         {
510                 GetVtkmprbasedata()->SetZ(z);
511         }
512         if (_direction==2)
513         {
514         }
515 }
516 //-------------------------------------------------------------------
517 void wxVtkMPR2DView::ChangeAxisColor(double x, double y, double z)
518 {
519         double c1r=1,c1g=1,c1b=0;
520         double c2r=1,c2g=0,c2b=0;
521
522         if (_direction==0)
523         {
524                 if (IfMouseTouchY(x,y,z)==true)
525                 {
526                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
527                 } else {
528                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
529                 }
530                 if (IfMouseTouchZ(x,y,z)==true)
531                 {
532                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
533                 } else {
534                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
535                 }
536         }
537
538         if (_direction==1)
539         {
540                 if (IfMouseTouchX(x,y,z)==true)
541                 {
542                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
543                 } else {
544                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
545                 }
546                 if (IfMouseTouchZ(x,y,z)==true)
547                 {
548                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
549                 } else {
550                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
551                 }
552         }
553
554         if (_direction==2)
555         {
556                 if (IfMouseTouchX(x,y,z)==true)
557                 {
558                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
559                 } else {
560                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
561                 }
562                 if (IfMouseTouchY(x,y,z)==true)
563                 {
564                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
565                 } else {
566                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
567                 }
568         }
569         Refresh();
570 }
571
572
573 //EED 5 juin 2009
574 //void wxVtkMPR2DView::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) // virtual
575 void wxVtkMPR2DView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection, int type) //virtual //keepNormalDirection=false, type=2
576 {
577
578         wxVtkBaseView::TransFromCoordScreenToWorld(X,Y,Z,keepNormalDirection,_direction);
579
580         if ((_direction==0) && (keepNormalDirection==true) )
581         {
582                 X = ((vtkMPRBaseData*)GetVtkBaseData())->GetX();
583         }
584
585         if ((_direction==1) && (keepNormalDirection==true) )
586         {
587                 Y = ((vtkMPRBaseData*)GetVtkBaseData())->GetY();
588         }
589
590         if ((_direction==2) && (keepNormalDirection==true) )
591         {
592                 Z = ((vtkMPRBaseData*)GetVtkBaseData())->GetZ();
593         }
594
595 }
596
597 //-------------------------------------------------------------------
598 int wxVtkMPR2DView::GetDirection() // virtual
599 {
600     return _direction;
601 }
602
603
604 //-------------------------------------------------------------------
605 //-------------------------------------------------------------------
606 //-------------------------------------------------------------------
607 //void boxVolumeObserver::Execute(vtkObject *wdg, unsigned long eventId, void* calldata) {  // virtual
608 //      if (eventId==vtkCommand::StartInteractionEvent){
609 //              _renWin->SetDesiredUpdateRate(10);
610 //      }
611 //      if (eventId==vtkCommand::InteractionEvent){
612 //              _renWin->SetDesiredUpdateRate(0.001);
613 //      }
614 //      if (eventId==vtkCommand::EndInteractionEvent){
615 //              vtkPlanes *planes = vtkPlanes::New();
616 //              vtkBoxWidget *boxwidget = reinterpret_cast<vtkBoxWidget*>(wdg);
617 //              boxwidget->GetPlanes(planes);
618 //              _volumeMapper->SetClippingPlanes(planes);
619 //              planes -> Delete();
620 //      }
621 //}
622
623 //-------------------------------------------------------------------
624 //void boxVolumeObserver::SetRenWin( vtkRenderWindow *renWin ){
625 //      _renWin = renWin;
626 //}
627 //-------------------------------------------------------------------
628 //void boxVolumeObserver::SetVolumeMapper(vtkVolumeRayCastMapper *volumeMapper){
629 //      _volumeMapper = volumeMapper;
630 //}