]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
#3019 creaMaracasVisu Bug New Normal Windows MPR2D refresh
[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                 x2 = (int)(x2*spc[0]);
101                 y2 = (int)(y2*spc[1]);
102                 z2 = (int)(z2*spc[2]);
103                 _visibleAxis = true;
104         }
105
106         // Axe A
107         if(_lineAActor==NULL){
108                 _lineAActor = vtkActor::New();
109                 _lineAActor->GetProperty()->SetDiffuseColor(1,0,0);
110                 _lineAActor->GetProperty()->SetLineWidth(0.5);
111
112                 _ptsA = vtkPoints::New();
113                 _ptsA->SetNumberOfPoints(2);
114                 _ptsA->SetPoint(0, -1000        , -1000 , -1000 );
115                 _ptsA->SetPoint(1,  1000        ,  1000 ,  1000 );
116                 _pdA = vtkPolyData::New();
117                 _lineAMapper = vtkPolyDataMapper::New();
118                 _lineAMapper->SetInput(_pdA);
119                 _lineAMapper->ImmediateModeRenderingOn();
120                 _lineAActor->SetMapper(_lineAMapper);
121         }
122
123         vtkCellArray *linesA = vtkCellArray::New();
124         linesA->InsertNextCell(2);
125         linesA->InsertCellPoint(0);
126         linesA->InsertCellPoint(1);
127         _pdA->SetPoints( _ptsA );
128         _pdA->SetLines( linesA );
129         linesA->Delete();  //do not delete lines ??
130 //              _lineAActor->GetProperty()->BackfaceCullingOn();
131
132
133 // Axe B
134         if(_lineBActor==NULL){
135                 _lineBActor                                             =       vtkActor::New();
136                 _lineBActor->GetProperty()->SetDiffuseColor(1,0,0);
137                 _lineBActor->GetProperty()->SetLineWidth(0.5);
138                 _lineBMapper                                    =       vtkPolyDataMapper::New();
139                 _lineBActor->SetMapper(_lineBMapper);
140                 _ptsB = vtkPoints::New();
141                 _ptsB->SetNumberOfPoints(2);
142                 _ptsB->SetPoint(0, -1000        , -1000 , -1000 );
143                 _ptsB->SetPoint(1,  1000        ,  1000 ,  1000 );
144 //              _lineBActor->GetProperty()->BackfaceCullingOn();
145         }
146
147         vtkCellArray *linesB;
148         linesB = vtkCellArray::New();
149         linesB->InsertNextCell(2);
150         linesB->InsertCellPoint(0);
151         linesB->InsertCellPoint(1);
152         _pdB = vtkPolyData::New();
153         _pdB->SetPoints( _ptsB );
154         _pdB->SetLines( linesB );
155         linesB->Delete();  //do not delete lines ??
156         _lineBMapper->SetInput(_pdB);
157         _lineBMapper->ImmediateModeRenderingOn();
158         if(_imageViewer2XYZ){
159                 _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
160                 _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor );
161                 vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera();
162
163         //EED 17Avril2009
164     //EED 21 mars 2012  FLIP problem  ..PLOP..
165
166                 if (_direction==0) {  // YZ
167                         camera->SetViewUp               (   0   ,    0          ,     1         );
168                         camera->SetPosition             ( 10000,(y1+y2)/2       , (z1+z2)/2     );
169                         camera->SetFocalPoint   (   0   , (y1+y2)/2     , (z1+z2)/2     );
170                         camera->SetParallelScale( (z2-z1)/3.0 );
171                 }
172
173                 if (_direction==1) { // XZ
174                         camera->SetViewUp               (       0               ,       0       ,       1               );
175                         camera->SetPosition             ((x1+x2)/2      , -10000        , (z1+z2)/2     );
176                         camera->SetFocalPoint   ((x1+x2)/2      ,   0   , (z1+z2)/2     );
177                         camera->SetParallelScale( (x2-x1)/3.0 );
178                 }
179
180                 if (_direction==2) {  // XY
181                         camera->SetViewUp               (       0               ,       -1              ,       0       );
182                         camera->SetPosition             ((x1+x2)/2      , (y1+y2)/2     , -10000);
183                         camera->SetFocalPoint   ((x1+x2)/2      , (y1+y2)/2     ,       0       );
184                         camera->SetParallelScale( (x2-x1)/3.0 );
185                 }
186
187 /*
188                 if (_direction==0) {    // YZ
189                         camera->SetViewUp               (   0   ,     1         ,     0         );
190                         camera->SetPosition             (  10000,(y1+y2)/2      , (z1+z2)/2     );
191                         camera->SetFocalPoint   (   0   , (y1+y2)/2     , (z1+z2)/2     );
192                         camera->SetParallelScale( (z2-z1)/3.0 );
193                 }
194
195                 if (_direction==1) {    // XZ
196                         camera->SetViewUp               (       0               ,       0       ,       -1              );
197                         camera->SetPosition             ((x1+x2)/2      , 10000 , (z1+z2)/2     );
198                         camera->SetFocalPoint   ((x1+x2)/2      ,   0   , (z1+z2)/2     );
199                         camera->SetParallelScale( (x2-x1)/3.0 );
200                 }
201
202                 if (_direction==2) {    // XY
203                         camera->SetViewUp               (       0               ,       1               ,       0       );
204                         camera->SetPosition             ((x1+x2)/2      , (y1+y2)/2     ,  10000);
205                         camera->SetFocalPoint   ((x1+x2)/2      , (y1+y2)/2     ,       0       );
206                         camera->SetParallelScale( (x2-x1)/3.0 );
207                 }
208 */
209
210         //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow (160);
211         //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel (800);
212         }
213 }
214
215 void wxVtkMPR2DView::SetVisibleAxis(bool ok)
216 {
217         if (ok!=_visibleAxis)
218         {
219                 _visibleAxis=ok;
220                 if (_visibleAxis==true)
221                 {
222                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
223                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor );
224                 }
225                 if (_visibleAxis==false)
226                 {
227                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->RemoveActor( _lineAActor );
228                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->RemoveActor( _lineBActor );
229                 }
230
231         }
232 }
233
234 //-------------------------------------------------------------------
235 void wxVtkMPR2DView::Refresh()
236 {
237         //wxVtk2DBaseView::Refresh();
238         int x1 = 0,x2 = 0,y1 = 0,y2 = 0,z1 = 0,z2 = 0;
239
240 //EED 02/08/2013
241 //      int x = 0, y = 0, z = 0;
242         double x = 0, y = 0, z = 0;
243
244         int xx = 0, yy = 0, zz = 0;
245         double *spc     = 0;
246         double *origin  = 0;
247         
248         double xx1,yy1,zz1,xx2,yy2,zz2;
249         
250         vtkImageData* img = GetVtkmprbasedata()->GetImageData();
251         if(img!=NULL){
252                 origin = img->GetOrigin();
253                 img->GetExtent(x1,x2,y1,y2,z1,z2);
254                 spc = img->GetSpacing();
255                 x1 += origin[0];
256                 x2 += origin[0];
257                 y1 += origin[1];
258                 y2 += origin[1];
259                 z1 += origin[2];
260                 z2 += origin[2];
261                 
262                 xx1 =           x1*spc[0];
263                 yy1 =           y1*spc[1];
264                 zz1 =           z1*spc[2];
265                 
266                 xx2 =           x2*spc[0];
267                 yy2 =           y2*spc[1];
268                 zz2 =           z2*spc[2];
269                 
270                 x1 = (int)(x1*spc[0]);
271                 y1 = (int)(y1*spc[1]);
272                 z1 = (int)(z1*spc[2]);
273                 
274                 x2      = (int)(x2*spc[0]);
275                 y2      = (int)(y2*spc[1]);
276                 z2      = (int)(z2*spc[2]);
277
278                 xx = (int)(GetVtkmprbasedata()->GetX());
279                 yy = (int)(GetVtkmprbasedata()->GetY());
280                 zz = (int)(GetVtkmprbasedata()->GetZ());
281
282 //EED 02/08/2013
283 //              x =  round(xx*spc[0]);
284 //              y =  round(yy*spc[1]);
285 //              z =  round(zz*spc[2]);
286
287                 x =  xx*spc[0];
288                 y =  yy*spc[1];
289                 z =  zz*spc[2];
290
291
292                 if ((xx!=_backX) || (yy!=_backY) || (zz!=_backZ)  ) {
293                         if (_direction==0) {    // YZ
294                                 if(_imageViewer2XYZ)
295                                 {
296                                         _imageViewer2XYZ->SetXSlice( (int)(GetVtkmprbasedata()->GetX()) );
297                                 }
298 //EED 21 mars 2012  FLIP probleme  ..PLOP..
299                                 //_ptsA->SetPoint(0, x2, y1  , z );
300                                 //_ptsA->SetPoint(1, x2, y2  , z );
301                                 //_ptsB->SetPoint(0, x2, y   , z1);
302                                 //_ptsB->SetPoint(1, x2, y   , z2);
303                                 _ptsA->SetPoint(0, xx2, yy1  , z  );
304                                 _ptsA->SetPoint(1, xx2, yy2  , z  );
305                                 _ptsB->SetPoint(0, xx2, y    , zz1);
306                                 _ptsB->SetPoint(1, xx2, y    , zz2);
307                         }
308                         if (_direction==1) {    // XZ
309                                 if(_imageViewer2XYZ)
310                                 {
311                                         _imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) );
312                                 }
313 //EED 21 mars 2012  FLIP probleme  ..PLOP..
314                             //_ptsA->SetPoint(0, x1 , y2 , z );
315                                 //_ptsA->SetPoint(1, x2 , y2 , z );
316                                 //_ptsB->SetPoint(0, x  , y2 , z1);
317                                 //_ptsB->SetPoint(1, x  , y2 , z2);
318                             _ptsA->SetPoint(0, xx1 , y1 , z  );
319                                 _ptsA->SetPoint(1, xx2 , y1 , z  );
320                                 _ptsB->SetPoint(0, x   , y1 , zz1);
321                                 _ptsB->SetPoint(1, x   , y1 , zz2);
322                         }
323                         if (_direction==2) {    // XY
324                                 if(_imageViewer2XYZ)
325                                 {
326                                         _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) );
327                                 }
328                         //      _ptsA->SetPoint(0, x1 , y , -z2 );
329                         //      _ptsA->SetPoint(1, x2 , y , -z2 );
330                         //      _ptsB->SetPoint(0, x  , y1, -z2 );
331                         //      _ptsB->SetPoint(1, x  , y2, -z2 );
332
333                                 
334 //EED 21 mars 2012  FLIP probleme  ..PLOP..
335                                 //_ptsA->SetPoint(0, x1 , y , z2 );
336                                 //_ptsA->SetPoint(1, x2 , y , z2 );
337                                 //_ptsB->SetPoint(0, x  , y1, z2 );
338                                 //_ptsB->SetPoint(1, x  , y2, z2 );
339                                 
340                                 _ptsA->SetPoint(0, xx1 , y  , z1 );
341                                 _ptsA->SetPoint(1, xx2 , y  , z1 );
342                                 _ptsB->SetPoint(0, x   , yy1, z1 );
343                                 _ptsB->SetPoint(1, x   , yy2, z1 );
344                                 
345                                 
346                         }
347                         _backX=xx;
348                         _backY=yy;
349                         _backZ=zz;
350                 }
351 //EED 2016/02/19
352         vtkImageActor *imageactor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor();
353         imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() );
354 //EED 01nov2012
355                 UpdateColorWindowLevel();
356                 wxVtkBaseView::Refresh();
357         }
358 }
359
360 //-------------------------------------------------------------------
361 int wxVtkMPR2DView::GetActualSlice()   // virtual
362 {
363         int result;
364         if (_direction==0)
365         {
366                 result = (int)(GetVtkmprbasedata()->GetX());
367         }
368         if (_direction==1)
369         {
370                 result = (int)(GetVtkmprbasedata()->GetY());
371         }
372         if (_direction==2)
373         {
374                 result = (int)(GetVtkmprbasedata()->GetZ());
375         }
376         return result;
377 }
378 //-------------------------------------------------------------------
379 void wxVtkMPR2DView::SetActualSlice(int slice)   // virtual
380 {
381         if (_direction==0)
382         {
383                 GetVtkmprbasedata()->SetX(slice);
384         }
385         if (_direction==1)
386         {
387                 GetVtkmprbasedata()->SetY(slice);
388         }
389         if (_direction==2)
390         {
391                 GetVtkmprbasedata()->SetZ(slice);
392         }
393 }
394 //-------------------------------------------------------------------
395 bool wxVtkMPR2DView::IfMouseTouchX(double x, double y, double z)
396 {
397         double delta=5;
398         bool result=false;
399         if (_direction==0)
400         {
401         }
402         if (_direction==1)
403         {
404                 if (( x<GetVtkmprbasedata()->GetX()+delta ) && ( x>GetVtkmprbasedata()->GetX()-delta ))
405                 {
406                         result = true;
407                 }
408         }
409         if (_direction==2)
410         {
411                 if (( x<GetVtkmprbasedata()->GetX()+delta ) && ( x>GetVtkmprbasedata()->GetX()-delta ))
412                 {
413                         result = true;
414                 }
415         }
416         return result;
417 }
418 //-------------------------------------------------------------------
419 bool wxVtkMPR2DView::IfMouseTouchY(double x, double y, double z)
420 {
421         double delta=5;
422         bool result=false;
423         if (_direction==0)
424         {
425                 if (( y<GetVtkmprbasedata()->GetY()+delta ) && ( y>GetVtkmprbasedata()->GetY()-delta ))
426                 {
427                         result = true;
428                 }
429         }
430         if (_direction==1)
431         {
432         }
433         if (_direction==2)
434         {
435                 if (( y<GetVtkmprbasedata()->GetY()+delta ) && ( y>GetVtkmprbasedata()->GetY()-delta ))
436                 {
437                         result = true;
438                 }
439         }
440         return result;
441 }
442 //-------------------------------------------------------------------
443 bool wxVtkMPR2DView::IfMouseTouchZ(double x, double y, double z)
444 {
445         double delta=5;
446         bool result=false;
447         if (_direction==0)
448         {
449                 if (( z<GetVtkmprbasedata()->GetZ()+delta ) && ( z>GetVtkmprbasedata()->GetZ()-delta ))
450                 {
451                         result = true;
452                 }
453         }
454         if (_direction==1)
455         {
456                 if (( z<GetVtkmprbasedata()->GetZ()+delta ) && ( z>GetVtkmprbasedata()->GetZ()-delta ))
457                 {
458                         result = true;
459                 }
460         }
461         if (_direction==2)
462         {
463         }
464         return result;
465 }
466 //-------------------------------------------------------------------
467 void wxVtkMPR2DView::MoveX(double x, double y, double z)
468 {
469         if (_direction==0)
470         {
471         }
472         if (_direction==1)
473         {
474                 GetVtkmprbasedata()->SetX(x);
475         }
476         if (_direction==2)
477         {
478                 GetVtkmprbasedata()->SetX(x);
479         }
480 }
481 //-------------------------------------------------------------------
482 void wxVtkMPR2DView::MoveY(double x, double y, double z)
483 {
484         if (_direction==0)
485         {
486                 GetVtkmprbasedata()->SetY(y);
487         }
488         if (_direction==1)
489         {
490         }
491         if (_direction==2)
492         {
493                 GetVtkmprbasedata()->SetY(y);
494         }
495 }
496 //-------------------------------------------------------------------
497 void wxVtkMPR2DView::MoveZ(double x, double y, double z)
498 {
499         if (_direction==0)
500         {
501                 GetVtkmprbasedata()->SetZ(z);
502         }
503         if (_direction==1)
504         {
505                 GetVtkmprbasedata()->SetZ(z);
506         }
507         if (_direction==2)
508         {
509         }
510 }
511 //-------------------------------------------------------------------
512 void wxVtkMPR2DView::ChangeAxisColor(double x, double y, double z)
513 {
514         double c1r=1,c1g=1,c1b=0;
515         double c2r=1,c2g=0,c2b=0;
516
517         if (_direction==0)
518         {
519                 if (IfMouseTouchY(x,y,z)==true)
520                 {
521                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
522                 } else {
523                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
524                 }
525                 if (IfMouseTouchZ(x,y,z)==true)
526                 {
527                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
528                 } else {
529                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
530                 }
531         }
532
533         if (_direction==1)
534         {
535                 if (IfMouseTouchX(x,y,z)==true)
536                 {
537                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
538                 } else {
539                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
540                 }
541                 if (IfMouseTouchZ(x,y,z)==true)
542                 {
543                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
544                 } else {
545                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
546                 }
547         }
548
549         if (_direction==2)
550         {
551                 if (IfMouseTouchX(x,y,z)==true)
552                 {
553                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
554                 } else {
555                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
556                 }
557                 if (IfMouseTouchY(x,y,z)==true)
558                 {
559                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
560                 } else {
561                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
562                 }
563         }
564         Refresh();
565 }
566
567
568 //EED 5 juin 2009
569 //void wxVtkMPR2DView::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) // virtual
570 void wxVtkMPR2DView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection, int type) //virtual //keepNormalDirection=false, type=2
571 {
572
573         wxVtkBaseView::TransFromCoordScreenToWorld(X,Y,Z,keepNormalDirection,_direction);
574
575         if ((_direction==0) && (keepNormalDirection==true) )
576         {
577                 X = ((vtkMPRBaseData*)GetVtkBaseData())->GetX();
578         }
579
580         if ((_direction==1) && (keepNormalDirection==true) )
581         {
582                 Y = ((vtkMPRBaseData*)GetVtkBaseData())->GetY();
583         }
584
585         if ((_direction==2) && (keepNormalDirection==true) )
586         {
587                 Z = ((vtkMPRBaseData*)GetVtkBaseData())->GetZ();
588         }
589
590 }
591
592 //-------------------------------------------------------------------
593 int wxVtkMPR2DView::GetDirection() // virtual
594 {
595     return _direction;
596 }
597
598
599 //-------------------------------------------------------------------
600 //-------------------------------------------------------------------
601 //-------------------------------------------------------------------
602 //void boxVolumeObserver::Execute(vtkObject *wdg, unsigned long eventId, void* calldata) {  // virtual
603 //      if (eventId==vtkCommand::StartInteractionEvent){
604 //              _renWin->SetDesiredUpdateRate(10);
605 //      }
606 //      if (eventId==vtkCommand::InteractionEvent){
607 //              _renWin->SetDesiredUpdateRate(0.001);
608 //      }
609 //      if (eventId==vtkCommand::EndInteractionEvent){
610 //              vtkPlanes *planes = vtkPlanes::New();
611 //              vtkBoxWidget *boxwidget = reinterpret_cast<vtkBoxWidget*>(wdg);
612 //              boxwidget->GetPlanes(planes);
613 //              _volumeMapper->SetClippingPlanes(planes);
614 //              planes -> Delete();
615 //      }
616 //}
617
618 //-------------------------------------------------------------------
619 //void boxVolumeObserver::SetRenWin( vtkRenderWindow *renWin ){
620 //      _renWin = renWin;
621 //}
622 //-------------------------------------------------------------------
623 //void boxVolumeObserver::SetVolumeMapper(vtkVolumeRayCastMapper *volumeMapper){
624 //      _volumeMapper = volumeMapper;
625 //}