--- /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 "bbstdAddStringToVector.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,AddStringToVector)
+BBTK_BLACK_BOX_IMPLEMENTATION(AddStringToVector,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 AddStringToVector::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')
+
+ std::vector<std::string> lst = bbGetInputStringVector();
+ if (bbGetInputIn0().length()!=0) lst.push_back( bbGetInputIn0() );
+ if (bbGetInputIn1().length()!=0) lst.push_back( bbGetInputIn1() );
+ if (bbGetInputIn2().length()!=0) lst.push_back( bbGetInputIn2() );
+ if (bbGetInputIn3().length()!=0) lst.push_back( bbGetInputIn3() );
+ if (bbGetInputIn4().length()!=0) lst.push_back( bbGetInputIn4() );
+ if (bbGetInputIn5().length()!=0) lst.push_back( bbGetInputIn5() );
+ if (bbGetInputIn6().length()!=0) lst.push_back( bbGetInputIn6() );
+ if (bbGetInputIn7().length()!=0) lst.push_back( bbGetInputIn7() );
+ if (bbGetInputIn8().length()!=0) lst.push_back( bbGetInputIn8() );
+ if (bbGetInputIn9().length()!=0) lst.push_back( bbGetInputIn9() );
+ bbSetOutputOut( lst );
+}
+//=====
+// 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 AddStringToVector::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+// bbSetInputIn(0);
+
+}
+//=====
+// 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 AddStringToVector::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 AddStringToVector::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbstd
+
+
--- /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 __bbstdAddStringToVector_h_INCLUDED__
+#define __bbstdAddStringToVector_h_INCLUDED__
+
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT AddStringToVector
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(AddStringToVector,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(StringVector,std::vector<std::string>);
+ BBTK_DECLARE_INPUT(In0,std::string);
+ BBTK_DECLARE_INPUT(In1,std::string);
+ BBTK_DECLARE_INPUT(In2,std::string);
+ BBTK_DECLARE_INPUT(In3,std::string);
+ BBTK_DECLARE_INPUT(In4,std::string);
+ BBTK_DECLARE_INPUT(In5,std::string);
+ BBTK_DECLARE_INPUT(In6,std::string);
+ BBTK_DECLARE_INPUT(In7,std::string);
+ BBTK_DECLARE_INPUT(In8,std::string);
+ BBTK_DECLARE_INPUT(In9,std::string);
+ BBTK_DECLARE_OUTPUT(Out,std::vector<std::string>);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// 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(AddStringToVector,bbtk::AtomicBlackBox);
+ BBTK_NAME("AddStringToVector");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(AddStringToVector,StringVector,"Input string vector",std::vector<std::string>,"");
+ BBTK_INPUT(AddStringToVector,In0,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In1,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In2,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In3,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In4,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In5,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In6,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In7,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In8,"Input",std::string,"");
+ BBTK_INPUT(AddStringToVector,In9,"Input",std::string,"");
+ BBTK_OUTPUT(AddStringToVector,Out,"Output vector",std::vector<std::string>,"");
+BBTK_END_DESCRIBE_BLACK_BOX(AddStringToVector);
+
+//=====
+// 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 bbstd
+
+#endif // __bbstdAddStringToVector_h_INCLUDED__
+
BBTK_DECLARE_INPUT(I,int);
BBTK_DECLARE_INPUT(Value,T);
BBTK_DECLARE_OUTPUT(Vec,std::vector<T>);
- BBTK_PROCESS(DoIt);
+ BBTK_DECLARE_OUTPUT(PVec,std::vector<T>*);
+ BBTK_PROCESS(DoIt);
void DoIt();
};
//=================================================================
BBTK_TEMPLATE_INPUT(SetElementVector, I, "id-element (default 0)",int);
BBTK_TEMPLATE_INPUT(SetElementVector, Value, "Input Value",T);
BBTK_TEMPLATE_OUTPUT(SetElementVector,Vec,"Output Vector",std::vector<T>);
+ BBTK_TEMPLATE_OUTPUT(SetElementVector,PVec,"Pointer to Vector (the same as the input)",pTvector);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(SetElementVector);
//=================================================================
{
(*( bbGetInputPVec() ))[ bbGetInputI() ] = bbGetInputValue();
}
- bbSetOutputVec( *( bbGetInputPVec() ) );
-// bbSignalOutputModification(std::string("Vec"));
+ bbSetOutputVec( *( bbGetInputPVec() ) );
+ bbSetOutputPVec( bbGetInputPVec() );
+// bbSignalOutputModification(std::string("Vec"));
}
//=================================================================
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- if (bbGetInputIn().substr(bbGetInputIn().size()-5) == ".mhdb")
- {
- Read_mhdb( bbGetInputIn() );
- } else {
- FILE *ff = fopen( bbGetInputIn().c_str() , "r" );
- if (ff)
- {
- fclose(ff);
- vtkMetaImageReader *reader = vtkMetaImageReader::New();
- reader->SetFileName( bbGetInputIn().c_str() );
- reader->Update();
- bbSetOutputOut( reader->GetOutput() );
- } else {
- bbSetOutputOut(NULL);
- } // ff
- }// .mhdb
+ if (bbGetInputIn().length()!=0)
+ {
+ if (bbGetInputIn().substr(bbGetInputIn().size()-5) == ".mhdb")
+ {
+ Read_mhdb( bbGetInputIn() );
+ } else {
+ FILE *ff = fopen( bbGetInputIn().c_str() , "r" );
+ if (ff)
+ {
+ fclose(ff);
+ vtkMetaImageReader *reader = vtkMetaImageReader::New();
+ reader->SetFileName( bbGetInputIn().c_str() );
+ reader->Update();
+ bbSetOutputOut( reader->GetOutput() );
+ } else {
+ bbSetOutputOut(NULL);
+ } // ff
+ }// .mhdb
+ } else {
+ bbSetOutputOut(NULL);
+ } // if In.length
}
//=====
// _textActor->SetTextScaleModeToProp();
_textActor->SetPosition( px*spx , py*spy );
-printf("EED Text2D::Process px=%f py=%f\n",px,py);
-
// _textActor->SetPosition( 150,150 );
// _textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
// _textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
// textActor->GetPosition2Coordinate()->SetValue(0.6, 0.1);
- vtkTextProperty *tprop = _textActor->GetTextProperty();
- tprop->SetFontSize( bbGetInputFontSize() );
- tprop->SetFontFamilyToArial();
- tprop->SetJustificationToCentered();
-// tprop->BoldOn();
-// tprop->ItalicOn();
-// tprop->ShadowOn();
-
- if (bbGetInputColor().size()>=3)
- {
- tprop->SetColor( bbGetInputColor()[0] , bbGetInputColor()[1] , bbGetInputColor()[2] );
- }
-
- tprop->SetOpacity( bbGetInputOpacity() );
+ vtkTextProperty *tprop = _textActor->GetTextProperty();
+ tprop->SetFontSize( bbGetInputFontSize() );
+ tprop->SetFontFamilyToArial();
+ tprop->SetJustificationToCentered();
+ if (bbGetInputFontBold()==true) tprop->BoldOn(); else tprop->BoldOff();
+ if (bbGetInputFontItalic()==true) tprop->ItalicOn(); else tprop->ItalicOff();
+ if (bbGetInputFontShadow()==true) tprop->ShadowOn(); else tprop->ShadowOff();
+ if (bbGetInputColor().size()>=3)
+ {
+ tprop->SetColor( bbGetInputColor()[0] , bbGetInputColor()[1] , bbGetInputColor()[2] );
+ }
+ tprop->SetOpacity( bbGetInputOpacity() );
}
//=====
//=====
void Text2D::bbUserSetDefaultValues()
{
-
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
-
- _textActor=NULL;
- bbSetInputIn("VOID");
- bbSetInputOpacity(1);
- bbSetInputFontSize(14);
- std::vector<double> spc;
- spc.push_back(1);
- spc.push_back(1);
- spc.push_back(1);
- bbSetInputSpacing(spc);
- std::vector<double> color;
- color.push_back(0);
- color.push_back(0);
- color.push_back(1);
- bbSetInputColor(color);
-
- bbSetInputRenderer(NULL);
-
+ _textActor=NULL;
+ bbSetInputIn("VOID");
+ bbSetInputOpacity(1);
+ bbSetInputFontSize(14);
+ bbSetInputFontBold(false);
+ bbSetInputFontItalic(false);
+ bbSetInputFontShadow(false);
+ std::vector<double> spc;
+ spc.push_back(1);
+ spc.push_back(1);
+ spc.push_back(1);
+ bbSetInputSpacing(spc);
+ std::vector<double> color;
+ color.push_back(0);
+ color.push_back(0);
+ color.push_back(1);
+ bbSetInputColor(color);
+ bbSetInputRenderer(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)
BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
BBTK_DECLARE_INPUT(Opacity,double);
BBTK_DECLARE_INPUT(FontSize,int);
+ BBTK_DECLARE_INPUT(FontBold,bool);
+ BBTK_DECLARE_INPUT(FontItalic,bool);
+ BBTK_DECLARE_INPUT(FontShadow,bool);
BBTK_DECLARE_INPUT(Color,std::vector<double>);
BBTK_DECLARE_OUTPUT( Out , vtkProp* );
BBTK_PROCESS(Process);
BBTK_INPUT(Text2D,Opacity,"Pacity (default 1)",double,"");
BBTK_INPUT(Text2D,Renderer,"Vtk Rendere ",vtkRenderer*,"");
BBTK_INPUT(Text2D,FontSize,"Font size (default 14)",int,"");
+ BBTK_INPUT(Text2D,FontBold,"(default false) Bold true/false",bool,"");
+ BBTK_INPUT(Text2D,FontItalic,"(default false) Italic true/false",bool,"");
+ BBTK_INPUT(Text2D,FontShadow,"(default false) Shadow true/false",bool,"");
BBTK_INPUT(Text2D,Color,"vector color [r,g,b] (default [0,0,1])",std::vector<double>,"");
BBTK_OUTPUT(Text2D,Out,"vtk Prop",vtkProp*,"");
#if defined(_WIN32)
// Patch to put spaces at the beginin
#else
+ /*
// Patch to put spaces at the beginin
int strLength=-1;
// Looking for the longest string
lstIn[i]=" "+lstIn[i]; // spaces characters
} // for ii
} // for i
+ */
#endif // defined(_WIN32)
itemcontainer->Clear();
bbSetInputWidget7(NULL);
bbSetInputWidget8(NULL);
bbSetInputWidget9(NULL);
+ bbSetOutputSelection( 0 );
}
//-----------------------------------------------------------------