2 #ifndef __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
3 #define __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
4 #include "bbtkWxBlackBox.h"
8 #include "vtkSphereSource.h"
9 #include "vtkImageData.h"
10 #include "vtkRenderer.h"
11 #include "vtkTextActor3D.h"
13 namespace bbcreaMaracasVisu
18 //--------------------------------------------------------------------------
19 class WidgetShowNPoints : public wxPanel
22 WidgetShowNPoints( wxWindow *parent, ShowNPoints *box);
24 void OnAddPoint(wxCommandEvent &event);
25 void OnSetPoint(wxCommandEvent& event);
26 void OnRenamePoint(wxCommandEvent& event);
27 void OnErasePoint(wxCommandEvent& event);
28 void OnEraseLastPoint(wxCommandEvent &event);
29 void OnDeleteAllPoints(wxCommandEvent &event);
30 void OnSavePoints(wxCommandEvent &event);
31 void OnLoadPoints(wxCommandEvent &event);
32 void UpdatePoints(wxCommandEvent &event);
34 void RefreshPoint(int id);
36 void SetPoint(std::vector<int> ppoint);
37 void SetColour(std::vector<double> colour);
38 void SetOpacity(double opacity);
39 void SetRadio(double radio);
40 void SetImage(vtkImageData *image);
41 void SetRenderer(vtkRenderer *renderer);
42 std::vector<int> GetLstPointsX();
43 std::vector<int> GetLstPointsY();
44 std::vector<int> GetLstPointsZ();
45 std::vector<std::string> GetLstLabels();
47 void AddPoint(int x, int y, int z, std::string label);
51 std::string CleanSpaces(std::string ss);
52 int GetNearestPoint();
54 void ErasePoint(int id);
57 ShowNPoints *mbbShowNPoints;
58 vtkRenderer *renderer;
59 std::vector<int> lstPointsX;
60 std::vector<int> lstPointsY;
61 std::vector<int> lstPointsZ;
62 std::vector<std::string> lstLabels;
63 std::vector<vtkActor*> lstActorsSphere;//NTU changed from prop3D to Actor
64 std::vector<vtkTextActor3D*> lstActorsText;
66 //NTU: For updating points
68 std::vector<vtkSphereSource*> lstSourceSphere;
70 std::vector<int> mpoint;
72 std::vector<double> mcolour;
75 wxStaticText *askPointLabel;
77 wxStaticText *txtNrPoints;
82 class /*BBTK_EXPORT*/ ShowNPoints
84 public bbtk::WxBlackBox
86 BBTK_BLACK_BOX_INTERFACE(ShowNPoints,bbtk::WxBlackBox);
87 BBTK_DECLARE_INPUT(In, std::vector<int> );
88 BBTK_DECLARE_INPUT(Renderer, vtkRenderer* );
89 BBTK_DECLARE_INPUT(Image, vtkImageData* );
90 BBTK_DECLARE_INPUT(Colour, std::vector<double> );
91 BBTK_DECLARE_INPUT(Opacity, double );
92 BBTK_DECLARE_INPUT(Radio, double );
93 BBTK_DECLARE_INPUT(Type, int );
94 BBTK_DECLARE_OUTPUT( lstPointsX, std::vector<int> );
95 BBTK_DECLARE_OUTPUT( lstPointsY, std::vector<int> );
96 BBTK_DECLARE_OUTPUT( lstPointsZ, std::vector<int> );
97 BBTK_DECLARE_OUTPUT( lstLabels, std::vector<std::string> );
98 BBTK_PROCESS(Process);
100 BBTK_CREATE_WIDGET(CreateWidget);
101 void CreateWidget(wxWindow*);
104 WidgetShowNPoints *mwxwidget;
107 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints,bbtk::WxBlackBox);
108 BBTK_NAME("ShowNPoints");
109 BBTK_AUTHOR("Eduardo DAVILA");
110 BBTK_DESCRIPTION("widget that shows N moints in 3D (vtkActors)");
111 BBTK_CATEGORY("widgetVtk");
112 BBTK_INPUT(ShowNPoints,In,"One Point",std::vector<int>,"");
113 BBTK_INPUT(ShowNPoints,Renderer,"Renderer",vtkRenderer*,"");
114 BBTK_INPUT(ShowNPoints,Image,"vktkImageData",vtkImageData*,"");
115 BBTK_INPUT(ShowNPoints,Colour,"Colour of the actor",std::vector<double>,"colour");
116 BBTK_INPUT(ShowNPoints,Opacity,"Opacity of the actor",double,"");
117 BBTK_INPUT(ShowNPoints,Radio,"Radio of the spheres",double,"");
118 BBTK_INPUT(ShowNPoints,Type,"Type of the widget. 0(default): N-points, 1:Just one point",int,"");
119 BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X ", std::vector<int> ,"");
120 BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y ", std::vector<int> ,"");
121 BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z ", std::vector<int> ,"");
122 BBTK_OUTPUT(ShowNPoints , lstLabels , " list of labels ", std::vector<std::string> ,"");
123 BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints);
125 // EO namespace bbcreaMaracasVisu
127 #endif // __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
128 #endif // _USE_WXWIDGETS_