From: guigues Date: Tue, 16 Dec 2008 13:00:25 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v0.9.1~22 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=763650a6180770f5d169eaef1dd01838115a9eda;p=bbtk.git *** empty log message *** --- diff --git a/packages/kw/bbs/appli/exampleTransferFunctionEditor.bbs b/packages/kw/bbs/appli/exampleTransferFunctionEditor.bbs new file mode 100644 index 0000000..a32acc9 --- /dev/null +++ b/packages/kw/bbs/appli/exampleTransferFunctionEditor.bbs @@ -0,0 +1,40 @@ +description "Example of the tranfer function editor for volume rendering" +author "laurent.guigues at creatis.insa-lyon.fr" +category "example" + +include vtk +#load wxvtk +load kw + +new LoadHola image +//new PiecewiseFunction color +new kwTransferFunctionEditor color +new kwTransferFunctionEditor opacity +new VolumeRenderer renderer +new kwViewer3D viewer + +connect image.Out color.In +connect image.Out opacity.In +connect image.Out renderer.In +connect color.Out renderer.ColorFunction +connect opacity.Out renderer.OpacityFunction +connect renderer.Out viewer.In1 +connect color.BoxChange viewer.BoxExecute + +load std +#set color.X "0 500 1000" +#set color.Y "0 0.01 1" +//set opacity.X "0 500 1000" +//set opacity.Y "0 0.01 0.1" + +//new kwLayoutSplit main +//connect viewer.Widget main.Widget1 +//connect color.Widget main.Widget2 + +set color.Title "Transfer function" +set opacity.Title "Opacity" + +exec color +exec opacity +exec viewer +//exec main diff --git a/packages/kw/src/bbkwTransferFunctionEditor.cxx b/packages/kw/src/bbkwTransferFunctionEditor.cxx index b57c8b9..26ff610 100644 --- a/packages/kw/src/bbkwTransferFunctionEditor.cxx +++ b/packages/kw/src/bbkwTransferFunctionEditor.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbkwTransferFunctionEditor.cxx,v $ Language: C++ - Date: $Date: 2008/12/16 12:48:07 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/12/16 13:00:27 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -68,6 +68,7 @@ namespace bbkw { bbSetInputIn(0); bbSetOutputOut(0); + bbSetInputTitle("Transfer function"); bbSetOutputWidget(0); } @@ -108,8 +109,8 @@ namespace bbkw // w->ExpandCanvasWidthOff(); // w->ExpandCanvasHeightOn(); // w->SetCanvasWidth(450); - w->SetCanvasHeight( parent->GetHeight() ); - w->SetLabelText("");//Transfer Function Editor"); + w->SetCanvasHeight( parent->GetHeight() - 100 ); + w->SetLabelText(bbGetInputTitle().c_str()); w->SetBalloonHelpString("Edit the transfer function"); w->LockEndPointsParameterOn(); diff --git a/packages/kw/src/bbkwTransferFunctionEditor.h b/packages/kw/src/bbkwTransferFunctionEditor.h index efa64f3..296e75e 100644 --- a/packages/kw/src/bbkwTransferFunctionEditor.h +++ b/packages/kw/src/bbkwTransferFunctionEditor.h @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbkwTransferFunctionEditor.h,v $ Language: C++ - Date: $Date: 2008/12/16 12:48:08 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/12/16 13:00:27 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -81,6 +81,8 @@ namespace bbkw BBTK_DECLARE_INPUT(In,vtkImageData*); BBTK_DECLARE_OUTPUT(Out,vtkPiecewiseFunction*); + BBTK_DECLARE_INPUT(Title,std::string); + BBTK_PROCESS(Process); BBTK_CREATE_KWWIDGET(CreateWidget); @@ -103,6 +105,8 @@ namespace bbkw BBTK_INPUT(TransferFunctionEditor,In, "Image from which to extract the histogram to display", vtkImageData*,""); + BBTK_INPUT(TransferFunctionEditor,Title, + "Title",std::string,""); BBTK_OUTPUT(TransferFunctionEditor,Out,"Piecewise function", vtkPiecewiseFunction*,""); BBTK_END_DESCRIBE_BLACK_BOX(TransferFunctionEditor);