]> Creatis software - creaMaracasVisu.git/commitdiff
set new image
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Thu, 5 Nov 2009 15:41:28 +0000 (15:41 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Thu, 5 Nov 2009 15:41:28 +0000 (15:41 +0000)
bbtk/src/bbmaracasvisuViewerNV.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx

index ae2c0c9d3b84410c21b349a89e5f78a1b65fb12f..435655ffb7853cd375eca3c8df2114d8819f328a 100644 (file)
@@ -76,7 +76,7 @@ void ViewerNV::Process()
                }else if (img != currentimg){           
                        mwxwidget->SetImage(img);
                        //mwxwidget->UpdateLayout(img);
-               }               
+               }
                currenttype = type;
                currentimg = img;
                
index d7db5b3248a9f3669aee87234d6040b8d656032d..6e901631511c9afa32e430cded6b3d68545b389d 100644 (file)
@@ -212,7 +212,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        }
                }
        
-               if (imagedata->GetScalarType()==VTK_CHAR)
+               else if (imagedata->GetScalarType()==VTK_CHAR)
                {
                        char *pOrg=(char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -220,7 +220,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%d",tmp);
                }
 
-               if (imagedata->GetScalarType()==VTK_SIGNED_CHAR)
+               else if (imagedata->GetScalarType()==VTK_SIGNED_CHAR)
                {
                        signed char *pOrg=(signed char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -228,7 +228,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%d",tmp);
                }
 
-               if (imagedata->GetScalarType()==VTK_UNSIGNED_CHAR)
+               else if (imagedata->GetScalarType()==VTK_UNSIGNED_CHAR)
                {
                        unsigned char *pOrg=(unsigned char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -236,7 +236,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%d",tmp);
                }
 
-               if (imagedata->GetScalarType()==VTK_SHORT)
+               else if (imagedata->GetScalarType()==VTK_SHORT)
                {
                        short *pOrg=(short*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -244,7 +244,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%d",tmp);
                }
 
-               if (imagedata->GetScalarType()==VTK_UNSIGNED_SHORT)
+               else if (imagedata->GetScalarType()==VTK_UNSIGNED_SHORT)
                {
                        unsigned short *pOrg=(unsigned short*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -252,14 +252,14 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%d",tmp);
                }
        
-               if (imagedata->GetScalarType()==VTK_INT)
+               else if (imagedata->GetScalarType()==VTK_INT)
                {
                        int *pOrg=(int*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
                        sprintf(zTzxt,"%d",*pOrg);
                }
 
-               if (imagedata->GetScalarType()==VTK_UNSIGNED_INT)
+               else if (imagedata->GetScalarType()==VTK_UNSIGNED_INT)
                {
                        unsigned int *pOrg=(unsigned int*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -267,7 +267,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%d",tmp);
                }
 
-               if (imagedata->GetScalarType()==VTK_LONG)
+               else if (imagedata->GetScalarType()==VTK_LONG)
                {
                        long *pOrg=(long*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -275,7 +275,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%3.2f",tmp);
                }
 
-               if (imagedata->GetScalarType()==VTK_UNSIGNED_LONG)
+               else if (imagedata->GetScalarType()==VTK_UNSIGNED_LONG)
                {
                        unsigned long *pOrg=(unsigned long*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -283,7 +283,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%3.2f",tmp);
                }
 
-               if (imagedata->GetScalarType()==VTK_FLOAT)
+               else if (imagedata->GetScalarType()==VTK_FLOAT)
                {
                        float *pOrg=(float*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
@@ -291,7 +291,7 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
                        sprintf(zTzxt,"%3.2f",tmp);
                }
 
-               if (imagedata->GetScalarType()==VTK_DOUBLE)
+               else if (imagedata->GetScalarType()==VTK_DOUBLE)
                {
                        double *pOrg=(double*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
        //              itoa (*pOrg,zTzxt,10);
index fa26572f836005c976c57b10cc5bea4c9cd68c40..18bdf5ac83534fa7bc754a2c3c72e19dfc918a8d 100644 (file)
@@ -154,13 +154,16 @@ void wxVtk2DBaseView::Configure(bool okimage)
                        camera->SetParallelScale( spx*(x2-x1)/3.0 );
                        
                        // text information over the graphic window
-                       _vtkIinfoTextImage              = new vtkInfoTextImage();
-                       _vtkIinfoTextImageInteractor    = new vtkInfoTextImageInteractor();
+                       if(_vtkIinfoTextImage == NULL){
+                               _vtkIinfoTextImage              = new vtkInfoTextImage();
+                               _vtkIinfoTextImageInteractor    = new vtkInfoTextImageInteractor();                             
+                               ((vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView())->AddInteractorStyleMaracas(_vtkIinfoTextImageInteractor);
+                       }
                        _vtkIinfoTextImage->SetWxVtk2DBaseView(this);
                        _vtkIinfoTextImage->SetMarImageData( GetVtkBaseData()->GetMarImageData() );
-                       _vtkIinfoTextImageInteractor->SetModelVtkInfoTextImage(_vtkIinfoTextImage);     
+                       _vtkIinfoTextImageInteractor->SetModelVtkInfoTextImage(_vtkIinfoTextImage);                             
                        _vtkIinfoTextImage->Configure();
-                       ((vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView())->AddInteractorStyleMaracas(_vtkIinfoTextImageInteractor);
+                       
                } // okimage
        } // imageData
 
index 2163d69de9a5be80a0f129d68621af2bd42dee97..7632ba2a798995be18786ddca6b3c5222e1e5188 100644 (file)
@@ -19,6 +19,7 @@ wxVtkMPR2DView::wxVtkMPR2DView( wxWindow *parent, int direction)
        _lineBActor             = NULL;
        _lineBMapper    = NULL;
        _pdB                    = NULL;
+       _interactorstylemprview = NULL;
 }
 
 //-------------------------------------------------------------------
@@ -42,8 +43,13 @@ vtkMPRBaseData *wxVtkMPR2DView::GetVtkmprbasedata()
 void wxVtkMPR2DView::Configure(){
        wxVtk2DBaseView::Configure();
 
-       _interactorstylemprview = new vtkInteractorStyleMPRView();
-       ((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _interactorstylemprview );
+       if(_interactorstylemprview==NULL)       
+       {
+               _interactorstylemprview = new vtkInteractorStyleMPRView();
+               ((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _interactorstylemprview );
+       }
+       
+       
 
        int x1,x2,y1,y2,z1,z2;
        GetVtkmprbasedata()     -> GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);