]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuShowNPoints.h
8a2feec1f234fa1eb6c3f44fd86144b4dbad06e2
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuShowNPoints.h
1 #ifdef _USE_WXWIDGETS_
2 #ifndef __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
3 #define __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
4 #include "bbtkWxBlackBox.h"
5
6
7 #include "vtkActor.h"
8 #include "vtkImageData.h"
9 #include "vtkRenderer.h"
10
11 namespace bbcreaMaracasVisu
12 {
13
14   class ShowNPoints;
15
16   //--------------------------------------------------------------------------
17   class WidgetShowNPoints : public wxPanel
18   {
19   public:
20           WidgetShowNPoints( wxWindow *parent,  ShowNPoints *box);
21           ~WidgetShowNPoints(); 
22           void OnAddPoint(wxCommandEvent &event);   
23           void ErasePoint(int id);
24           void OnErasePoint(wxCommandEvent& event);
25           void OnEraseLastPoint(wxCommandEvent &event);   
26           void OnDeleteAllPoints(wxCommandEvent &event);   
27           
28           void SetPoint(std::vector<int> ppoint);
29           void SetColour(std::vector<double> colour);
30           void SetOpacity(double opacity);
31           void SetRadio(double radio);
32           void SetImage(vtkImageData *image);
33           void SetRenderer(vtkRenderer *renderer);
34           std::vector<int> GetLstPointsX();
35           std::vector<int> GetLstPointsY();
36           std::vector<int> GetLstPointsZ();
37
38   private:
39         ShowNPoints                             *mbbShowNPoints;
40         vtkRenderer                             *renderer;
41         std::vector<int>                lstPointsX;
42         std::vector<int>                lstPointsY;
43         std::vector<int>                lstPointsZ;
44         std::vector<vtkProp3D*> lstActorsSphere;
45         std::vector<vtkProp3D*> lstActorsText;
46
47         std::vector<int>                mpoint;
48         vtkImageData                    *mimage;
49         std::vector<double>             mcolour;
50         double                                  mopacity;
51         double                                  mradio;
52         wxTextCtrl                              *textCtrl;
53   };
54
55
56
57 class /*BBTK_EXPORT*/ ShowNPoints
58  : 
59    public bbtk::WxBlackBox
60 {
61   BBTK_BLACK_BOX_INTERFACE(ShowNPoints,bbtk::WxBlackBox);
62   BBTK_DECLARE_INPUT(In, std::vector<int> );
63   BBTK_DECLARE_INPUT(Renderer, vtkRenderer* );
64   BBTK_DECLARE_INPUT(Image, vtkImageData* );
65   BBTK_DECLARE_INPUT(Colour, std::vector<double> );
66   BBTK_DECLARE_INPUT(Opacity, double );
67   BBTK_DECLARE_INPUT(Radio, double );
68   BBTK_DECLARE_OUTPUT( lstPointsX, std::vector<int> );
69   BBTK_DECLARE_OUTPUT( lstPointsY, std::vector<int> );
70   BBTK_DECLARE_OUTPUT( lstPointsZ, std::vector<int> );
71   BBTK_PROCESS(Process);
72   void Process();
73   BBTK_CREATE_WIDGET(CreateWidget);
74   void CreateWidget(wxWindow*);
75
76 private:
77         WidgetShowNPoints *mwxwidget; 
78
79 };
80
81 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints,bbtk::WxBlackBox);
82 BBTK_NAME("ShowNPoints");
83 BBTK_AUTHOR("Eduardo DAVILA");
84 BBTK_DESCRIPTION("widget that shows N moints in 3D (vtkActors)");
85 BBTK_CATEGORY("widgetVtk");
86 BBTK_INPUT(ShowNPoints,In,"One Point",std::vector<int>,"");
87 BBTK_INPUT(ShowNPoints,Renderer,"Renderer",vtkRenderer*,"");
88 BBTK_INPUT(ShowNPoints,Image,"vktkImageData",vtkImageData*,"");
89 BBTK_INPUT(ShowNPoints,Colour,"Colour of the actor",std::vector<double>,"colour");
90 BBTK_INPUT(ShowNPoints,Opacity,"Opacity of the actor",double,"");
91 BBTK_INPUT(ShowNPoints,Radio,"Radio of the spheres",double,"");
92 BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X ", std::vector<int> ,"");
93 BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y ", std::vector<int> ,"");
94 BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z ", std::vector<int> ,"");
95 BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints);
96 }
97 // EO namespace bbcreaMaracasVisu
98
99 #endif // __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
100 #endif // _USE_WXWIDGETS_
101