Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/12/09 11:48:31 $
- Version: $Revision: 1.33 $
+ Date: $Date: 2008/12/09 12:54:02 $
+ Version: $Revision: 1.34 $
=========================================================================*/
/* ---------------------------------------------------------------------
bbtkError("no input called '"<<name<<"'");
}
i->second->SetConnection(c);
-
- // Check the status of the from.output of c
- // to set the new status of the input
- IOStatus s = MODIFIED;
- if ( c->GetBlackBoxFrom()->bbGetOutputConnector(c->GetBlackBoxFromOutput()).GetStatus() == OUTOFDATE )
- s = OUTOFDATE;
- bbSetStatusAndPropagate(i->second,s);
+ // The input *MUST* be set OUTOFDATE to update its input on next execution
+ bbSetStatusAndPropagate(i->second,OUTOFDATE);
bbtkDebugMessage("connection",2,
"<== BlackBox::bbConnectInput(\""
Program: bbtk
Module: $RCSfile: bbtkBlackBox.h,v $
Language: C++
- Date: $Date: 2008/12/08 12:53:47 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2008/12/09 12:54:02 $
+ Version: $Revision: 1.18 $
=========================================================================*/
/* ---------------------------------------------------------------------
virtual void bbSetOutput( const std::string &name, Data data) = 0;
+ /// Gets the status of the input called <name>
+ IOStatus bbGetInputStatus( const std::string &name ) const
+ { return mInputConnectorMap.find(name)->second->GetStatus(); }
+
/// Returns the input connectors map
InputConnectorMapType& bbGetInputConnectorMap()
{ return mInputConnectorMap; }
Program: bbtk
Module: $RCSfile: bbvtkImageDataToString.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:29 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/12/09 12:54:05 $
+ Version: $Revision: 1.4 $
=========================================================================*/
/* ---------------------------------------------------------------------
template <> void ToString<vtkImageData*> ::DoIt()
{
vtkImageData* im = bbGetInputIn();
+ if (im==0)
+ {
+ bbSetOutputOut("NULL");
+ return;
+ }
int dim[3];
im->GetDimensions(dim);
Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.cxx,v $
Language: C++
- Date: $Date: 2008/12/03 13:35:32 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2008/12/09 12:54:05 $
+ Version: $Revision: 1.16 $
=========================================================================*/
/* ---------------------------------------------------------------------
// Create the widgets if not already done
Init();
- if ( bbGetInputIn() != image)
+ if ( bbGetInputStatus("In") != bbtk::UPTODATE )
{
// Input image has changed : reinitialize planes
image = bbGetInputIn();
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.cxx,v $
Language: C++
- Date: $Date: 2008/12/08 12:56:03 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2008/12/09 12:54:07 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// std::cout << "Viewer2DWidget::UpdateView() "<<mBox->bbGetFullName() << std::endl;
// std::cout << "slice="<<mBox->bbGetInputSlice()<<std::endl;
- std::cout << "--- Testing status of input connection 'In'" << std::endl;
- bbtk::BlackBoxInputConnector* c = mBox->bbGetInputConnectorMap().find("In")->second ;
- if (c->GetStatus()==bbtk::MODIFIED)
- {
- std::cout << "===> MODIFIED"<<std::endl;
- }
- else if (c->GetStatus()==bbtk::UPTODATE)
- {
- std::cout << "===> UPTODATE"<<std::endl;
- }
-
-
-
-
+
if ( ( mBox->bbGetInputIn() == NULL ) &&
( backImageData != mDefaultImage ) )
{
//
- std::cout << "** Viewer2DWidget::UpdateView() : NULL Input (reset)"
- <<std::endl;
+ // std::cout << "** Viewer2DWidget::UpdateView() : NULL Input (reset)"
+ // <<std::endl;
backImageData = mDefaultImage;
mUpdateCamera = true;
}
else if ( ( mBox->bbGetInputIn() != NULL ) &&
- // (true) ) //
- (backImageData != mBox->bbGetInputIn()) )
+ ( mBox->bbGetInputStatus("In") != bbtk::UPTODATE )
+ )
+ //(backImageData != mBox->bbGetInputIn()) )
{
- std::cout << "** Viewer2DWidget::UpdateView() : Input changed"
- <<std::endl;
+ // std::cout << "** Viewer2DWidget::UpdateView() : Input changed"
+ // <<std::endl;
backImageData = mBox->bbGetInputIn();
backImageData->Update();
imageViewer->SetInput( backImageData );
if (mUpdateCamera)
{
- std::cout << "** Viewer2DWidget::UpdateView() : Update Camera"
- <<std::endl;
+ // std::cout << "** Viewer2DWidget::UpdateView() : Update Camera"
+ // <<std::endl;
int x1,x2,y1,y2,z1,z2;
double spx,spy,spz;
backImageData->GetSpacing(spx,spy,spz);
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
-vtkCxxRevisionMacro(wxvtkImageViewer2, "$Revision: 1.1 $");
+vtkCxxRevisionMacro(wxvtkImageViewer2, "$Revision: 1.2 $");
vtkStandardNewMacro(wxvtkImageViewer2);
//----------------------------------------------------------------------------
return;
}
- std::cout << "--- wxvtkImageViewer2::UpdateDisplayExtent()"<<std::endl;
+ // std::cout << "--- wxvtkImageViewer2::UpdateDisplayExtent()"<<std::endl;
input->UpdateInformation();
int *w_ext = input->GetWholeExtent();
- std::cout << "ext = "
- <<w_ext[0]<<" - "<<w_ext[1]<<" ; "
- <<w_ext[2]<<" - "<<w_ext[3]<<" ; "
- <<w_ext[4]<<" - "<<w_ext[5]
- <<std::endl;
+ // std::cout << "ext = "
+ // <<w_ext[0]<<" - "<<w_ext[1]<<" ; "
+ // <<w_ext[2]<<" - "<<w_ext[3]<<" ; "
+ // <<w_ext[4]<<" - "<<w_ext[5]
+ // <<std::endl;
// Is the slice in range ? If not, fix it
int slice_min = w_ext[this->SliceOrientation * 2];
// Initialize the size if not set yet
vtkImageData *input = this->GetInput();
- if (//this->RenderWindow->GetSize()[0] == 0 &&
+ if (this->RenderWindow->GetSize()[0] == 0 &&
input)
{
- /*
+
input->UpdateInformation();
int *w_ext = input->GetWholeExtent();
int xs = 0, ys = 0;
- std::cout << "wxvtkImageViewer2::Render ext = "
- <<w_ext[0]<<" - "<<w_ext[1]<<" ; "
- <<w_ext[2]<<" - "<<w_ext[3]<<" ; "
- <<w_ext[4]<<" - "<<w_ext[5]
- <<std::endl;
+ // std::cout << "wxvtkImageViewer2::Render ext = "
+ // <<w_ext[0]<<" - "<<w_ext[1]<<" ; "
+ // <<w_ext[2]<<" - "<<w_ext[3]<<" ; "
+ // <<w_ext[4]<<" - "<<w_ext[5]
+ // <<std::endl;
switch (this->SliceOrientation)
{
xs < 150 ? 75 : (xs - 1 ) / 2.0);
}
this->FirstRender = 0;
-*/
+
}
}
if (this->GetInput())
//----------------------------------------------------------------------------
void wxvtkImageViewer2::SetInput(vtkImageData *in)
{
- std::cout << "### wxvtkImageViewer2::SetInput"<<std::endl;
+ // std::cout << "### wxvtkImageViewer2::SetInput"<<std::endl;
this->WindowLevel->SetInput(in);
this->UpdateDisplayExtent();
// LG 03/12/08