2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
31 Module: $RCSfile: bbkwViewer3D.cxx,v $
33 Date: $Date: 2012/11/16 08:51:05 $
34 Version: $Revision: 1.2 $
36 =========================================================================*/
43 #ifdef _USE_WXWIDGETS_
46 #include "bbkwViewer3D.h"
47 #include "bbkwPackage.h"
49 #include "vtkKWRenderWidget.h"
54 BBTK_ADD_BLACK_BOX_TO_PACKAGE(kw,kwViewer3D);
55 BBTK_BLACK_BOX_IMPLEMENTATION(kwViewer3D,bbtk::KWBlackBox);
57 void kwViewer3D::bbUserConstructor()
69 bbSetOutputWidget(NULL);
72 void kwViewer3D::bbUserDestructor()
75 vtkKWRenderWidget* w = (vtkKWRenderWidget*)bbGetOutputWidget();
83 void kwViewer3D::Process()
85 vtkKWRenderWidget* w = (vtkKWRenderWidget*)bbGetOutputWidget();
88 if ( (bbGetInputIn1()!=NULL) &&
89 (bbGetInputStatus("In1")!=bbtk::UPTODATE))
91 w->AddViewProp(bbGetInputIn1());
93 if ( (bbGetInputIn2()!=NULL) &&
94 (bbGetInputStatus("In2")!=bbtk::UPTODATE))
96 w->AddViewProp(bbGetInputIn2());
98 if ( (bbGetInputIn3()!=NULL) &&
99 (bbGetInputStatus("In3")!=bbtk::UPTODATE))
101 w->AddViewProp(bbGetInputIn3());
103 if ( (bbGetInputIn4()!=NULL) &&
104 (bbGetInputStatus("In4")!=bbtk::UPTODATE))
106 w->AddViewProp(bbGetInputIn4());
108 if ( (bbGetInputIn5()!=NULL) &&
109 (bbGetInputStatus("In5")!=bbtk::UPTODATE))
111 w->AddViewProp(bbGetInputIn5());
119 void kwViewer3D::CreateWidget(vtkKWFrame* parent)
121 vtkKWRenderWidget *w = vtkKWRenderWidget::New();
122 bbSetOutputWidget(w);
123 w->SetParent((vtkKWWidget*)parent);
125 w->SetRenderModeToInteractive();
130 vtkRenderWindowInteractor *interactor = w->GetInteractor();
131 if (interactor!=NULL)
133 if (bbGetInputObs1()!=NULL)
135 bbGetInputObs1()->SetInteractor(interactor);
136 bbGetInputObs1()->EnabledOn();
138 if (bbGetInputObs2()!=NULL)
140 bbGetInputObs2()->SetInteractor(interactor);
141 bbGetInputObs2()->EnabledOn();
143 if (bbGetInputObs3()!=NULL)
145 bbGetInputObs3()->SetInteractor(interactor);
146 bbGetInputObs3()->EnabledOn();
148 if (bbGetInputObs4()!=NULL)
150 bbGetInputObs4()->SetInteractor(interactor);
151 bbGetInputObs4()->EnabledOn();
153 if (bbGetInputObs5()!=NULL)
155 bbGetInputObs5()->SetInteractor(interactor);
156 bbGetInputObs5()->EnabledOn();
158 bbSetOutputInteractor( w->GetInteractor() );