1 #include "bbvtkBinaryOperations.h"
2 #include "bbvtkPackage.h"
7 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,BinaryOperations)
8 BBTK_BLACK_BOX_IMPLEMENTATION(BinaryOperations,bbtk::AtomicBlackBox);
9 void BinaryOperations::Process()
12 // THE MAIN PROCESSING METHOD BODY
13 // Here we simply set the input 'In' value to the output 'Out'
14 // And print out the output value
15 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
16 // void bbSet{Input|Output}NAME(const TYPE&)
17 // const TYPE& bbGet{Input|Output}NAME() const
19 // * NAME is the name of the input/output
20 // (the one provided in the attribute 'name' of the tag 'input')
21 // * TYPE is the C++ type of the input/output
22 // (the one provided in the attribute 'type' of the tag 'input')
24 if (bbGetInputIn1() == NULL)
26 std::cout << "Set In1 at least" << std::endl;
30 ope->SetInput1((vtkDataObject*)bbGetInputIn1());
32 if (bbGetInputIn2() != NULL)
34 ope->SetInput2((vtkDataObject*)bbGetInputIn2());
39 std::cout << "Set In2" << std::endl;
45 switch (bbGetInputOperation())
48 ope->SetOperationToAdd();
51 ope->SetOperationToSubtract();
55 ope->SetOperationToMultiply();
58 ope->SetOperationToDivide();
61 std::cout << "Invalid Operation" << std::endl;
67 vtkImageData* salida = ope->GetOutput();
69 bbSetOutputOut(salida);
70 bbSignalOutputModification();
75 void BinaryOperations::bbUserSetDefaultValues()
78 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
79 // Here we initialize the input 'In' to 0
83 bbSetInputOperation(0);
84 ope = vtkImageMathematics::New();
88 void BinaryOperations::bbUserInitializeProcessing()
91 // THE INITIALIZATION METHOD BODY :
93 // but this is where you should allocate the internal/output pointers
99 void BinaryOperations::bbUserFinalizeProcessing()
102 // THE FINALIZATION METHOD BODY :
104 // but this is where you should desallocate the internal/output pointers
109 // EO namespace bbvtk