]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuVolumeRendering.cxx
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuVolumeRendering.cxx
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #include "bbcreaMaracasVisuVolumeRendering.h"
27 #include "bbcreaMaracasVisuPackage.h"
28
29 #include "wxMaracasMultipleVolumeRendererView.h"
30
31 namespace bbcreaMaracasVisu
32 {
33
34         BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,VolumeRendering)
35         BBTK_BLACK_BOX_IMPLEMENTATION(VolumeRendering,bbtk::WxBlackBox);
36         void VolumeRendering::Process()
37         {
38          
39         // THE MAIN PROCESSING METHOD BODY 
40         //   Here we simply set the input 'In' value to the output 'Out' 
41         //   And print out the output value 
42         // INPUT/OUTPUT ACCESSORS ARE OF THE FORM : 
43         //    void bbSet{Input|Output}NAME(const TYPE&) 
44         //    const TYPE& bbGet{Input|Output}NAME() const  
45         //    Where : 
46         //    * NAME is the name of the input/output 
47         //      (the one provided in the attribute 'name' of the tag 'input') 
48         //    * TYPE is the C++ type of the input/output 
49         //      (the one provided in the attribute 'type' of the tag 'input') 
50                 wxMaracasMultipleVolumeRendererView* volview = (wxMaracasMultipleVolumeRendererView*)bbGetOutputWidget();
51                 vtkImageData* _img1 = bbGetInputIn0();
52                 vtkImageData* _img2 = bbGetInputIn1();
53                 vtkImageData* _img3 = bbGetInputIn2();
54                 vtkImageData* _img4 = bbGetInputIn3();
55                 vtkRenderer* renderer = bbGetInputRenderer();
56
57                 if(volview!=NULL){
58                         if(renderer!=NULL&&_currentrenderer != renderer){
59                                 volview->setRenderer(renderer);                 
60                                 _currentrenderer = renderer;
61                         }
62                         if(_currentrenderer!=NULL){
63                                 if(_img1 !=NULL){
64                                 volview->addVolume(_img1, "INPUT 1");
65                                 }
66                                 if(_img2 !=NULL){
67                                         volview->addVolume(_img2, "INPUT 2");
68                                 }
69                                 if(_img3 !=NULL){
70                                         volview->addVolume(_img3, "INPUT 3");
71                                 }
72                                 if(_img4 !=NULL){
73                                         volview->addVolume(_img4, "INPUT 4");
74                                 }
75                         }       
76                 }
77
78                         //vtkImageData* img1 = ;
79
80                         /*bbSetOutputOut0(volview->GetOutputImages()[0]);
81                         bbSetOutputOut1(volview->GetOutputImages()[1]);
82                         bbSetOutputOut2(volview->GetOutputImages()[2]);
83                         bbSetOutputOut3(volview->GetOutputImages()[3]);*/
84
85         }
86         void VolumeRendering::CreateWidget(wxWindow* parent)
87         {
88                 wxMaracasMultipleVolumeRendererView* volview = wxMaracasMultipleVolumeRendererView::getInstance(parent);
89                 bbSetOutputWidget(volview);
90         }
91         void VolumeRendering::bbUserSetDefaultValues()
92         {
93          
94         //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX  
95         //  Here we initialize the input 'In' to 0 
96                 bbSetInputIn0(0); 
97                 bbSetInputIn1(0); 
98                 bbSetInputIn2(0); 
99                 bbSetInputIn3(0); 
100                 bbSetInputRenderer(0);  
101
102                 bbSetOutputOut0(NULL);
103                 bbSetOutputOut1(NULL);
104                 bbSetOutputOut2(NULL);
105                 bbSetOutputOut3(NULL);
106           
107         }
108         void VolumeRendering::bbUserInitializeProcessing()
109         { 
110                 _currentrenderer = NULL;
111         }
112         void VolumeRendering::bbUserFinalizeProcessing()
113         {
114          
115         //  THE FINALIZATION METHOD BODY : 
116         //    Here does nothing  
117         //    but this is where you should desallocate the internal/output pointers  
118         //    if any 
119           
120         }
121 }
122 // EO namespace bbcreaMaracasVisu
123
124