From: eduardo.davila@creatis.insa-lyon.fr Date: Tue, 22 Jul 2025 15:21:19 +0000 (+0200) Subject: #3537 Add box AddRendererToVector X-Git-Url: http://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e1885761bd92f095561fb1a76356205ba8d63501;p=bbtk.git #3537 Add box AddRendererToVector --- diff --git a/packages/std/src/bbstdVectorFilterDouble.h b/packages/std/src/bbstdVectorFilterDouble.h index 9595be2..64604c0 100644 --- a/packages/std/src/bbstdVectorFilterDouble.h +++ b/packages/std/src/bbstdVectorFilterDouble.h @@ -52,7 +52,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorFilterDouble,bbtk::AtomicBlackBox); BBTK_AUTHOR("InfoDev"); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); - BBTK_INPUT(VectorFilterDouble,Type,"default (0) 0=Erase duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition k1, 4=Substraction k1, 5=Multilication k1, 6=Division k1, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 , 9=Invert Vectors, 10=Nearest Point in the vector. In3PointXYZ In0LstX In1LstY In2LstZ (Out0-index Out1-PointXYZ), 11=Mul Spacing (K1[spcX,spcY,spcZ]=Spacing), 12=Div Spacing (K1[spcX,spcY,spcZ]=Spacing), 13=Distance pointIn0 and pontIn1, 14=Select specific segments [k1] in In0=lstPx In1=lstPy In2=lstPz In3=lstIndex (if k1 empty all segments are selected) , 15 swhitch element in a point k1=0 yz, k1=1 nothing k1=2 xz , 16 switch In0 and In1 (k1=1 nothing k0 swhich)",int,""); + BBTK_INPUT(VectorFilterDouble,Type,"default (0) 0=Erase duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition k1, 4=Substraction k1, 5=Multilication k1, 6=Division k1, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 (or the index k1 if exist) , 9=Invert Vectors, 10=Nearest Point in the vector. In3PointXYZ In0LstX In1LstY In2LstZ (Out0-index Out1-PointXYZ), 11=Mul Spacing (K1[spcX,spcY,spcZ]=Spacing), 12=Div Spacing (K1[spcX,spcY,spcZ]=Spacing), 13=Distance pointIn0 and pontIn1, 14=Select specific segments [k1] in In0=lstPx In1=lstPy In2=lstPz In3=lstIndex (if k1 empty all segments are selected) , 15 swhitch element in a point k1=0 yz, k1=1 nothing k1=2 xz , 16 switch In0 and In1 (k1=0 nothing, k1=1 swhich)",int,""); BBTK_INPUT(VectorFilterDouble,k1,"(default [0]) nothing (Type0), k1[0]=new size vectors (Type 1) , nothing (Type2), k1[0] = Addition const. (Type 3), k1[0] = Substraction const. (Type 4), k1[0] = Multiplication const. (Type 5) , k1[0] = Division const. (Type 6), k1[0] In0..9 element base to be order (Type 8) , k1[spcX,spcY,spcZ] MulSpc In0_X,In1_Y,In2_Z (type 11), k1[spcX,spcY,spcZ] DivSpc In0_X,In1_Y,In2_Z (type 12) , k1[segment1, segment2,..] (type 14) , direction (type 15), direction (type 16) ",std::vector,""); BBTK_INPUT(VectorFilterDouble,In0,"Input vector",std::vector,""); BBTK_INPUT(VectorFilterDouble,In1,"Input vector",std::vector,""); diff --git a/packages/vtk/src/bbvtkAddImageToVector.cxx b/packages/vtk/src/bbvtkAddImageToVector.cxx index 450fa0e..70f41ef 100644 --- a/packages/vtk/src/bbvtkAddImageToVector.cxx +++ b/packages/vtk/src/bbvtkAddImageToVector.cxx @@ -14,7 +14,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(AddImageToVector,bbtk::AtomicBlackBox); //===== void AddImageToVector::Process() { - // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value @@ -42,12 +41,12 @@ void AddImageToVector::Process() if (bbGetInputIn9()!=NULL) { lstImages.push_back( bbGetInputIn9() ); } bbSetOutputOut(lstImages); } -//===== + +//===== // 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 AddImageToVector::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputIn0(NULL); @@ -63,32 +62,29 @@ void AddImageToVector::bbUserSetDefaultValues() std::vector lstImages; bbSetInputImageVector(lstImages); } -//===== + +//===== // 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 AddImageToVector::bbUserInitializeProcessing() { - // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers -// if any - - +// 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 AddImageToVector::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any - -} } -// EO namespace bbvtk + +} // EO namespace bbvtk diff --git a/packages/vtk/src/bbvtkAddRendererToVector.cxx b/packages/vtk/src/bbvtkAddRendererToVector.cxx new file mode 100644 index 0000000..30c4e18 --- /dev/null +++ b/packages/vtk/src/bbvtkAddRendererToVector.cxx @@ -0,0 +1,90 @@ +//===== +// 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 "bbvtkAddRendererToVector.h" +#include "bbvtkPackage.h" + +namespace bbvtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,AddRendererToVector) +BBTK_BLACK_BOX_IMPLEMENTATION(AddRendererToVector,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 AddRendererToVector::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 = " < lstRenderer=bbGetInputRendererVector(); + if (bbGetInputIn0()!=NULL) { lstRenderer.push_back( bbGetInputIn0() ); } + if (bbGetInputIn1()!=NULL) { lstRenderer.push_back( bbGetInputIn1() ); } + if (bbGetInputIn2()!=NULL) { lstRenderer.push_back( bbGetInputIn2() ); } + if (bbGetInputIn3()!=NULL) { lstRenderer.push_back( bbGetInputIn3() ); } + if (bbGetInputIn4()!=NULL) { lstRenderer.push_back( bbGetInputIn4() ); } + if (bbGetInputIn5()!=NULL) { lstRenderer.push_back( bbGetInputIn5() ); } + if (bbGetInputIn6()!=NULL) { lstRenderer.push_back( bbGetInputIn6() ); } + if (bbGetInputIn7()!=NULL) { lstRenderer.push_back( bbGetInputIn7() ); } + if (bbGetInputIn8()!=NULL) { lstRenderer.push_back( bbGetInputIn8() ); } + if (bbGetInputIn9()!=NULL) { lstRenderer.push_back( bbGetInputIn9() ); } + bbSetOutputOut(lstRenderer); +} + +//===== +// 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 AddRendererToVector::bbUserSetDefaultValues() +{ +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn0(NULL); + bbSetInputIn1(NULL); + bbSetInputIn2(NULL); + bbSetInputIn3(NULL); + bbSetInputIn4(NULL); + bbSetInputIn5(NULL); + bbSetInputIn6(NULL); + bbSetInputIn7(NULL); + bbSetInputIn8(NULL); + bbSetInputIn9(NULL); + std::vector lstRenderer; + bbSetInputRendererVector(lstRenderer); +} + +//===== +// 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 AddRendererToVector::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 AddRendererToVector::bbUserFinalizeProcessing() +{ +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any +} + +} // EO namespace bbvtk + + diff --git a/packages/vtk/src/bbvtkAddRendererToVector.h b/packages/vtk/src/bbvtkAddRendererToVector.h new file mode 100644 index 0000000..0532ed6 --- /dev/null +++ b/packages/vtk/src/bbvtkAddRendererToVector.h @@ -0,0 +1,67 @@ +//===== +// 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 __bbvtkAddRendererToVector_h_INCLUDED__ +#define __bbvtkAddRendererToVector_h_INCLUDED__ +#include "bbvtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkRenderer.h" + +namespace bbvtk +{ + +class bbvtk_EXPORT AddRendererToVector + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(AddRendererToVector,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(RendererVector,std::vector); + BBTK_DECLARE_INPUT(In0,vtkRenderer*); + BBTK_DECLARE_INPUT(In1,vtkRenderer*); + BBTK_DECLARE_INPUT(In2,vtkRenderer*); + BBTK_DECLARE_INPUT(In3,vtkRenderer*); + BBTK_DECLARE_INPUT(In4,vtkRenderer*); + BBTK_DECLARE_INPUT(In5,vtkRenderer*); + BBTK_DECLARE_INPUT(In6,vtkRenderer*); + BBTK_DECLARE_INPUT(In7,vtkRenderer*); + BBTK_DECLARE_INPUT(In8,vtkRenderer*); + BBTK_DECLARE_INPUT(In9,vtkRenderer*); + BBTK_DECLARE_OUTPUT(Out,std::vector); + 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(AddRendererToVector,bbtk::AtomicBlackBox); +BBTK_NAME("AddRendererToVector"); +BBTK_AUTHOR("Info-Dev"); +BBTK_DESCRIPTION("eduardo.davila@creatis.insa-lyon.fr - Concat at the end of the ImageVector all the inputs. Add vtkRenderer* to a vector fo vtkRenderer*"); +BBTK_CATEGORY("void"); +BBTK_INPUT(AddRendererToVector,RendererVector,"Vector of vtkImagesData*",std::vector,""); +BBTK_INPUT(AddRendererToVector,In0,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In1,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In2,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In3,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In4,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In5,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In6,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In7,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In8,"Input image 1",vtkRenderer*,""); +BBTK_INPUT(AddRendererToVector,In9,"Input image 1",vtkRenderer*,""); +BBTK_OUTPUT(AddRendererToVector,Out,"Vector of vtkRenderer*",std::vector,""); +BBTK_END_DESCRIBE_BLACK_BOX(AddRendererToVector); +//===== +// 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 bbvtk + +#endif // __bbvtkAddRendererToVector_h_INCLUDED__ + diff --git a/packages/vtk/src/bbvtkGetVectorElement.cxx b/packages/vtk/src/bbvtkGetVectorElement.cxx index 818e5e7..9a43bfb 100644 --- a/packages/vtk/src/bbvtkGetVectorElement.cxx +++ b/packages/vtk/src/bbvtkGetVectorElement.cxx @@ -51,6 +51,7 @@ namespace bbvtk BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(vtk,GetVectorElement,ptrvtkImageData); BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(vtk,GetVectorElement,ptrvtkPolyData); +BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(vtk,GetVectorElement,ptrvtkRenderer); //==================================================================== diff --git a/packages/vtk/src/bbvtkGetVectorElement.h b/packages/vtk/src/bbvtkGetVectorElement.h index 6a766dc..47746ba 100644 --- a/packages/vtk/src/bbvtkGetVectorElement.h +++ b/packages/vtk/src/bbvtkGetVectorElement.h @@ -41,6 +41,7 @@ #include "vtkImageData.h" #include "vtkPolyData.h" +#include "vtkRenderer.h" namespace bbvtk { @@ -61,7 +62,8 @@ namespace bbvtk typedef vtkImageData* ptrvtkImageData; - typedef vtkPolyData* ptrvtkPolyData; + typedef vtkPolyData* ptrvtkPolyData; + typedef vtkRenderer* ptrvtkRenderer; // BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME( ptrvtkImageData ,"PtrvtkImageData"); // BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME( ptrvtkPolyData ,"PtrvtkPolyData"); @@ -73,9 +75,10 @@ namespace bbvtk BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorElement,bbtk::AtomicBlackBox); std::string humantypename; - if (bbtk::HumanTypeName()==bbtk::HumanTypeName()) { humantypename="VtkPolyData"; } + if (bbtk::HumanTypeName()==bbtk::HumanTypeName()) { humantypename="VtkPolyData"; } if (bbtk::HumanTypeName()==bbtk::HumanTypeName()) { humantypename="VtkImageData"; } - + if (bbtk::HumanTypeName()==bbtk::HumanTypeName()) { humantypename="VtkRenderer"; } + BBTK_NAME("GetVector"+humantypename+"Element"); // BBTK_NAME("GetVector"+bbtk::HumanTypeName()+"Element");