]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 26 Jun 2008 07:37:04 +0000 (07:37 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 26 Jun 2008 07:37:04 +0000 (07:37 +0000)
kernel/src/bbtkWxBlackBox.cxx
kernel/src/bbtkWxGUITextEditor.cxx
packages/vtk/bbs/appli/ExampleGaussianSmooth.bbs
packages/vtk/bbs/appli/ExampleGaussianSmooth_02.bbs [new file with mode: 0644]
packages/vtk/doc/bbdoc/ExampleGaussianSmooth.JPG [new file with mode: 0644]
packages/vtk/doc/bbdoc/ExampleGaussianSmooth_02.JPG [new file with mode: 0644]
packages/wx/src/bbwxColourSelector.cxx
packages/wx/src/bbwxCommandButton.cxx
packages/wx/src/bbwxFileSelector.cxx
packages/wx/src/bbwxFileSelector.h
packages/wxvtk/src/bbwxvtkViewer2D.cxx

index 781d025850ac84431b22e70779d299bc0e23d4ad..8f523029b5d2e52539ddfcd6057a9a331a3a1f0e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/05/15 08:02:36 $
-  Version:   $Revision: 1.20 $
+  Date:      $Date: 2008/06/26 07:37:04 $
+  Version:   $Revision: 1.21 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -226,13 +226,14 @@ namespace bbtk
     bbtkDebugMessage("wx",5,"WxBlackBoxFrame::bbShow("
                     <<bbGetBlackBox()->bbGetFullName()<<")"<<std::endl);
     WxBlackBoxWindow::bbShow();
-    wxFrame::Show();
+  wxFrame::Show();
     // This Update is ** MANDATORY ** 
     // to synchronize wxvtkRenderWindowInteractor objects
     // (force wx objects creation **NOW**)
+    wxFrame::Refresh();
     wxFrame::Update();
+    wxFrame::SetFocus();
     if (bbGetBlackBox()) bbGetBlackBox()->bbUserOnShow();
-    //    wxFrame::SetFocus();
   }
   //=========================================================================
 
index b1f95b4af9449dbd116d9402c1d25b2baccdd0d0..c8baa3759153c030615743deed9a036be936bca1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUITextEditor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/05/14 12:32:26 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2008/06/26 07:37:05 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -189,8 +189,11 @@ namespace bbtk
        wxFileDialog* fd = new wxFileDialog(this,_T("Save file"),_T(""),
                                            _T(""),std2wx(filter),
                                            wxSAVE | wxOVERWRITE_PROMPT );
-       fd->ShowModal();
+       int result_fd = fd->ShowModal();
     
+       // This line is need it by windows // EED
+       fd->SetReturnCode( result_fd );
+
        if (fd->GetReturnCode()==wxID_OK)
          {
            mName = wx2std(fd->GetPath());
@@ -432,8 +435,11 @@ namespace bbtk
     wxFileDialog* fd = new wxFileDialog(this,_T("Open file"),_T(""),
                                        _T(""),std2wx(mFileNameFilter),
                                        wxOPEN | wxFILE_MUST_EXIST );
-    fd->ShowModal();
-    
+    int result_fd = fd->ShowModal();
+
+       // This line is need it by windows //EED
+       fd->SetReturnCode( result_fd );
+
     if (fd->GetReturnCode()==wxID_OK)
       {
        std::string filename = wx2std(fd->GetPath());
index 8fb2da9a747e3f97d8c8506f1cd989e17599a3dd..83283414831bffb19bdafb3b9bb342cb889cba12 100644 (file)
@@ -1,5 +1,5 @@
 print "=== GaussianSmooth box example ==="
-description "GaussianSmooth box example"
+description "GaussianSmooth box example.  Screenshot : <img src=ExampleGaussianSmooth.jpg></img>"
 author "eduardo.davila at creatis.insa-lyon.fr"
 category "example"
 
diff --git a/packages/vtk/bbs/appli/ExampleGaussianSmooth_02.bbs b/packages/vtk/bbs/appli/ExampleGaussianSmooth_02.bbs
new file mode 100644 (file)
index 0000000..9d587b0
--- /dev/null
@@ -0,0 +1,63 @@
+print "=== GaussianSmooth_02 box example ==="
+description "GaussianSmooth Save box.  Screenshot : <img src=ExampleGaussianSmooth_02.jpg></img>"
+author "eduardo.davila at creatis.insa-lyon.fr"
+category "example"
+
+include wx
+include itk
+include vtk
+include wxvtk
+include itkvtk
+
+new FileSelector fileselectoropen
+  set fileselectoropen.OpenSave "Open" 
+  
+new ImageReader imagereader
+  connect fileselectoropen.Out imagereader.Filename
+
+new Viewer2D viewerleft
+  connect imagereader.Out viewerleft.In
+  
+new Slider slidersmooth
+  set slidersmooth.In 1
+  set slidersmooth.Max 10
+  set slidersmooth.Title "Gaussian smooth "
+    
+new ImageGaussianSmooth smooth
+  connect imagereader.Out smooth.In
+  connect slidersmooth.Out smooth.StdDevX
+  connect slidersmooth.Out smooth.StdDevY
+  connect slidersmooth.Out smooth.StdDevZ
+  connect slidersmooth.BoxChange smooth.BoxExecute
+  
+new Viewer2D viewerright
+  connect smooth.Out viewerright.In
+  connect slidersmooth.BoxChange viewerright.BoxExecute
+  
+new LayoutLine layoutlineviwer
+   set layoutlineviwer.Orientation H
+   connect viewerleft.Widget layoutlineviwer.Widget1
+   connect viewerright.Widget layoutlineviwer.Widget2
+
+new FileSelector fileselectorsave
+  set fileselectorsave.OpenSave "Save" 
+   
+new ImageWriter imagewrite
+    connect smooth.Out imagewrite.In   
+    connect fileselectorsave.Out imagewrite.Filename   
+       
+new CommandButton btnSave
+   set btnSave.Label "Save smooth"   
+   connect btnSave.BoxChange fileselectorsave.BoxExecute 
+   connect btnSave.BoxChange imagewrite.BoxExecute 
+
+new LayoutLine layoutline
+   connect slidersmooth.Widget layoutline.Widget1
+   connect btnSave.Widget layoutline.Widget2
+   
+new LayoutSplit main   
+   connect layoutlineviwer.Widget main.Widget1
+   connect layoutline.Widget main.Widget2
+   
+   
+exec main   
\ No newline at end of file
diff --git a/packages/vtk/doc/bbdoc/ExampleGaussianSmooth.JPG b/packages/vtk/doc/bbdoc/ExampleGaussianSmooth.JPG
new file mode 100644 (file)
index 0000000..8ffc87a
Binary files /dev/null and b/packages/vtk/doc/bbdoc/ExampleGaussianSmooth.JPG differ
diff --git a/packages/vtk/doc/bbdoc/ExampleGaussianSmooth_02.JPG b/packages/vtk/doc/bbdoc/ExampleGaussianSmooth_02.JPG
new file mode 100644 (file)
index 0000000..4f38aea
Binary files /dev/null and b/packages/vtk/doc/bbdoc/ExampleGaussianSmooth_02.JPG differ
index 9b03e2d85c14785143d5bba8dacf3dd0a2205bfc..80cfe680e8d871bbbfa804bacf116c07fae8c192 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxColourSelector.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:52 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2008/06/26 07:37:11 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -43,7 +43,11 @@ namespace bbwx
                           <<bbGetFullName()<<"]"<<std::endl);
 
       wxColourDialog *colordialog = new wxColourDialog( 0 );
-      colordialog->ShowModal();
+      int result_colordialog = colordialog->ShowModal();
+
+       // This line is need it by windows // EED
+       colordialog->SetReturnCode( result_colordialog );
+
       if (colordialog->GetReturnCode()==wxID_OK)
       {
          char col[100];
index aeea2152e8e346e1150336ae1f39bd94faf64e61..5cff6c8615f250d69752a41eb5720c7115466a55 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxCommandButton.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/05/15 08:02:37 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2008/06/26 07:37:11 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 
   l'Image). All rights reserved. See Doc/License.txt or
@@ -51,7 +51,7 @@ namespace bbwx
             &CommandButtonWidget::OnCommandButton ); 
     
     wxFlexGridSizer *sizer     = new wxFlexGridSizer(1);
-    sizer -> Add( mwxCommandButton,1,wxGROW ); 
+    sizer -> Add( mwxCommandButton,1,wxGROW | wxALL,10 ); 
     sizer      -> AddGrowableCol(0);
     
     panel      -> SetSizer(sizer);
@@ -161,9 +161,9 @@ namespace bbwx
     bbSetInputIn("");
     bbSetInputLabel("");
     std::vector<double> lstColour;
-    lstColour.push_back(-1);
-    lstColour.push_back(-1);
-    lstColour.push_back(-1);
+    lstColour.push_back(0.75);
+    lstColour.push_back(0.75);
+    lstColour.push_back(0.75);
     bbSetInputColour(lstColour);
   }
   
index 4a049c54c1f4785b886e51c34355f29faa9f3c91..0c6c66ac57016dbf0f7fee72bc563ec9ca6d050c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxFileSelector.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:52 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/06/26 07:37:11 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -68,9 +68,13 @@ namespace bbwx
                                         bbtk::std2wx(wc),
                                         style,
                                         wxDefaultPosition);
+//EED
+
+    int result_FD = FD->ShowModal();
+
+       // This line is need it by windows //EED
+       FD->SetReturnCode( result_FD );
 
-    FD->ShowModal();
-    
     if (FD->GetReturnCode()==wxID_OK)
       {
        bbSetOutputOut( bbtk::wx2std (FD->GetPath()) );
@@ -84,6 +88,12 @@ namespace bbwx
   }
   
 
+  void FileSelector::bbUserConstructor()
+  {
+         bbSetInputOpenSave("Open");
+  }
+       
+
 
 }//namespace bbtk
 
index 051754b165aa242469ae72db3b4de2b3d6bc7a0a..f483a243ccfaef4330e7ccbddff80a41684ed5e9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxFileSelector.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:52 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2008/06/26 07:37:11 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -59,6 +59,10 @@ namespace bbwx
     BBTK_DECLARE_OUTPUT(Out,std::string);
     BBTK_PROCESS(Process);
     void Process();
+
+  protected:
+    virtual void bbUserConstructor();
+
   };
   //=================================================================
   
index bfd066f277843e2b840cac91b4ed7401041937d9..6cf958807a7ac6f646a7b24f40b9566e7b7631a2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxvtkViewer2D.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/06/25 15:36:19 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2008/06/26 07:37:18 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -177,26 +177,26 @@ namespace bbwxvtk
        (backImageData!=NULL)&&
        (mBox->bbIsShown()))
     {
-       int z = mBox->bbGetInputSlice();
-       //      std::cout << "slice = "<<z<<std::endl;
-       int ext[6];
-       backImageData->GetWholeExtent(ext);
+               int z = mBox->bbGetInputSlice();
+               //      std::cout << "slice = "<<z<<std::endl;
+               int ext[6];
+               backImageData->GetWholeExtent(ext);
 
-       //      std::cout << "ext = "<<ext[4]<<" - "<<ext[5]<<std::endl;
+               //      std::cout << "ext = "<<ext[4]<<" - "<<ext[5]<<std::endl;
 
-       if (z<ext[4]) { z=ext[4]; }
-       if (z>ext[5]) { z=ext[5]; }
+               if (z<ext[4]) { z=ext[4]; }
+               if (z>ext[5]) { z=ext[5]; }
 
 
-#if (VTK_MAJOR_VERSION >= 5)
-       imageViewer->SetSlice( z );
-#else
-       imageViewer->SetZSlice( z );
-#endif
+       #if (VTK_MAJOR_VERSION >= 5)
+               imageViewer->SetSlice( z );
+       #else
+               imageViewer->SetZSlice( z );
+       #endif
 
-       //imageViewer->UpdateDisplayExtent();
-    wxvtkrenderwindowinteractor->Render();
-    imageViewer->GetRenderer()->ResetCameraClippingRange();
+               //imageViewer->UpdateDisplayExtent();
+       //      wxvtkrenderwindowinteractor->Render();
+               imageViewer->GetRenderer()->ResetCameraClippingRange();
   }
 
 
@@ -262,6 +262,8 @@ namespace bbwxvtk
   // when window is shown
   void  Viewer2D::bbUserOnShow()
   {
+    ((Viewer2DWidget*)bbGetOutputWidget())->Refresh();
+    ((Viewer2DWidget*)bbGetOutputWidget())->Update();
     ((Viewer2DWidget*)bbGetOutputWidget())->UpdateView();
   }