Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/06/10 19:19:42 $
-Version: $Revision: 1.20 $
+Date: $Date: 2008/06/19 09:46:41 $
+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
}
- //=========================================================================
- // Static members initialization
-/*EED
- bool BlackBox::bbmgSomeBoxExecuting = false;
- bool BlackBox::bbmgFreezeExecution = false;
- std::set<BlackBox*> BlackBox::bbmgExecutionList;
-*/
//=========================================================================
//=========================================================================
}
//=========================================================================
+ void BlackBox::bbUserOnShowWidget(std::string nameInput)
+ {
+ bbtk::BlackBoxInputConnector *cc;
+ cc = this->bbGetInputConnectorMap().find( nameInput.c_str() )->second;
+ if (cc->GetConnection()!=NULL)
+ {
+ cc->GetConnection()->GetBlackBoxFrom()->bbUserOnShow();
+ }
+ }
+
} // EO namespace bbtk
Program: bbtk
Module: $RCSfile: bbtkBlackBox.h,v $
Language: C++
- Date: $Date: 2008/05/15 08:02:36 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2008/06/19 09:46:41 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
virtual void Check(bool recursive = true);
+ virtual void bbUserOnShow() { }
+ void bbUserOnShowWidget(std::string nameInput);
+
+
protected:
//==================================================================
// PROTECTED PART : ACCESSIBLE TO THE BlackBox DEVELOPER
/// (called after bbProcess during bbExecute)
/// Does nothing here but overloaded in WxBlackBox and WxContainerBlackBox
virtual void bbShowWindow(Connection::Pointer caller) { }
-
+
virtual void bbHideWindow() {}
virtual void bbCloseWindow() { }
//==================================================================
Program: bbtk
Module: $RCSfile: bbtkWxGUIConsole.cxx,v $
Language: C++
- Date: $Date: 2008/05/15 08:02:36 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2008/06/19 09:46:41 $
+ 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
std::string strcommand0 = "cd "+bbdoc_path+" && mkdir tmp && cd tmp";
std::string strcommand1 = "cd "+bbdoc_path+"/tmp";
- std::string strcommand2 = "\""+bin_path+"/bbi\" -n "+make_index_path;
+ std::string strcommand2 = "\""+bin_path+"/bbi\" -N "+make_index_path;
#ifdef WIN32
std::string strcommand3 = "move index*.html ../.";
#else
Program: bbtk
Module: $RCSfile: bbitkImageProperties.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:50 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/06/19 09:46:44 $
+ 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
#include "bbitkImageProperties.h"
#include "bbitkPackage.h"
+
+
namespace bbitk
{
BBTK_BLACK_BOX_IMPLEMENTATION(ImageProperties,bbtk::AtomicBlackBox);
<<bbtk::TypeName<itkImageType>()
<<">()"<<std::endl);
- itkImageType* im = bbGetInputIn().get<itkImageType*>();
+
+ itkImageType* im = bbGetInputIn().get<itkImageType*>();
unsigned int dim = im->GetImageDimension();
bbSetOutputTypeName(bbtk::TypeName<typename itkImageType::PixelType>());
Program: bbtk
Module: $RCSfile: bbwxLayoutLine.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:52 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/06/19 09:46:46 $
+ 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
bbSetOutputWidget( w );
}
+ // This callback is necessary to get actual processing of the view
+ // when window is shown
+ void LayoutLine::bbUserOnShow()
+ {
+ bbUserOnShowWidget("Widget1");
+ bbUserOnShowWidget("Widget2");
+ bbUserOnShowWidget("Widget3");
+ bbUserOnShowWidget("Widget4");
+ bbUserOnShowWidget("Widget5");
+ bbUserOnShowWidget("Widget6");
+ bbUserOnShowWidget("Widget7");
+ bbUserOnShowWidget("Widget8");
+ bbUserOnShowWidget("Widget9");
+ }
+
}//namespace bbwx
#endif // _USE_WXWIDGETS_
Program: bbtk
Module: $RCSfile: bbwxLayoutLine.h,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:53 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/06/19 09:46:46 $
+ 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
void Process();
void CreateWidget();
+ void bbUserOnShow();
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxLayoutSplit.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:53 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/06/19 09:46:46 $
+ 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
bbSetOutputWidget( w );
}
+
+ // This callback is necessary to get actual processing of the view
+ // when window is shown
+ void LayoutSplit::bbUserOnShow()
+ {
+ bbUserOnShowWidget("Widget1");
+ bbUserOnShowWidget("Widget2");
+ }
+
+
+
}//namespace bbwx
#endif // _USE_WXWIDGETS_
Program: bbtk
Module: $RCSfile: bbwxLayoutSplit.h,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:53 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/06/19 09:46:46 $
+ 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
void Process();
void CreateWidget();
+ void bbUserOnShow();
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxLayoutTab.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:53 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/06/19 09:46:46 $
+ 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
{
widgetchild->Reparent(book);
book->AddPage(widgetchild, widgetchild->GetName() );
+ widgetchild->Show();
}
}
TryInsertWindow(w,bbGetInputWidget7());
TryInsertWindow(w,bbGetInputWidget8());
TryInsertWindow(w,bbGetInputWidget9());
-
+
+
bbSetOutputWidget( w );
}
+ // This callback is necessary to get actual processing of the view
+ // when window is shown
+ void LayoutTab::bbUserOnShow()
+ {
+ bbGetOutputWidget()->Show();
+ bbUserOnShowWidget("Widget1");
+ bbUserOnShowWidget("Widget2");
+ bbUserOnShowWidget("Widget3");
+ bbUserOnShowWidget("Widget4");
+ bbUserOnShowWidget("Widget5");
+ bbUserOnShowWidget("Widget6");
+ bbUserOnShowWidget("Widget7");
+ bbUserOnShowWidget("Widget8");
+ bbUserOnShowWidget("Widget9");
+ }
}//namespace bbwx
Program: bbtk
Module: $RCSfile: bbwxLayoutTab.h,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:53 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/06/19 09:46:46 $
+ 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
void Process();
void CreateWidget();
-
+ void bbUserOnShow();
+
protected:
virtual void bbUserConstructor();
void TryInsertWindow(wxNotebook *book, wxWindow *widgetchild);
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.cxx,v $
Language: C++
- Date: $Date: 2008/06/17 11:12:03 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/06/19 09:46:49 $
+ 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
#include "vtkInteractorStyleImage.h"
#include "vtkCamera.h"
#include "vtkRenderer.h"
-
+#include <vtkInteractorStyleImage.h>
+#include <vtkCommand.h>
wxvtkrenderwindowinteractor->UseCaptureMouseOn();
imageViewer = vtkImageViewer2::New();
+ imageViewer->SetSlice( 1 );
imageViewer->SetupInteractor ( wxvtkrenderwindowinteractor );
mDefaultImage = vtkImageData::New();
int dim[3];
- dim[0] = dim[1] = dim[2] = 1;
+ dim[0] = dim[1] = 32 ;
+ dim[2] = 2;
mDefaultImage->SetDimensions ( dim );
mDefaultImage->SetSpacing(1,1,1);
+ mDefaultImage->SetExtent(0,dim[0]-1,0,dim[1]-1,0,dim[2]-1);
+ mDefaultImage->SetWholeExtent(0,dim[0]-1,0,dim[1]-1,0,dim[2]-1);
mDefaultImage->SetScalarTypeToUnsignedChar();
mDefaultImage->AllocateScalars();
for (int i=0;i<dim[0];i++)
for (int j=0;j<dim[1];j++)
- mDefaultImage->SetScalarComponentFromFloat(i,j,0,0,0);
+ for (int k=0;k<dim[2];k++)
+ mDefaultImage->SetScalarComponentFromFloat(i,j,k,0,0);
+
+ for (int i=0;i<dim[0];i++)
+ {
+ mDefaultImage->SetScalarComponentFromFloat(dim[0]-i-1,i,0,0,255);
+ mDefaultImage->SetScalarComponentFromFloat(i,i,1,0,255);
+ }
backImageData = mDefaultImage;
imageViewer->SetInput( backImageData );
// std::cout << "Viewer2DWidget::UpdateView() "<<mBox->bbGetFullName() << std::endl;
// std::cout << "slice="<<mBox->bbGetInputSlice()<<std::endl;
+
if ( ( mBox->bbGetInputIn() == NULL ) &&
( backImageData != mDefaultImage ) )
{
vtkCamera *camera = imageViewer->GetRenderer()->GetActiveCamera();
- camera->SetViewUp ( spx*0, -spy*1, spz*0);
- camera->SetPosition( spx*(x1+x2)/2, spy*(y1+y2)/2, -spz*10000000);
- camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0);
+ camera->SetViewUp ( spx*0, -spy*1, spz*0 );
+ camera->SetPosition( spx*(x1+x2)/2, spy*(y1+y2)/2, -spz*10000000 );
+ camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 );
camera->ComputeViewPlaneNormal();
camera->SetParallelScale( spx*(x2-x1)/2.0 );
// std::cout << "CW = "<< mBox->bbGetContainingWindow() << std::endl;
// std::cout << "Sh = "<< mBox->bbIsShown() << std::endl;
+
+
// mBox->bbIsShown() is necessary to be sure that the wxWindow is already
// created and displayed.
// Else when slice != 0 we get an X Window System error with wxGTK
if (
(backImageData!=NULL)&&
(mBox->bbIsShown()))
- {
+ {
int z = mBox->bbGetInputSlice();
// std::cout << "slice = "<<z<<std::endl;
int ext[6];
// std::cout << "ext = "<<ext[4]<<" - "<<ext[5]<<std::endl;
if (z<ext[4]) { z=ext[4]; }
- if (z>=ext[5]) { z=ext[5]-1; }
+ if (z>ext[5]) { z=ext[5]; }
#if (VTK_MAJOR_VERSION >= 5)
#else
imageViewer->SetZSlice( z );
#endif
- wxvtkrenderwindowinteractor->Render();
- }
+ //imageViewer->UpdateDisplayExtent();
+ //wxvtkrenderwindowinteractor->Render();
+ imageViewer->GetRenderer()->ResetCameraClippingRange();
+ }
-
- }
+
+}
+ vtkRenderer * Viewer2DWidget::GetRenderer()
+ {
+ return imageViewer->GetRenderer();
+ }
+
//--------------------------------------------------------------------------
((Viewer2DWidget*)bbGetOutputWidget())->UpdateView();
bbSetOutputOut( bbGetInputSlice() );
+ bbSetOutputRenderer( ((Viewer2DWidget*)bbGetOutputWidget())->GetRenderer() );
+
}
void Viewer2D::bbUserConstructor()
{
- bbSetInputIn(0);
+ bbSetInputIn(NULL);
+ bbSetInputSlice(0);
}
/**
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.h,v $
Language: C++
- Date: $Date: 2008/06/17 11:12:03 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/06/19 09:46:49 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Viewer2DWidget(Viewer2D* box, wxWindow *parent);
~Viewer2DWidget();
void UpdateView();
+ vtkRenderer *GetRenderer();
private:
Viewer2D *mBox;
- vtkImageViewer2 *imageViewer;
- vtkImageData *backImageData;
- vtkImageData *mDefaultImage;
+ vtkImageViewer2 *imageViewer;
+ vtkImageData *backImageData;
+ vtkImageData *mDefaultImage;
wxVTKRenderWindowInteractor *wxvtkrenderwindowinteractor;
bool mUpdateCamera;
- vtkImplicitPlaneWidget * maPlane1, * maPlane2, * mbPlane1, * mbPlane2;
+ vtkImplicitPlaneWidget * maPlane1, * maPlane2, * mbPlane1, * mbPlane2;
};
//------------------------------------------------------------------------
BBTK_DECLARE_INPUT(Orientation,int);
BBTK_DECLARE_INPUT(In,vtkImageData *);
BBTK_DECLARE_OUTPUT(Out,int);
+ BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer*);
BBTK_PROCESS(Process);
void Process();
BBTK_CREATE_WIDGET(CreateWidget);
BBTK_INPUT(Viewer2D,Orientation,"Slicing orientation : 0:yz / 1:xz / 2:xy",int,"");
BBTK_INPUT(Viewer2D,In,"Input Image",vtkImageData *,"");
BBTK_OUTPUT(Viewer2D,Out,"Position of the slider",int,"");
+ BBTK_OUTPUT(Viewer2D,Renderer,"vtk Renderer",vtkRenderer*,"");
BBTK_END_DESCRIBE_BLACK_BOX(Viewer2D);
//=================================================================