]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx
#3162 creaMaracasVisu Bug New Normal - Threshold layer
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / WidgetShowNPoints.cxx
1
2
3 #include "vtkActor.h"
4 #include "vtkSphereSource.h"
5 #include "vtkRenderer.h"
6 #include "vtkTextActor3D.h"
7
8
9 #include "vtkProperty.h"
10 #include "vtkPolyDataMapper.h"
11 #include "vtkRenderWindow.h"
12 #include <vtkTextProperty.h>
13
14 #include <wx/button.h>
15 #include <wx/sizer.h>
16 #include <wx/filedlg.h>
17 #include <wx/msgdlg.h>
18
19 #include "WidgetShowNPoints.h"
20
21
22 //----------------------------------------------------------------------
23 //----------------------------------------------------------------------
24 //----------------------------------------------------------------------
25 //----------------------------------------------------------------------
26 //----------------------------------------------------------------------
27   WidgetShowNPoints::WidgetShowNPoints(wxWindow *parent, int type)
28     : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
29   {
30         mmodelShowNPoints                               = new ModelShowNPoints();
31     mtype                                                       = type;
32     SetType(mtype);
33     this->renderer                                      = NULL;
34     wxPanel     *panel                                  = this;
35     wxSizer *sizer                                      = NULL;
36
37         if ((mtype==0) || (mtype==3))
38         {
39                 // Widget interface
40                 askPointLabel                                   = new wxStaticText(panel, -1, _T("Point label :")); // JPR
41                 textCtrl                                                = new wxTextCtrl(panel, -1);
42                 wxButton *btnAddPoint                   = new wxButton( panel, -1, _T("Add Point"));
43                 wxButton *btnInsertPoint                = new wxButton( panel, -1, _T("Insert Point"));//CFT
44                 wxButton *btnSetPositionPoint   = new wxButton( panel, -1, _T("Set nearest point"));
45                 wxButton *btnRenamePoint                = new wxButton( panel, -1, _T("Rename point"));
46                 wxButton *btnEraseLastPoint             = new wxButton( panel, -1, _T("Erase Last point"));
47                 wxButton *btnErasePoint                 = new wxButton( panel, -1, _T("Erase point"));
48                 wxButton *btnDeleteAllPoints    = new wxButton( panel, -1, _T("Delete all points"));
49                 wxButton *btnSavePoints                 = NULL;
50                 wxButton *btnLoadPoints                 = NULL;
51                 if (mtype==0)
52                 {
53                         btnSavePoints                           = new wxButton( panel, -1, _T("Save points"));
54                         btnLoadPoints                           = new wxButton( panel, -1, _T("Load points"));
55                 }
56                 txtNrPoints                                             = new wxStaticText(panel,-1, _T(" "));
57
58                 //NTU: Sliders for opacity and radio change
59                 wxStaticText* txOpacity = new wxStaticText(this, -1, wxString(_T("  Points Opacity  ")));
60                 sdrOpacity = new wxSlider(this, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
61                 wxStaticText* txRadio = new wxStaticText(this, -1, wxString(_T("  Points Radio  ")));
62                 sdrRadio = new wxSlider(this, -1, 0, 1, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
63
64                 wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1);
65                 //    sizer1->Add(new wxStaticText(panel,-1,_T("  ")));
66
67                 Connect(btnAddPoint->GetId()            , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnAddPoint);
68                 Connect(btnInsertPoint->GetId()         , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnInsertPoint);//CFT
69                 Connect(btnSetPositionPoint->GetId(), wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint);
70                 Connect(btnRenamePoint->GetId()         , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnRenamePoint);
71                 Connect(btnEraseLastPoint->GetId()      , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnEraseLastPoint);
72                 Connect(btnErasePoint->GetId()          , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnErasePoint);
73                 Connect(btnDeleteAllPoints->GetId()     , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnDeleteAllPoints);
74                 if (mtype==0)
75                 {
76                         Connect(btnSavePoints->GetId()          , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnSavePoints);
77                         Connect(btnLoadPoints->GetId()          , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnLoadPoints);
78                 }
79                 //NTU: Slider events
80                 Connect(sdrOpacity->GetId()                     , wxEVT_COMMAND_SLIDER_UPDATED  , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
81                 Connect(sdrRadio->GetId()                       , wxEVT_COMMAND_SLIDER_UPDATED  , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
82
83                 sizer1->Add(askPointLabel); // JPR
84                 sizer1->Add(textCtrl);
85                 sizer1->Add(btnAddPoint);
86                 sizer1->Add(btnInsertPoint);//CFT
87                 sizer1->Add(btnSetPositionPoint);
88                 sizer1->Add(btnRenamePoint);
89                 sizer1->Add(btnErasePoint);
90                 sizer1->Add(btnEraseLastPoint);
91                 sizer1->Add(btnDeleteAllPoints);
92                 sizer1->Add(txtNrPoints);
93                 sizer1->Add(txOpacity);
94                 sizer1->Add(sdrOpacity,1,wxGROW );
95                 sizer1->Add(txRadio);
96                 sizer1->Add(sdrRadio,1,wxGROW );
97                 if (mtype==0)
98                 {
99                         sizer1->Add(btnSavePoints);
100                         sizer1->Add(btnLoadPoints);
101                 }
102                 sizer = sizer1;
103         }
104
105           if (mtype==1)
106           {
107                   // Widget interface
108                   wxButton *btnSetPositionPoint         = new wxButton( panel, -1, _T("Set nearest point"));
109                   txtNrPoints                                           = new wxStaticText(panel,-1, _T(" "));
110
111                   //NTU: Sliders for opacity and radio change
112                   wxStaticText* txOpacity                       = new wxStaticText(this, -1, wxString(_T("  Points Opacity  ")));
113                   sdrOpacity                                            = new wxSlider(this, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
114                   wxStaticText* txRadio                         = new wxStaticText(this, -1, wxString(_T("  Points Radio  ")));
115                   sdrRadio                                                      = new wxSlider(this, -1, 0, 1, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
116                   wxFlexGridSizer *sizer1                       = new wxFlexGridSizer(1);
117                   Connect(btnSetPositionPoint->GetId()  , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint);
118                   Connect(sdrOpacity->GetId()   , wxEVT_COMMAND_SLIDER_UPDATED  , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
119                   Connect(sdrRadio->GetId()     , wxEVT_COMMAND_SLIDER_UPDATED  , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
120
121                   sizer1->Add(btnSetPositionPoint);
122                   sizer1->Add(txtNrPoints);
123                   sizer1->Add(txOpacity);
124                   sizer1->Add(sdrOpacity,1,wxGROW );
125                   sizer1->Add(txRadio);
126                   sizer1->Add(sdrRadio,1,wxGROW );
127                   sizer = sizer1;
128           }
129     
130     if (mtype == 2) 
131         {
132                 askPointLabel                                           = new wxStaticText(panel, -1, _T("\nPOINT CONTROLS:")); // JPR
133         wxButton                *btnAddPoint            = new wxButton(panel, -1,        _T("      Add  Point      "));
134         wxButton                *btnDeleteAllPoints = new wxButton(panel, -1, _T("      Delete All      "));
135         wxStaticText    *spacer                         = new wxStaticText(panel, -1, _T("\n")); // JPR
136                                          textCtrl                       = new wxTextCtrl(panel, -1);
137         wxFlexGridSizer *sizer1                         = new wxFlexGridSizer(1);
138         Connect(btnAddPoint->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnAddPoint);
139         Connect(btnDeleteAllPoints->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnDeleteAllPoints);    
140         sizer1->Add(askPointLabel); 
141         sizer1->Add(btnAddPoint);
142         sizer1->Add(btnDeleteAllPoints);
143         sizer1->Add(spacer);
144         sizer1->Add(textCtrl);
145         sdrOpacity = new wxSlider();
146         sdrRadio = new wxSlider();
147         txtNrPoints = new wxStaticText(panel, -1, _T("\n\n\n"));
148         sizer = sizer1;
149         } // bbGetInputType 2
150
151         if (sizer!=NULL)
152         {
153                 panel->SetSizer(sizer);
154                 panel->SetAutoLayout(true);
155                 panel->Layout();
156         } // if sizer
157 }
158
159 //------------------------------------------------------------------------
160 WidgetShowNPoints::~WidgetShowNPoints()
161 {
162 }
163
164 //------------------------------------------------------------------------
165 ModelShowNPoints* WidgetShowNPoints::GetModelShowNPoints()
166 {
167         return mmodelShowNPoints;
168 }
169
170
171 //------------------------------------------------------------------------
172 void WidgetShowNPoints::SetRadio(double radio)
173 {
174         GetModelShowNPoints()->SetRadio(radio);
175         //NTU: For Slider
176         sdrRadio->SetValue(radio);
177 }
178
179 //------------------------------------------------------------------------
180 void WidgetShowNPoints::SetColour(std::vector<double> colour)
181 {
182         this->mcolour = colour;
183 }
184
185 //------------------------------------------------------------------------
186 void WidgetShowNPoints::SetImage(vtkImageData* image)
187 {
188         GetModelShowNPoints()->SetImage(image);
189 }
190
191 //------------------------------------------------------------------------
192 void WidgetShowNPoints::SetOpacity(double opacity)
193 {
194         this->mopacity=opacity;
195         //NTU: For Slider
196         sdrOpacity->SetValue(this->mopacity*100.0);
197 }
198
199
200 //------------------------------------------------------------------------
201 void  WidgetShowNPoints::SetRenderer(vtkRenderer *renderer)
202 {
203         this->renderer  = renderer;
204 }
205         
206 //------------------------------------------------------------------------
207         
208 void WidgetShowNPoints::RefreshPoint(int id)
209 {
210         double spc[3];
211
212 //EED 2016/06/17
213 //      mimage->GetSpacing(spc);
214 //      int x = lstPointsX[id];
215 //      int y = lstPointsY[id];
216 //      int z = lstPointsZ[id];
217         int x,y,z;
218         GetModelShowNPoints()->GetIdPoint(id,&x,&y,&z);
219         GetModelShowNPoints()->GetImage()->GetSpacing(spc);
220         std::string label       = GetModelShowNPoints()->GetIdLabel(id);
221         double radio            = GetModelShowNPoints()->GetRadio();
222
223         lstActorsSphere[id]->SetPosition( spc[0]*x , spc[1]*y , spc[2]*z );
224         lstActorsSphere[id]->GetProperty()->SetColor( mcolour[0] , mcolour[1] , mcolour[2] );
225         lstActorsSphere[id]->GetProperty()->SetOpacity( mopacity );
226         lstSourceSphere[id]->SetRadius( radio );
227
228         lstActorsText[id]->SetInput( label.c_str()  );
229         lstActorsText[id]->SetPosition(  radio+spc[0]*x , spc[1]*y , spc[2]*z );
230 }
231
232 //------------------------------------------------------------------------
233 void WidgetShowNPoints::RefreshPoints()
234 {
235         int id,size=lstActorsSphere.size();
236         for (id=0;id<size;id++)
237         {
238                 RefreshPoint(id);
239         } // for
240         renderer->GetRenderWindow()->Render();
241 }
242
243 //------------------------------------------------------------------------
244 void WidgetShowNPoints::AddVtkPoint()
245 {
246         // Sphere
247         vtkSphereSource *vtksphere = vtkSphereSource::New();
248         vtksphere->SetThetaResolution (20);
249         vtksphere->SetPhiResolution (20);
250         vtksphere->SetRadius( 1 );
251         //NTU: For updating points
252         lstSourceSphere.push_back(vtksphere);
253         vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New();
254         sphereMapper->SetInput( vtksphere->GetOutput() );
255         vtkActor *sphereActor   = vtkActor::New();
256         sphereActor->SetMapper(sphereMapper);
257         sphereActor->SetOrigin(0, 0, 0);
258
259         lstActorsSphere.push_back(sphereActor);
260         if(renderer==NULL){
261                 wxMessageDialog dialog(this, _T("Renderer Not Set"),_T("Renderer Not Set"),wxICON_ERROR);
262                 dialog.ShowModal();             
263                 return;
264         }
265         renderer->AddActor( sphereActor );
266         // Actor
267         vtkTextActor3D *textActor = vtkTextActor3D::New();
268 //      textActor->SetInput( strLabel.c_str()  );
269         renderer->AddActor( textActor );
270         lstActorsText.push_back(textActor);
271 }
272
273
274 //------------------------------------------------------------------------
275 void WidgetShowNPoints::AddPoint(int x, int y, int z, std::string label)
276 {
277         GetModelShowNPoints()->AddPoint(x,y,z, label );
278         AddVtkPoint();
279         RefreshPoint(lstActorsSphere.size()-1);
280 }
281
282
283
284 //------------------------------------------------------------------------
285 void WidgetShowNPoints::InsertPoint(int x, int y, int z, std::string label)//CFT
286 {
287
288 //--
289         if ( GetModelShowNPoints()->InsertPoint(x,y,z,label) != -1 )
290         {
291                 AddVtkPoint();
292         } else {
293                 AddPoint(x,y,z,label);
294         }
295         RefreshPoints();
296         //end if
297 }
298
299
300 //------------------------------------------------------------------------
301 void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event)
302 {       
303         if (this->renderer==NULL)
304         { 
305                 return;
306         }
307
308         std::vector<int> point = GetModelShowNPoints()->GetReferencePoint();
309         if (point.size()==3)
310         {
311                 AddPoint(point[0],point[1],point[2], (const char*) ( textCtrl->GetValue().mb_str() ) );
312                 SetOutputBox();
313                 renderer->GetRenderWindow()->Render();
314         } else {//mpoint.size
315                 printf("creaMaracasVisu::ShowNPoints (not match point) \n");
316         }
317 }
318
319 //------------------------------------------------------------------------
320 void WidgetShowNPoints::OnInsertPoint (wxCommandEvent& event)//CFT
321 {       
322         if (this->renderer==NULL)
323         { 
324                 return;
325         }
326
327         std::vector<int> point = GetModelShowNPoints()->GetReferencePoint();
328         if (point.size()==3)
329         {
330                 InsertPoint(point[0],point[1],point[2], (const char*) ( textCtrl->GetValue().mb_str() ) );
331                 SetOutputBox();
332         } else {//mpoint.size
333                 printf("creaMaracasVisu::ShowNPoints (not match point) \n");
334         }
335 }
336
337
338 //------------------------------------------------------------------------
339         void WidgetShowNPoints::SetOutputBox()
340         {
341 //EED           renderer->GetRenderWindow()->Render();
342                 wxString strTmp;
343                 strTmp.Printf(_T("Nbr of points: %d"), GetModelShowNPoints()->GetLstPointsSize() );
344                 txtNrPoints->SetLabel(  strTmp );
345                 //--BBTK
346
347 //EED 2017-06-03
348 //              mbbShowNPoints->bbSetOutputlstPointsX( GetModelShowNPoints()->GetLstPointsX() );
349 //              mbbShowNPoints->bbSetOutputlstPointsY( GetModelShowNPoints()->GetLstPointsY() );
350 //              mbbShowNPoints->bbSetOutputlstPointsZ( GetModelShowNPoints()->GetLstPointsZ() );
351 //              mbbShowNPoints->bbSetOutputlstLabels( GetModelShowNPoints()->GetLstLabels() );
352 //              mbbShowNPoints->bbSignalOutputModification();
353         }
354
355
356 //------------------------------------------------------------------------
357         void WidgetShowNPoints::OnSavePoints(wxCommandEvent& event)
358         {
359                 wxFileDialog* FD = new wxFileDialog( 0,
360                                             _T("Save points .."),
361                                             _T(""),
362                                             _T(""),
363                                             _T("(*.xls)|*.xls"),
364                                             wxSAVE | wxOVERWRITE_PROMPT,
365                                             wxDefaultPosition);
366                 //EED
367
368                 int result_FD = FD->ShowModal();
369                 
370                 // This line is need it by windows //EED
371                 FD->SetReturnCode( result_FD );
372
373                 if (FD->GetReturnCode()==wxID_OK)
374                 {
375                         std::string filename= (const char*) ( FD->GetPath().mb_str() ); 
376                         GetModelShowNPoints()->SavePoints( filename );
377                 }       // dialog box
378         }
379
380
381 //------------------------------------------------------------------------
382         void WidgetShowNPoints::OnLoadPoints(wxCommandEvent& event)
383         {
384                 wxFileDialog* FD = new wxFileDialog( 0,
385                                              _T("Load points .."),
386                                              _T(""),
387                                              _T(""),
388                                              _T("(*.xls)|*.xls"),
389                                              wxOPEN | wxFILE_MUST_EXIST,
390                                              wxDefaultPosition);
391                 int i;
392                 //EED
393                 int result_FD = FD->ShowModal();
394                 // This line is need it by windows //EED
395                 FD->SetReturnCode( result_FD );
396                 if (FD->GetReturnCode()==wxID_OK)
397                 {
398
399                         std::string filename= (const char*) ( FD->GetPath().mb_str() ); 
400                         int numberPointsRead = GetModelShowNPoints()->ReadPoints( filename );
401                         for (i=0;i<numberPointsRead;i++)
402                         {
403                                 AddVtkPoint();
404                         }// for
405                         SetOutputBox();
406                         RefreshPoints();
407                 }       // dialog box
408
409         }
410
411         //------------------------------------------------------------------------
412         void WidgetShowNPoints::OnSetPoint(wxCommandEvent& event)
413         {
414                 int id=GetModelShowNPoints()->GetNearestPoint();
415                 if((id==-1) && (mtype==1))
416                 {
417                         id=0;
418                         AddPoint(0,0,0,"");
419                         SetOutputBox();
420                 }
421         
422                 if (id>=0)
423                 {
424                         GetModelShowNPoints()->SetPointId_mReferencePoint(id);
425                         RefreshPoint(id);
426                         renderer->GetRenderWindow()->Render();
427                 } // if id
428                 SetOutputBox();
429         }
430         
431 //------------------------------------------------------------------------
432         void WidgetShowNPoints::OnRenamePoint(wxCommandEvent& event)
433         {
434                 int id = GetModelShowNPoints()->RenamePoint( (const char*) ( textCtrl->GetValue().mb_str() ) );
435                 if (id>=0)
436                 {
437                         lstActorsText[id]->SetInput(  (const char*) ( textCtrl->GetValue().mb_str() ) );
438                         SetOutputBox();
439                         renderer->GetRenderWindow()->Render();
440                 }
441         }
442
443 //------------------------------------------------------------------------
444         void WidgetShowNPoints::ErasePoint(int id)
445         {
446                 if (this->renderer!=NULL)
447                 {
448                         if (id>=0)
449                         {
450                                 renderer->RemoveActor( lstActorsSphere[id] );
451                                 renderer->RemoveActor( lstActorsText[id] );
452                                 lstActorsSphere[id]->Delete();
453                                 lstActorsText[id]->Delete();
454                                 lstSourceSphere[id]->Delete();
455                                 lstActorsSphere.erase( lstActorsSphere.begin()+id );
456                                 lstActorsText.erase( lstActorsText.begin()+id );
457                                 lstSourceSphere.erase( lstSourceSphere.begin()+id );
458                                 GetModelShowNPoints()->ErasePoint(id);
459                         } // if id
460                 } // if renderer
461         }
462
463 //------------------------------------------------------------------------
464         void WidgetShowNPoints::OnErasePoint(wxCommandEvent& event)
465         {
466                 ErasePoint( GetModelShowNPoints()->IdInsidePoint() );
467                 SetOutputBox();
468                 renderer->GetRenderWindow()->Render();
469         }
470
471 //------------------------------------------------------------------------
472         void WidgetShowNPoints::OnEraseLastPoint(wxCommandEvent& event)
473         {
474                 ErasePoint(lstActorsSphere.size()-1);
475                 SetOutputBox();
476                 renderer->GetRenderWindow()->Render();
477         }
478
479 //------------------------------------------------------------------------
480 void WidgetShowNPoints::DeleteAllPoints()
481 {
482         int id,size=lstActorsSphere.size();
483         for (id=size-1;id>=0;id--)
484         {
485                 ErasePoint(id);
486         }
487         SetOutputBox();
488         renderer->GetRenderWindow()->Render();
489 }
490
491 //------------------------------------------------------------------------
492 void WidgetShowNPoints::OnDeleteAllPoints(wxCommandEvent& event)
493 {
494         DeleteAllPoints();
495 }
496
497 //NTU: Method for updating points opacity and Radio
498
499 //------------------------------------------------------------------------
500 void WidgetShowNPoints::UpdatePoints(wxCommandEvent &event)
501 {
502         //Difference in Radio for text placement
503 //      double radio=GetModelShowNPoints()->GetRadio();
504         this->mopacity = sdrOpacity->GetValue()/100.0;
505         GetModelShowNPoints()->SetRadio( sdrRadio->GetValue() ) ;
506 //      radio = sdrRadio->GetValue();
507         //NTU refresh the inputs
508
509 //EED 2017-06-03
510 //      mbbShowNPoints->bbSetInputOpacity(this->mopacity);
511 //      mbbShowNPoints->bbSetInputRadio( radio );
512         // EED 
513         RefreshPoints();
514 }
515
516 //------------------------------------------------------------------------
517 void  WidgetShowNPoints::SetReferencePoint(std::vector<int> point)
518 {
519         GetModelShowNPoints()->SetReferencePoint(point);
520 }
521
522 //------------------------------------------------------------------------
523 void  WidgetShowNPoints::SetInitLstPoints( std::vector<int> initLstPointsX,  std::vector<int> initLstPointsY, std::vector<int> initLstPointsZ, std::vector<std::string> initLstLabels )
524 {
525         if (this->renderer==NULL)
526         { 
527                 return;
528         }
529
530         int i,sizeX,sizeY,sizeZ,sizeLabels;
531         sizeX=(int)initLstPointsX.size();
532         sizeY=(int)initLstPointsY.size();
533         sizeZ=(int)initLstPointsZ.size();
534         sizeLabels=(int)initLstLabels.size();
535
536         int x,y,z;
537         std::string label;
538
539         if ( (sizeX==sizeY) && (sizeX==sizeZ) )
540         {
541
542                 for (i=0;i<sizeX;i++)
543                 {
544                         x               = initLstPointsX[i];
545                         y               = initLstPointsY[i];
546                         z               = initLstPointsZ[i];
547                         if (i<sizeLabels) 
548                         {
549                                 label   = initLstLabels[i];
550                         } else {
551                                 label="";
552                         }
553                         AddPoint( x,y,z,label );
554                 } // for i
555                 //      SetOutputBox(); 
556                 //      renderer->GetRenderWindow()->Render();
557
558         } // if size
559 }
560 //------------------------------------------------------------------------
561 void WidgetShowNPoints::SetType(int type)
562 {
563         mtype=type;
564 }
565
566 //------------------------------------------------------------------------
567 int WidgetShowNPoints::GetType()
568 {
569         return mtype;
570 }
571
572
573 //------------------------------------------------------------------------
574 double WidgetShowNPoints::GetRadio()
575 {
576         return sdrRadio->GetValue();
577 }
578
579 //------------------------------------------------------------------------
580 double WidgetShowNPoints::GetOpacity()
581 {
582         return mopacity;
583 }
584
585