]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Tue, 16 Dec 2008 13:00:25 +0000 (13:00 +0000)
committerguigues <guigues>
Tue, 16 Dec 2008 13:00:25 +0000 (13:00 +0000)
packages/kw/bbs/appli/exampleTransferFunctionEditor.bbs [new file with mode: 0644]
packages/kw/src/bbkwTransferFunctionEditor.cxx
packages/kw/src/bbkwTransferFunctionEditor.h

diff --git a/packages/kw/bbs/appli/exampleTransferFunctionEditor.bbs b/packages/kw/bbs/appli/exampleTransferFunctionEditor.bbs
new file mode 100644 (file)
index 0000000..a32acc9
--- /dev/null
@@ -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
index b57c8b9ff53e4fdf424491e708d9ad52252014c3..26ff610333fa5ecdd8e759044e189eae129c45ee 100644 (file)
@@ -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();
 
index efa64f36d3530514409e59d00a1dbbb8b7f1eb59..296e75eef0bb390f1dbb67bdc4b73deb203491f4 100644 (file)
@@ -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);