--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#include "bbcreaVtkScalarBarActor.h"
+#include "bbcreaVtkPackage.h"
+
+#include <vtkScalarBarActor.h>
+
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ScalarBarActor)
+BBTK_BLACK_BOX_IMPLEMENTATION(ScalarBarActor,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ScalarBarActor::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+
+printf ("EED ScalarBarActor Start\n");
+ if (firsttime==true)
+ {
+ firsttime=false;
+ vtkScalarBarActor* scalarbarActor = vtkScalarBarActor::New();
+ scalarbarActor->SetLookupTable( bbGetInputLookupTable() );
+ scalarbarActor->SetTitle("Value");
+ scalarbarActor->SetNumberOfLabels(4);
+ int fontsize = scalarbarActor->GetLabelTextProperty()->GetFontSize();
+ scalarbarActor->GetLabelTextProperty()->SetFontSize(fontsize/2);
+ if (bbGetInputRenderer()!=NULL)
+ {
+ bbGetInputRenderer()->AddActor2D( scalarbarActor );
+ }
+ } // firsttime
+
+printf ("EED ScalarBarActor End\n");
+
+}
+
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ScalarBarActor::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputLookupTable(NULL);
+ bbSetInputRenderer(NULL);
+ firsttime=true;
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ScalarBarActor::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ScalarBarActor::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#ifndef __bbcreaVtkScalarBarActor_h_INCLUDED__
+#define __bbcreaVtkScalarBarActor_h_INCLUDED__
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include <vtkRenderer.h>
+#include <vtkScalarsToColors.h>
+#include <vtkTextProperty.h>
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT ScalarBarActor
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ScalarBarActor,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+ BBTK_DECLARE_INPUT(LookupTable,vtkScalarsToColors*);
+ BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
+// BBTK_DECLARE_OUTPUT(Out,double);
+ BBTK_PROCESS(Process);
+ void Process();
+
+ bool firsttime;
+
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ScalarBarActor,bbtk::AtomicBlackBox);
+ BBTK_NAME("ScalarBarActor");
+ BBTK_AUTHOR("Info-Dev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(ScalarBarActor,LookupTable,"LookupTable",vtkScalarsToColors*,"");
+ BBTK_INPUT(ScalarBarActor,Renderer,"Renderer",vtkRenderer*,"");
+// BBTK_OUTPUT(ScalarBarActor,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ScalarBarActor);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+}
+// EO namespace bbcreaVtk
+
+#endif // __bbcreaVtkScalarBarActor_h_INCLUDED__
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#include "bbcreaVtkScalarsToColors.h"
+#include "bbcreaVtkPackage.h"
+
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ScalarsToColors)
+BBTK_BLACK_BOX_IMPLEMENTATION(ScalarsToColors,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ScalarsToColors::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+ if (firsttime==true)
+ {
+ firsttime=false;
+
+ // Create the color map
+ if (bbGetInputType()==0)
+ {
+ _colorLookupTable = vtkLookupTable::New();
+ _colorLookupTable->Build();
+ double rgba1[4];
+ double rgba2[4];
+ for (int iLookTable = 0; iLookTable<128; iLookTable++)
+ {
+ _colorLookupTable->GetTableValue( iLookTable, rgba1);
+ _colorLookupTable->GetTableValue(256-1-iLookTable, rgba2);
+
+ _colorLookupTable->SetTableValue(256-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
+ _colorLookupTable->SetTableValue( iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
+ } // for iLookTable
+ } // if
+ } // firsttime
+
+ if (bbGetInputRange().size()==2)
+ {
+ _colorLookupTable->SetTableRange( bbGetInputRange()[0],bbGetInputRange()[1]);
+ } else {
+ _colorLookupTable->SetTableRange( 0,1 );
+ }
+
+ double rgb[3];
+ _colorLookupTable->GetColor( bbGetInputScalarValue() , rgb );
+ std::vector<double>colorRGB;
+ colorRGB.push_back( rgb[0] );
+ colorRGB.push_back( rgb[1] );
+ colorRGB.push_back( rgb[2] );
+
+ bbSetOutputColor( colorRGB );
+ bbSetOutputLookupTable(_colorLookupTable);
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ScalarsToColors::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputType(0);
+ std::vector<double>range;
+ range.push_back( 0 );
+ range.push_back( 1 );
+ bbSetInputRange(range);
+ bbSetInputScalarValue(0);
+ firsttime=true;
+
+ _colorLookupTable=NULL;
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ScalarsToColors::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ScalarsToColors::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#ifndef __bbcreaVtkScalarsToColors_h_INCLUDED__
+#define __bbcreaVtkScalarsToColors_h_INCLUDED__
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include <vtkScalarsToColors.h>
+#include <vtkLookupTable.h>
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT ScalarsToColors
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ScalarsToColors,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+ BBTK_DECLARE_INPUT(Type,int);
+ BBTK_DECLARE_INPUT(ScalarValue,double);
+ BBTK_DECLARE_INPUT(Range,std::vector<double> );
+ BBTK_DECLARE_OUTPUT(Color, std::vector<double> );
+ BBTK_DECLARE_OUTPUT(LookupTable,vtkScalarsToColors*);
+ BBTK_PROCESS(Process);
+ void Process();
+
+ bool firsttime;
+ vtkLookupTable *_colorLookupTable;
+
+
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ScalarsToColors,bbtk::AtomicBlackBox);
+ BBTK_NAME("ScalarsToColors");
+ BBTK_AUTHOR("Info-Dev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(ScalarsToColors,Type,"Type of color table",int,"");
+ BBTK_INPUT(ScalarsToColors,ScalarValue,"Scalar value",double,"");
+ BBTK_INPUT(ScalarsToColors,Range,"Min Max range",std::vector<double>,"");
+ BBTK_OUTPUT(ScalarsToColors,Color,"Color",std::vector<double>,"");
+ BBTK_OUTPUT(ScalarsToColors,LookupTable,"LookupTable",vtkScalarsToColors*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ScalarsToColors);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+}
+// EO namespace bbcreaVtk
+
+#endif // __bbcreaVtkScalarsToColors_h_INCLUDED__
+