]> Creatis software - creaMaracasVisu.git/commitdiff
#2459 creaMaracasVisu Feature New Normal - Add colorbar in the ColorLayerWidget
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Wed, 15 Oct 2014 15:21:32 +0000 (17:21 +0200)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Wed, 15 Oct 2014 15:21:32 +0000 (17:21 +0200)
bbtk/bbs/boxes/Ruler01_XY_Widget.bbg
bbtk/bbs/boxes/Ruler01_XY_Widget.bbs
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h

index 75c7d0554d1d3b7a8947c62bb5293219b947587f..dbff751a1cc3d3181de3758e77e03cd9f8cc8360 100644 (file)
@@ -10,48 +10,56 @@ AUTHOR:Author ??
 COMPLEXBOX:TRUE
 COMPLEXBOXNAME:Ruler01_XY_Widget
 PACKAGENAME:creaMaracasVisu
-COMPLEXOUTPUTS:1
+COMPLEXOUTPUTS:3
 COMPLEX_PORT
 Widget
--11.639037:-97.638532:-900.000000
+-70.265432:-47.879995:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+angle
+-95.452638:-47.295243:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+boxchange
+-82.150851:-46.802584:-900.000000
 FIN_COMPLEX_PORT
 COMPLEXINPUTS:4
 COMPLEX_PORT
 Image
-18.922377:51.712388:-900.000000
+-41.674653:51.712388:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Point
-56.294382:48.363648:-900.000000
+-8.982906:50.087954:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 BoxExecuteRulerInterface
--32.960378:48.225485:-900.000000
+-96.267031:54.137390:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 wxvtkbaseview
-128.971668:62.057674:-900.000000
+66.650333:46.538923:-900.000000
 FIN_COMPLEX_PORT
 BOXES:3
 BOX
 creaMaracasVisu:Ruler01_Interface:Box01
 ISEXEC:FALSE
--31.605968:25.201303:-900.000000
-13.969032:15.201303:-900.000000
+-89.493374:27.171938:-900.000000
+-43.918374:17.171938:-900.000000
 FIN_BOX
 BOX
 creaMaracasVisu:Ruler01_XY:Box02
 ISEXEC:FALSE
-37.997154:-65.434892:-900.000000
-83.572154:-75.434892:-900.000000
+-7.081124:-18.139649:-900.000000
+38.493876:-28.139649:-900.000000
 FIN_BOX
 BOX
 std:ConcatStrings:Box04
 ISEXEC:FALSE
-52.436976:20.606915:-900.000000
-98.011976:10.606915:-900.000000
+-8.160054:22.577550:-900.000000
+37.414946:12.577550:-900.000000
 FIN_BOX
-CONNECTIONS:10
+CONNECTIONS:12
 CONNECTION
 Box01:Widget:Widget:Widget
 NumberOfControlPoints:0
@@ -82,4 +90,10 @@ NumberOfControlPoints:0
 CONNECTION
 wxvtkbaseview:wxvtkbaseview:Box02:wxvtkbaseview
 NumberOfControlPoints:0
+CONNECTION
+Box01:Angle:angle:angle
+NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChangeRulerInterface:boxchange:boxchange
+NumberOfControlPoints:0
 APP_END
index 459083b99f2f57cedb98c7876778d5f915aa5c88..ed3978e956523d3291ce29fd4087b1a9f9d2b38d 100644 (file)
@@ -36,6 +36,9 @@ input wxvtkbaseview Box02.wxvtkbaseview " "
 
 # Complex output ports
 output Widget Box01.Widget " "
+output angle Box01.Angle " "
+output boxchange Box01.BoxChangeRulerInterface " "
 
+message    
 
 endefine
index 3884a64a55b579db0333aaa0889acf7a77d38997..25d0b62e4f349084a4a7a746ef0916c69f97ab62 100644 (file)
@@ -146,6 +146,7 @@ LayerImageBase::LayerImageBase()
        _Z                              =       0;
        _thresholdTable                 =       NULL;
        _thresholdMapper                =       NULL;
+       _scalarbarActor = NULL;
        _thresholdActor                 =       NULL;
        _image                          =       NULL;
        _baseView                       =       NULL;
@@ -327,6 +328,7 @@ void LayerImageBase::onThreshold()
                        if (_thresholdActor==NULL)
                        {
                                _thresholdActor = vtkImageActor::New( );
+                               _scalarbarActor = vtkScalarBarActor::New();
                                _thresholdActor->SetOpacity( 0.6 );
                                _thresholdActor->InterpolateOn(  );
                                if (directionViewer==0)
@@ -345,6 +347,7 @@ void LayerImageBase::onThreshold()
                                }
                        } // _thresholdActor
                        _baseView->GetRenderer()->AddActor( _thresholdActor );
+                       _baseView->GetRenderer()->AddActor2D( _scalarbarActor );
                        _actorPresent = true;
                }  // !GetActorPresent()
 
@@ -379,10 +382,18 @@ void LayerImageBase::onThreshold()
 //             img->Update();
 //             img->UpdateInformation();
 
+//             _thresholdTable->Update();
                _thresholdMapper->SetInput( img );
                _thresholdMapper->SetLookupTable( _thresholdTable );
                _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
                
+//             _scalarbarActor->SetLookupTable( _thresholdTable );
+               _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
+
+               _scalarbarActor->SetTitle("Value");
+               _scalarbarActor->SetNumberOfLabels(5);
+//             _scalarbarActor->SetTextPad(4);  ??
+
                } // _image
 }
 
@@ -429,6 +440,8 @@ void LayerImageBase::onThresholdRemove()
        {
                wxVtkBaseView * baseView = _baseView;
                baseView->GetRenderer()->RemoveActor( _thresholdActor );
+               baseView->GetRenderer()->RemoveActor( _scalarbarActor );
+
                _actorPresent = false;
        }
 }
index 4bacccb51346142dfec9db5dadc8b72d5ce3d9de..1e4828790b92bc7a7d16663b7d5996c149b6fe99 100644 (file)
@@ -42,6 +42,7 @@
 #include <vtkImageActor.h>
 #include <vtkImageData.h>
 #include "wxVtkBaseView.h"
+#include "vtkScalarBarActor.h"
 
 #include "InteractorStyleMaracas.h"
 
@@ -113,6 +114,8 @@ class LayerImageBase
                vtkImageActor           *_thresholdActor;
                wxVtkBaseView           *_baseView;
 
+               vtkScalarBarActor       *_scalarbarActor;
+
                virtual void ConfigLookupTable() = 0;           
                void CleanXYZ(double &x, double &y, double &z);