Program: bbtk
Module: $RCSfile: bbtkKWBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/12/11 09:50:35 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/12/18 11:54:44 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
win->Create();
win->SetResizable(0,0);
- bbUserCreateWidget(win->GetFrame());
+ bbUserCreateWidget(win->GetFrame());
+ /*
+ KW::GetApplication()->Script
+ ("pack %s -expand yes -fill both",
+ bbGetOutputWidget()->GetWidgetName());
+ */
+
KW::GetApplication()->Script("place %s -x 0 -y 0 -width %d -height %d",
bbGetOutputWidget()->GetWidgetName(),
bbGetInputWinWidth(),
bbGetInputWinHeight());
-
+
--- /dev/null
+description "A 3D image renderer (uses kw)"
+author "laurent.guigues@creatis.insa-lyon.fr"
+category "application"
+
+load vtk
+load std
+load itk
+load itkvtk
+include kw
+
+load creaImageIO
+new Gimmick reader
+
+new kwVolumeRendererWithControls renderer
+new kwViewer3D viewer
+
+connect reader.Out renderer.In
+connect renderer.Out viewer.In1
+connect renderer.BoxChange viewer.BoxExecute
+
+new kwLayoutSplit main
+connect viewer.Widget main.Widget2
+connect renderer.Widget main.Widget1
+
+set main.WinTitle "Volume renderer"
+
+exec main
+
include vtk
load wx
+message Help 0
+
print "=================================="
print "A Slider whose output is plugged into an OutputText"
+print "=================================="
message echo 2
new kwSlider in
clear
print "=================================="
print "The kwSlicer widget"
+print "=================================="
+help kwSlicer
message echo 2
new LoadHola r
message echo 0
clear
+/*
print "=================================="
print "Using both kw and wx"
+print "=================================="
message echo 2
new OutputText t
message echo 0
clear
+*/
+print "=================================="
+print "Volume renderer with controls"
+print "=================================="
+help kwVolumeRendererWithControls
+message echo 2
+
+new LoadHola image
+new kwVolumeRendererWithControls renderer
+new kwViewer3D viewer
+
+connect image.Out renderer.In
+connect renderer.Out viewer.In1
+connect renderer.BoxChange viewer.BoxExecute
+
+new kwLayoutSplit main
+connect viewer.Widget main.Widget2
+connect renderer.Widget main.Widget1
+
+exec main
+
+message echo 0
+message Help 1
+clear
+print " "
+print "====================================="
+print " END OF TOUR"
+print "====================================="
+
--- /dev/null
+load vtk
+load std
+load kw
+
+
+define kwVolumeRendererWithControls kw
+ author "laurent.guigues@creatis.insa-lyon.fr"
+ description "Volume renderer (vtk::VolumeRenderer) with associated control panel (transfer function and opacity editors)"
+ category "image;widget;viewer"
+
+ new kwTransferFunctionEditor color
+ new kwTransferFunctionEditor opacity
+ new VolumeRenderer renderer
+ new kwLayoutSplit controls
+
+ connect color.Out renderer.ColorFunction
+ connect opacity.Out renderer.OpacityFunction
+ connect color.Widget controls.Widget2
+ connect opacity.Widget controls.Widget1
+
+ new MultipleInputs refresh
+ connect color.BoxChange refresh.In1
+ connect opacity.BoxChange refresh.In2
+
+ new "vtkImageData*Relay" image
+ connect image.Out color.In
+ connect image.Out opacity.In
+ connect image.Out renderer.In
+
+ set color.Title "Transfer function"
+ set opacity.Title "Opacity"
+
+ input In image.In "3D image to render"
+ input BoxExecute renderer.BoxExecute "Box execution"
+
+ output Out renderer.Out "Output 3D object to plug into a 3D viewer"
+ output BoxChange refresh.Out "BoxChange"
+ output Widget controls.Widget "Widget"
+
+ exec renderer
+endefine
+
Program: bbtk
Module: $RCSfile: bbkwLayoutSplit.cxx,v $
Language: C++
- Date: $Date: 2008/12/02 13:37:56 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/12/18 11:54:57 $
+ Version: $Revision: 1.4 $
=========================================================================*/
/* ---------------------------------------------------------------------
width = width - 5;
height = height - 5 ;
-
+
+ /*
bbGetOutputWidget()->GetApplication()->Script("place %s -x 0 -y 0 -width %d -height %d",
bbGetOutputWidget()->GetWidgetName(),
parent->GetWidth(),
parent->GetHeight() );
+ */
+ bbGetOutputWidget()->GetApplication()->Script
+ ("pack %s -expand yes -fill both",
+ bbGetOutputWidget()->GetWidgetName());
splitframe->SetReliefToGroove();
splitframe->SetBorderWidth(2);
vtkKWWidget* w2 = bbCreateWidgetOfInput("Widget2",splitframe->GetFrame2());
-
+ splitframe->GetApplication()->Script
+ ("pack %s -expand yes -fill both",
+ w1->GetWidgetName()) ;
+ splitframe->GetApplication()->Script
+ ("pack %s -expand yes -fill both",
+ w2->GetWidgetName()) ;
+
+ /*
+ splitframe->GetApplication()->Script("pack %s -expand yes -fill x -fill y", w2->GetWidgetName());
+ */
+ /*
splitframe->GetApplication()->Script("place %s -x 0 -y 0 -width %d -height %d",
w1->GetWidgetName(),
width,
width,
height);
-
+ */
}
Program: bbtk
Module: $RCSfile: bbkwTransferFunctionEditor.cxx,v $
Language: C++
- Date: $Date: 2008/12/16 13:00:27 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/12/18 11:54:57 $
+ Version: $Revision: 1.3 $
=========================================================================*/
/* ---------------------------------------------------------------------
vtkKWPiecewiseFunctionEditor *w = vtkKWPiecewiseFunctionEditor::New();
bbSetOutputWidget(w);
- // w->SetWindowLevelModeChangedCommand((vtkObject*)this,(const char*)"OnChange");
- //AddObserver(vtkKWPiecewiseFunctionEditor::FunctionChangedCommand,this);
+ w->AddObserver(vtkKWPiecewiseFunctionEditor::FunctionChangedEvent,this);
w->SetParent((vtkKWWidget*)parent);
w->Create();
std::cout << "TransferFunctionEditor::OnChange()" << std::endl;
}
- void TransferFunctionEditor::Execute(vtkObject* caller, unsigned long, void*)
+ void TransferFunctionEditor::Execute(vtkObject* caller, unsigned long , void*)
{
- std::cout << "$$$$$$$$$$$$ TransferFunctionEditor CB $$$$$$$$$$$$"<<std::endl;
+ bbSignalOutputModification("Out");
+ // std::cout << "$$$$$$$$$$$$ TransferFunctionEditor CB $$$$$$$$$$$$"<<std::endl;
+
/*
vtkKWScale* scale = (vtkKWScale*)caller;
bbSetOutputOut( scale->GetValue() );
Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.cxx,v $
Language: C++
- Date: $Date: 2008/12/15 13:13:47 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2008/12/18 11:55:00 $
+ Version: $Revision: 1.18 $
=========================================================================*/
/* ---------------------------------------------------------------------
#include "vtkPlaneWidget.h"
+#include "bbstdRelay.h"
namespace bbstd
{
BBTK_BLACK_BOX_TEMPLATE2_IMPLEMENTATION(Cast,
bbtk::AtomicBlackBox);
//====================================================================
+ //====================================================================
+ BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(Relay,
+ bbtk::AtomicBlackBox);
+ //====================================================================
}
using namespace bbstd;
+
+
namespace bbvtk
{
BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(vtk,Cast,I,O);
+ BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(vtk,Relay,vtkImageDataPointer);
+
}
namespace bbvtk
Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.h,v $
Language: C++
- Date: $Date: 2008/12/03 13:35:32 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2008/12/18 11:55:00 $
+ Version: $Revision: 1.11 $
=========================================================================*/
/* ---------------------------------------------------------------------
class vtkImageData;
class vtkImagePlaneWidget;
+
namespace bbvtk
{
}//namespace bbvtk
+namespace bbvtk
+{
+ typedef vtkImageData* vtkImageDataPointer;
+}
+namespace bbtk
+{
+ BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(bbvtk::vtkImageDataPointer,
+ "vtkImageDataPointer");
+}
+
+
#endif //__bbtvtkImagePlanes_h__
#endif //_USE_VTK_