]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuShowNPoints.h
.
[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 OnErasePoint(wxCommandEvent &event);   
24         void OnDeleteAllPoints(wxCommandEvent &event);   
25         void SetPoint(std::vector<int> ppoint);
26         void SetColour(std::vector<double> colour);
27         void SetOpacity(double opacity);
28         void SetRadio(double radio);
29         void SetImage(vtkImageData *image);
30         void SetRenderer(vtkRenderer *renderer);
31         std::vector<int> GetLstPointsX();
32         std::vector<int> GetLstPointsY();
33         std::vector<int> GetLstPointsZ();
34
35   private:
36         ShowNPoints                             *mbbShowNPoints;
37         vtkRenderer                             *renderer;
38         std::vector<int>                lstPointsX;
39         std::vector<int>                lstPointsY;
40         std::vector<int>                lstPointsZ;
41         std::vector<vtkActor*>  lstActors;
42
43         std::vector<int>                mpoint;
44         vtkImageData                    *mimage;
45         std::vector<double>             mcolour;
46         double                                  mopacity;
47         double                                  mradio;
48   };
49
50
51
52 class /*BBTK_EXPORT*/ ShowNPoints
53  : 
54    public bbtk::WxBlackBox
55 {
56   BBTK_BLACK_BOX_INTERFACE(ShowNPoints,bbtk::WxBlackBox);
57   BBTK_DECLARE_INPUT(In, std::vector<int> );
58   BBTK_DECLARE_INPUT(Renderer, vtkRenderer* );
59   BBTK_DECLARE_INPUT(Image, vtkImageData* );
60   BBTK_DECLARE_INPUT(Colour, std::vector<double> );
61   BBTK_DECLARE_INPUT(Opacity, double );
62   BBTK_DECLARE_INPUT(Radio, double );
63   BBTK_DECLARE_OUTPUT( lstPointsX, std::vector<int> );
64   BBTK_DECLARE_OUTPUT( lstPointsY, std::vector<int> );
65   BBTK_DECLARE_OUTPUT( lstPointsZ, std::vector<int> );
66   BBTK_PROCESS(Process);
67   void Process();
68   BBTK_CREATE_WIDGET(CreateWidget);
69   void CreateWidget(wxWindow*);
70
71 private:
72         WidgetShowNPoints *mwxwidget; 
73
74 };
75
76 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints,bbtk::WxBlackBox);
77 BBTK_NAME("ShowNPoints");
78 BBTK_AUTHOR("Eduardo DAVILA");
79 BBTK_DESCRIPTION("widget that shows N moints in 3D (vtkActors)");
80 BBTK_CATEGORY("widgetVtk");
81 BBTK_INPUT(ShowNPoints,In,"One Point",std::vector<int>,"");
82 BBTK_INPUT(ShowNPoints,Renderer,"Renderer",vtkRenderer*,"");
83 BBTK_INPUT(ShowNPoints,Image,"vktkImageData",vtkImageData*,"");
84 BBTK_INPUT(ShowNPoints,Colour,"Colour of the actor",std::vector<double>,"colour");
85 BBTK_INPUT(ShowNPoints,Opacity,"Opacity of the actor",double,"");
86 BBTK_INPUT(ShowNPoints,Radio,"Radio of the spheres",double,"");
87 BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X ", std::vector<int> ,"");
88 BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y ", std::vector<int> ,"");
89 BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z ", std::vector<int> ,"");
90 BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints);
91 }
92 // EO namespace bbcreaMaracasVisu
93
94 #endif // __bbcreaMaracasVisuShowNPoints_h_INCLUDED__
95 #endif // _USE_WXWIDGETS_
96