1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 #include "bbmaracasvisuShowNPoints.h"
27 #include "bbcreaMaracasVisuPackage.h"
30 namespace bbcreaMaracasVisu
34 //------------------------------------------------------------------------
35 //------------------------------------------------------------------------
36 //------------------------------------------------------------------------
37 //------------------------------------------------------------------------
38 WidgetShowNPointsBox::WidgetShowNPointsBox(wxWindow *parent, bbcreaMaracasVisu::ShowNPoints *box, int type)
39 : WidgetShowNPoints( parent, type)
44 //------------------------------------------------------------------------
45 WidgetShowNPointsBox::~WidgetShowNPointsBox()
50 //------------------------------------------------------------------------
51 void WidgetShowNPointsBox::UpdatePoints(wxCommandEvent &event)
53 printf("EED WidgetShowNPointsBox::UpdatePoints start\n");
54 WidgetShowNPoints::UpdatePoints(event);
55 //Difference in Radio for text placement
56 // double radio=GetModelShowNPoints()->GetRadio();
57 // this->mopacity = sdrOpacity->GetValue()/100.0;
58 // GetModelShowNPoints()->SetRadio( sdrRadio->GetValue() ) ;
59 // radio = sdrRadio->GetValue();
60 //NTU refresh the inputs
61 mbbShowNPoints->bbSetInputOpacity( GetOpacity() );
62 mbbShowNPoints->bbSetInputRadio( GetRadio() );
65 printf("EED WidgetShowNPointsBox::UpdatePoints end\n");
70 //------------------------------------------------------------------------
71 void WidgetShowNPointsBox::SetOutputBox()
73 WidgetShowNPoints::SetOutputBox();
76 // strTmp.Printf(_T("Nbr of points: %d"), GetModelShowNPoints()->GetLstPointsSize() );
77 // txtNrPoints->SetLabel( strTmp );
80 mbbShowNPoints->bbSetOutputlstPointsX( GetModelShowNPoints()->GetLstPointsX() );
81 mbbShowNPoints->bbSetOutputlstPointsY( GetModelShowNPoints()->GetLstPointsY() );
82 mbbShowNPoints->bbSetOutputlstPointsZ( GetModelShowNPoints()->GetLstPointsZ() );
83 mbbShowNPoints->bbSetOutputlstLabels( GetModelShowNPoints()->GetLstLabels() );
84 mbbShowNPoints->bbSignalOutputModification();
89 //------------------------------------------------------------------------
90 //------------------------------------------------------------------------
91 //------------------------------------------------------------------------
92 //------------------------------------------------------------------------
97 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ShowNPoints)
98 BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox);
100 //-----------------------------------------------------------------
101 void ShowNPoints::Process()
105 mwxwidget->SetRenderer( bbGetInputRenderer() );
106 mwxwidget->SetReferencePoint( bbGetInputIn() );
107 mwxwidget->SetImage( bbGetInputImage() );
108 mwxwidget->SetColour( bbGetInputColour() );
109 mwxwidget->SetOpacity( bbGetInputOpacity() );
110 mwxwidget->SetRadio( bbGetInputRadio() );
112 if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==true )
114 mwxwidget->GetModelShowNPoints()->SetFirstTime(false);
115 mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() );
118 bbSetOutputlstPointsX( mwxwidget->GetModelShowNPoints()->GetLstPointsX() );
119 bbSetOutputlstPointsY( mwxwidget->GetModelShowNPoints()->GetLstPointsY() );
120 bbSetOutputlstPointsZ( mwxwidget->GetModelShowNPoints()->GetLstPointsZ() );
121 bbSetOutputlstLabels( mwxwidget->GetModelShowNPoints()->GetLstLabels() );
122 bbSetOutputWidgetShowNPoints( (WidgetShowNPoints*)mwxwidget );
126 //-----------------------------------------------------------------
127 void ShowNPoints::CreateWidget(wxWindow* parent)
129 mwxwidget = new WidgetShowNPointsBox( parent, this, bbGetInputType() );
130 bbSetOutputWidget( mwxwidget );
133 //-----------------------------------------------------------------
134 void ShowNPoints::bbUserSetDefaultValues()
138 bbSetInputOpacity(1);
139 std::vector<double> colour;
140 colour.push_back(1.0);
141 colour.push_back(0.0);
142 colour.push_back(0.0);
143 bbSetInputColour(colour);
144 bbSetInputImage(NULL);
146 bbSetInputRenderer(NULL);
147 bbSetOutputWidgetShowNPoints(NULL);
150 //-----------------------------------------------------------------
151 void ShowNPoints::bbUserInitializeProcessing()
155 //-----------------------------------------------------------------
156 void ShowNPoints::bbUserFinalizeProcessing()
160 //-----------------------------------------------------------------
163 // EO namespace bbcreaMaracasVisu