1 #include "bbcreaMaracasVisuVolumeRendering.h"
2 #include "bbcreaMaracasVisuPackage.h"
4 #include "wxMaracasMultipleVolumeRendererView.h"
6 namespace bbcreaMaracasVisu
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,VolumeRendering)
10 BBTK_BLACK_BOX_IMPLEMENTATION(VolumeRendering,bbtk::WxBlackBox);
11 void VolumeRendering::Process()
14 // THE MAIN PROCESSING METHOD BODY
15 // Here we simply set the input 'In' value to the output 'Out'
16 // And print out the output value
17 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
18 // void bbSet{Input|Output}NAME(const TYPE&)
19 // const TYPE& bbGet{Input|Output}NAME() const
21 // * NAME is the name of the input/output
22 // (the one provided in the attribute 'name' of the tag 'input')
23 // * TYPE is the C++ type of the input/output
24 // (the one provided in the attribute 'type' of the tag 'input')
25 wxMaracasMultipleVolumeRendererView* volview = (wxMaracasMultipleVolumeRendererView*)bbGetOutputWidget();
26 vtkImageData* _img1 = bbGetInputIn0();
27 vtkImageData* _img2 = bbGetInputIn1();
28 vtkImageData* _img3 = bbGetInputIn2();
29 vtkImageData* _img4 = bbGetInputIn3();
30 vtkRenderer* renderer = bbGetInputRenderer();
33 if(renderer!=NULL&&_currentrenderer != renderer){
34 volview->setRenderer(renderer);
35 _currentrenderer = renderer;
37 if(_currentrenderer!=NULL){
39 volview->addVolume(_img1, "INPUT 1");
42 volview->addVolume(_img2, "INPUT 2");
45 volview->addVolume(_img3, "INPUT 3");
48 volview->addVolume(_img4, "INPUT 4");
52 vtkImageData* img1 = volview->GetOutputImages()[0];
54 bbSetOutputOut0(img1);
55 bbSetOutputOut1(volview->GetOutputImages()[1]);
56 bbSetOutputOut2(volview->GetOutputImages()[2]);
57 bbSetOutputOut3(volview->GetOutputImages()[3]);
64 void VolumeRendering::CreateWidget(wxWindow* parent)
66 wxMaracasMultipleVolumeRendererView* volview = wxMaracasMultipleVolumeRendererView::getInstance(parent);
67 bbSetOutputWidget(volview);
69 void VolumeRendering::bbUserSetDefaultValues()
72 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
73 // Here we initialize the input 'In' to 0
78 bbSetInputRenderer(0);
81 void VolumeRendering::bbUserInitializeProcessing()
83 _currentrenderer = NULL;
85 void VolumeRendering::bbUserFinalizeProcessing()
88 // THE FINALIZATION METHOD BODY :
90 // but this is where you should desallocate the internal/output pointers
95 // EO namespace bbcreaMaracasVisu