2 #ifndef __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
3 #define __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
4 #include "bbtkWxBlackBox.h"
8 #include "vtkImageData.h"
9 #include "vtkRenderer.h"
10 #include "vtkTextActor3D.h"
12 namespace bbcreaMaracasVisu
17 //--------------------------------------------------------------------------
18 class WidgetShowNPoints : public wxPanel
21 WidgetShowNPoints( wxWindow *parent, ShowNPoints *box);
23 void OnAddPoint(wxCommandEvent &event);
24 void OnRenamePoint(wxCommandEvent& event);
25 void OnErasePoint(wxCommandEvent& event);
26 void OnEraseLastPoint(wxCommandEvent &event);
27 void OnDeleteAllPoints(wxCommandEvent &event);
28 void OnSavePoints(wxCommandEvent &event);
29 void OnLoadPoints(wxCommandEvent &event);
31 void SetPoint(std::vector<int> ppoint);
32 void SetColour(std::vector<double> colour);
33 void SetOpacity(double opacity);
34 void SetRadio(double radio);
35 void SetImage(vtkImageData *image);
36 void SetRenderer(vtkRenderer *renderer);
37 std::vector<int> GetLstPointsX();
38 std::vector<int> GetLstPointsY();
39 std::vector<int> GetLstPointsZ();
40 std::vector<std::string> GetLstLabels();
44 void AddPoint(int x, int y, int z, std::string label);
45 std::string CleanSpaces(std::string ss);
46 int GetNearestPoint();
47 void ErasePoint(int id);
50 ShowNPoints *mbbShowNPoints;
51 vtkRenderer *renderer;
52 std::vector<int> lstPointsX;
53 std::vector<int> lstPointsY;
54 std::vector<int> lstPointsZ;
55 std::vector<std::string> lstLabels;
56 std::vector<vtkProp3D*> lstActorsSphere;
57 std::vector<vtkTextActor3D*> lstActorsText;
59 std::vector<int> mpoint;
61 std::vector<double> mcolour;
65 wxStaticText *txtNrPoints;
70 class /*BBTK_EXPORT*/ ShowNPoints
72 public bbtk::WxBlackBox
74 BBTK_BLACK_BOX_INTERFACE(ShowNPoints,bbtk::WxBlackBox);
75 BBTK_DECLARE_INPUT(In, std::vector<int> );
76 BBTK_DECLARE_INPUT(Renderer, vtkRenderer* );
77 BBTK_DECLARE_INPUT(Image, vtkImageData* );
78 BBTK_DECLARE_INPUT(Colour, std::vector<double> );
79 BBTK_DECLARE_INPUT(Opacity, double );
80 BBTK_DECLARE_INPUT(Radio, double );
81 BBTK_DECLARE_OUTPUT( lstPointsX, std::vector<int> );
82 BBTK_DECLARE_OUTPUT( lstPointsY, std::vector<int> );
83 BBTK_DECLARE_OUTPUT( lstPointsZ, std::vector<int> );
84 BBTK_DECLARE_OUTPUT( lstLabels, std::vector<std::string> );
85 BBTK_PROCESS(Process);
87 BBTK_CREATE_WIDGET(CreateWidget);
88 void CreateWidget(wxWindow*);
91 WidgetShowNPoints *mwxwidget;
95 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints,bbtk::WxBlackBox);
96 BBTK_NAME("ShowNPoints");
97 BBTK_AUTHOR("Eduardo DAVILA");
98 BBTK_DESCRIPTION("widget that shows N moints in 3D (vtkActors)");
99 BBTK_CATEGORY("widgetVtk");
100 BBTK_INPUT(ShowNPoints,In,"One Point",std::vector<int>,"");
101 BBTK_INPUT(ShowNPoints,Renderer,"Renderer",vtkRenderer*,"");
102 BBTK_INPUT(ShowNPoints,Image,"vktkImageData",vtkImageData*,"");
103 BBTK_INPUT(ShowNPoints,Colour,"Colour of the actor",std::vector<double>,"colour");
104 BBTK_INPUT(ShowNPoints,Opacity,"Opacity of the actor",double,"");
105 BBTK_INPUT(ShowNPoints,Radio,"Radio of the spheres",double,"");
106 BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X ", std::vector<int> ,"");
107 BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y ", std::vector<int> ,"");
108 BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z ", std::vector<int> ,"");
109 BBTK_OUTPUT(ShowNPoints , lstLabels , " list of labels ", std::vector<std::string> ,"");
110 BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints);
112 // EO namespace bbcreaMaracasVisu
114 #endif // __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
115 #endif // _USE_WXWIDGETS_