]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
Support #1768 CREATIS Licence insertion
[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 #ifdef WIN32
32 #include <mathdefs.h>
33 using namespace gtm;
34 #endif
35
36 wxVtkMPR2DView::wxVtkMPR2DView( wxWindow *parent, int direction)
37  :wxVtk2DBaseView(parent)
38 {
39         _backX                  = -99999;
40         _backY                  = -99999;
41         _backZ                  = -99999;
42         _direction              = direction;
43         _ptsA                   = NULL;
44         _lineAActor             = NULL;
45         _lineAMapper    = NULL;
46         _pdA                    = NULL;
47         _ptsB                   = NULL;
48         _lineBActor             = NULL;
49         _lineBMapper    = NULL;
50         _pdB                    = NULL;
51         _interactorstylemprview = NULL;
52 }
53
54 //-------------------------------------------------------------------
55 wxVtkMPR2DView::~wxVtkMPR2DView()
56 {
57         if (_ptsA!=NULL)            { _ptsA                 -> Delete(); }
58         if (_lineAActor!=NULL)  { _lineAActor   -> Delete(); }
59         if (_lineAMapper!=NULL) { _lineAMapper  -> Delete(); }
60         if (_pdA!=NULL)             { _pdA                  -> Delete(); }
61         if (_ptsB!=NULL)            { _ptsB                 -> Delete(); }
62         if (_lineBActor!=NULL)  { _lineBActor   -> Delete(); }
63         if (_lineBMapper!=NULL) { _lineBMapper  -> Delete(); }
64         if (_pdB!=NULL)             { _pdB                  -> Delete(); }
65 }
66 //-------------------------------------------------------------------
67 vtkMPRBaseData *wxVtkMPR2DView::GetVtkmprbasedata()
68 {
69         return (vtkMPRBaseData*)GetVtkBaseData();
70 }
71 //-------------------------------------------------------------------
72 void wxVtkMPR2DView::Configure()
73 {
74         wxVtk2DBaseView::Configure();
75         int x1,x2,y1,y2,z1,z2;
76         GetVtkmprbasedata()     -> GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
77         double spc[3];
78         vtkImageData* img =  GetVtkmprbasedata()->GetImageData();
79         if(_interactorstylemprview==NULL)
80         {
81                 _interactorstylemprview = new vtkInteractorStyleMPRView();
82                 ((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _interactorstylemprview );
83         }
84
85         if(img!=NULL){
86                 double* origin = img->GetOrigin();
87                 img->GetExtent(x1,x2,y1,y2,z1,z2);
88                 img->GetSpacing(spc);
89                 x1 += origin[0];
90                 x2 += origin[0];
91                 y1 += origin[1];
92                 y2 += origin[1];
93                 z1 += origin[2];
94                 z2 += origin[2];
95                 x1 = (int)(x1*spc[0]);
96                 y1 = (int)(y1*spc[1]);
97                 z1 = (int)(z1*spc[2]);
98
99                 x2 = (int)(x2*spc[0]);
100                 y2 = (int)(y2*spc[1]);
101                 z2 = (int)(z2*spc[2]);
102
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         int x = 0, y = 0, z = 0;
240         int xx = 0, yy = 0, zz = 0;
241         double *spc     = 0;
242         double *origin  = 0;
243         
244         double xx1,yy1,zz1,xx2,yy2,zz2;
245         
246         vtkImageData* img = GetVtkmprbasedata()->GetImageData();
247         if(img!=NULL){
248                 origin = img->GetOrigin();
249                 img->GetExtent(x1,x2,y1,y2,z1,z2);
250                 spc = img->GetSpacing();
251                 x1 += origin[0];
252                 x2 += origin[0];
253                 y1 += origin[1];
254                 y2 += origin[1];
255                 z1 += origin[2];
256                 z2 += origin[2];
257                 
258                 xx1 =           x1*spc[0];
259                 yy1 =           y1*spc[1];
260                 zz1 =           z1*spc[2];
261                 
262                 xx2 =           x2*spc[0];
263                 yy2 =           y2*spc[1];
264                 zz2 =           z2*spc[2];
265                 
266                 x1 = (int)(x1*spc[0]);
267                 y1 = (int)(y1*spc[1]);
268                 z1 = (int)(z1*spc[2]);
269                 
270                 x2      = (int)(x2*spc[0]);
271                 y2      = (int)(y2*spc[1]);
272                 z2      = (int)(z2*spc[2]);
273
274                 xx = (int)(GetVtkmprbasedata()->GetX());
275                 yy = (int)(GetVtkmprbasedata()->GetY());
276                 zz = (int)(GetVtkmprbasedata()->GetZ());
277
278                 x =  round(xx*spc[0]);
279                 y =  round(yy*spc[1]);
280                 z =  round(zz*spc[2]);
281                 
282                 if ((xx!=_backX) || (yy!=_backY) || (zz!=_backZ)) {
283
284                         if (_direction==0) {    // YZ
285                                 if(_imageViewer2XYZ)
286                                 {
287                                         _imageViewer2XYZ->SetXSlice( (int)(GetVtkmprbasedata()->GetX()) );
288                                 }
289 //EED 21 mars 2012  FLIP probleme  ..PLOP..
290                                 //_ptsA->SetPoint(0, x2, y1  , z );
291                                 //_ptsA->SetPoint(1, x2, y2  , z );
292                                 //_ptsB->SetPoint(0, x2, y   , z1);
293                                 //_ptsB->SetPoint(1, x2, y   , z2);
294                                 _ptsA->SetPoint(0, xx2, yy1  , z  );
295                                 _ptsA->SetPoint(1, xx2, yy2  , z  );
296                                 _ptsB->SetPoint(0, xx2, y    , zz1);
297                                 _ptsB->SetPoint(1, xx2, y    , zz2);
298                         }
299                         if (_direction==1) {    // XZ
300                                 if(_imageViewer2XYZ)
301                                 {
302                                         _imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) );
303                                 }
304 //EED 21 mars 2012  FLIP probleme  ..PLOP..
305                             //_ptsA->SetPoint(0, x1 , y2 , z );
306                                 //_ptsA->SetPoint(1, x2 , y2 , z );
307                                 //_ptsB->SetPoint(0, x  , y2 , z1);
308                                 //_ptsB->SetPoint(1, x  , y2 , z2);
309                             _ptsA->SetPoint(0, xx1 , y1 , z  );
310                                 _ptsA->SetPoint(1, xx2 , y1 , z  );
311                                 _ptsB->SetPoint(0, x   , y1 , zz1);
312                                 _ptsB->SetPoint(1, x   , y1 , zz2);
313                         }
314                         if (_direction==2) {    // XY
315                                 if(_imageViewer2XYZ)
316                                 {
317                                         _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) );
318                                 }
319                         //      _ptsA->SetPoint(0, x1 , y , -z2 );
320                         //      _ptsA->SetPoint(1, x2 , y , -z2 );
321                         //      _ptsB->SetPoint(0, x  , y1, -z2 );
322                         //      _ptsB->SetPoint(1, x  , y2, -z2 );
323
324                                 
325 //EED 21 mars 2012  FLIP probleme  ..PLOP..
326                                 //_ptsA->SetPoint(0, x1 , y , z2 );
327                                 //_ptsA->SetPoint(1, x2 , y , z2 );
328                                 //_ptsB->SetPoint(0, x  , y1, z2 );
329                                 //_ptsB->SetPoint(1, x  , y2, z2 );
330                                 
331                                 _ptsA->SetPoint(0, xx1 , y  , z1 );
332                                 _ptsA->SetPoint(1, xx2 , y  , z1 );
333                                 _ptsB->SetPoint(0, x   , yy1, z1 );
334                                 _ptsB->SetPoint(1, x   , yy2, z1 );
335                                 
336                                 
337                         }
338                         _backX=xx;
339                         _backY=yy;
340                         _backZ=zz;
341                 }
342
343 //EED 01nov2012
344                 UpdateColorWindowLevel();
345                 wxVtkBaseView::Refresh();
346         }
347 }
348 //-------------------------------------------------------------------
349 int wxVtkMPR2DView::GetActualSlice()   // virtual
350 {
351         int result;
352         if (_direction==0)
353         {
354                 result = (int)(GetVtkmprbasedata()->GetX());
355         }
356         if (_direction==1)
357         {
358                 result = (int)(GetVtkmprbasedata()->GetY());
359         }
360         if (_direction==2)
361         {
362                 result = (int)(GetVtkmprbasedata()->GetZ());
363         }
364         return result;
365 }
366 //-------------------------------------------------------------------
367 void wxVtkMPR2DView::SetActualSlice(int slice)   // virtual
368 {
369         if (_direction==0)
370         {
371                 GetVtkmprbasedata()->SetX(slice);
372         }
373         if (_direction==1)
374         {
375                 GetVtkmprbasedata()->SetY(slice);
376         }
377         if (_direction==2)
378         {
379                 GetVtkmprbasedata()->SetZ(slice);
380         }
381 }
382 //-------------------------------------------------------------------
383 bool wxVtkMPR2DView::IfMouseTouchX(double x, double y, double z)
384 {
385         double delta=5;
386         bool result=false;
387         if (_direction==0)
388         {
389         }
390         if (_direction==1)
391         {
392                 if (( x<GetVtkmprbasedata()->GetX()+delta ) && ( x>GetVtkmprbasedata()->GetX()-delta ))
393                 {
394                         result = true;
395                 }
396         }
397         if (_direction==2)
398         {
399                 if (( x<GetVtkmprbasedata()->GetX()+delta ) && ( x>GetVtkmprbasedata()->GetX()-delta ))
400                 {
401                         result = true;
402                 }
403         }
404         return result;
405 }
406 //-------------------------------------------------------------------
407 bool wxVtkMPR2DView::IfMouseTouchY(double x, double y, double z)
408 {
409         double delta=5;
410         bool result=false;
411         if (_direction==0)
412         {
413                 if (( y<GetVtkmprbasedata()->GetY()+delta ) && ( y>GetVtkmprbasedata()->GetY()-delta ))
414                 {
415                         result = true;
416                 }
417         }
418         if (_direction==1)
419         {
420         }
421         if (_direction==2)
422         {
423                 if (( y<GetVtkmprbasedata()->GetY()+delta ) && ( y>GetVtkmprbasedata()->GetY()-delta ))
424                 {
425                         result = true;
426                 }
427         }
428         return result;
429 }
430 //-------------------------------------------------------------------
431 bool wxVtkMPR2DView::IfMouseTouchZ(double x, double y, double z)
432 {
433         double delta=5;
434         bool result=false;
435         if (_direction==0)
436         {
437                 if (( z<GetVtkmprbasedata()->GetZ()+delta ) && ( z>GetVtkmprbasedata()->GetZ()-delta ))
438                 {
439                         result = true;
440                 }
441         }
442         if (_direction==1)
443         {
444                 if (( z<GetVtkmprbasedata()->GetZ()+delta ) && ( z>GetVtkmprbasedata()->GetZ()-delta ))
445                 {
446                         result = true;
447                 }
448         }
449         if (_direction==2)
450         {
451         }
452         return result;
453 }
454 //-------------------------------------------------------------------
455 void wxVtkMPR2DView::MoveX(double x, double y, double z)
456 {
457         if (_direction==0)
458         {
459         }
460         if (_direction==1)
461         {
462                 GetVtkmprbasedata()->SetX(x);
463         }
464         if (_direction==2)
465         {
466                 GetVtkmprbasedata()->SetX(x);
467         }
468 }
469 //-------------------------------------------------------------------
470 void wxVtkMPR2DView::MoveY(double x, double y, double z)
471 {
472         if (_direction==0)
473         {
474                 GetVtkmprbasedata()->SetY(y);
475         }
476         if (_direction==1)
477         {
478         }
479         if (_direction==2)
480         {
481                 GetVtkmprbasedata()->SetY(y);
482         }
483 }
484 //-------------------------------------------------------------------
485 void wxVtkMPR2DView::MoveZ(double x, double y, double z)
486 {
487         if (_direction==0)
488         {
489                 GetVtkmprbasedata()->SetZ(z);
490         }
491         if (_direction==1)
492         {
493                 GetVtkmprbasedata()->SetZ(z);
494         }
495         if (_direction==2)
496         {
497         }
498 }
499 //-------------------------------------------------------------------
500 void wxVtkMPR2DView::ChangeAxisColor(double x, double y, double z)
501 {
502         double c1r=1,c1g=1,c1b=0;
503         double c2r=1,c2g=0,c2b=0;
504
505         if (_direction==0)
506         {
507                 if (IfMouseTouchY(x,y,z)==true)
508                 {
509                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
510                 } else {
511                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
512                 }
513                 if (IfMouseTouchZ(x,y,z)==true)
514                 {
515                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
516                 } else {
517                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
518                 }
519         }
520
521         if (_direction==1)
522         {
523                 if (IfMouseTouchX(x,y,z)==true)
524                 {
525                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
526                 } else {
527                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
528                 }
529                 if (IfMouseTouchZ(x,y,z)==true)
530                 {
531                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
532                 } else {
533                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
534                 }
535         }
536
537         if (_direction==2)
538         {
539                 if (IfMouseTouchX(x,y,z)==true)
540                 {
541                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
542                 } else {
543                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
544                 }
545                 if (IfMouseTouchY(x,y,z)==true)
546                 {
547                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
548                 } else {
549                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
550                 }
551         }
552         Refresh();
553 }
554
555
556 //EED 5 juin 2009
557 //void wxVtkMPR2DView::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) // virtual
558 void wxVtkMPR2DView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection, int type) //virtual //keepNormalDirection=false, type=2
559 {
560
561         wxVtkBaseView::TransFromCoordScreenToWorld(X,Y,Z,keepNormalDirection,_direction);
562
563         if ((_direction==0) && (keepNormalDirection==true) )
564         {
565                 X = ((vtkMPRBaseData*)GetVtkBaseData())->GetX();
566         }
567
568         if ((_direction==1) && (keepNormalDirection==true) )
569         {
570                 Y = ((vtkMPRBaseData*)GetVtkBaseData())->GetY();
571         }
572
573         if ((_direction==2) && (keepNormalDirection==true) )
574         {
575                 Z = ((vtkMPRBaseData*)GetVtkBaseData())->GetZ();
576         }
577
578 }
579
580 //-------------------------------------------------------------------
581 int wxVtkMPR2DView::GetDirection() // virtual
582 {
583     return _direction;
584 }
585
586
587 //-------------------------------------------------------------------
588 //-------------------------------------------------------------------
589 //-------------------------------------------------------------------
590 //void boxVolumeObserver::Execute(vtkObject *wdg, unsigned long eventId, void* calldata) {  // virtual
591 //      if (eventId==vtkCommand::StartInteractionEvent){
592 //              _renWin->SetDesiredUpdateRate(10);
593 //      }
594 //      if (eventId==vtkCommand::InteractionEvent){
595 //              _renWin->SetDesiredUpdateRate(0.001);
596 //      }
597 //      if (eventId==vtkCommand::EndInteractionEvent){
598 //              vtkPlanes *planes = vtkPlanes::New();
599 //              vtkBoxWidget *boxwidget = reinterpret_cast<vtkBoxWidget*>(wdg);
600 //              boxwidget->GetPlanes(planes);
601 //              _volumeMapper->SetClippingPlanes(planes);
602 //              planes -> Delete();
603 //      }
604 //}
605
606 //-------------------------------------------------------------------
607 //void boxVolumeObserver::SetRenWin( vtkRenderWindow *renWin ){
608 //      _renWin = renWin;
609 //}
610 //-------------------------------------------------------------------
611 //void boxVolumeObserver::SetVolumeMapper(vtkVolumeRayCastMapper *volumeMapper){
612 //      _volumeMapper = volumeMapper;
613 //}