]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h
7e41319f4817938b49537ff0576452eecbbebeba
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / WidgetShowNPoints.h
1
2 #ifndef __WidgetShowNPoints_h_INCLUDED__
3 #define __WidgetShowNPoints_h_INCLUDED__
4
5 #include "ModelShowNPoints.h"
6 #include "ViewShowNPoints.h"
7
8 #include <wx/panel.h>
9 #include <wx/textctrl.h>
10 #include <wx/slider.h>
11 #include <wx/stattext.h>
12 #include <wx/checkbox.h>
13
14
15 class WidgetShowNPoints : public wxPanel
16 {
17   public:
18           WidgetShowNPoints( wxWindow *parent , int type );
19           ~WidgetShowNPoints();
20       void StopAutoAddPoints();
21       void AutoAddPoints();
22       void OnAutoAddPoints_tool();
23       void OnAutoAddPoints_();
24       void OnAutoAddPoints(wxCommandEvent& event);
25           void OnAddPoint(wxCommandEvent &event);
26       void OnAddPoint_();
27       void OnAddPoint__();
28           void OnInsertPoint(wxCommandEvent& event);//CFT
29       void OnSetPoint_();
30           void OnSetPoint(wxCommandEvent& event);
31       void OnTrackPoint(wxCommandEvent& event);
32       void OnTrackPoint_();
33       void OnTrackPoint_tool();
34       void TrackingPoint();
35       void StopTrackPoint();
36       void DetectCollectionActive();
37
38           void OnRenamePoint(wxCommandEvent& event);
39       void OnErasePoint_();
40           void OnErasePoint(wxCommandEvent& event);
41           void OnEraseLastPoint(wxCommandEvent &event); 
42       void DeleteAllPoints_();
43       void OnDeleteAllPoints_();
44           void OnDeleteAllPoints(wxCommandEvent &event);
45
46           void OnSavePoints(wxCommandEvent &event);   
47           void OnLoadPoints(wxCommandEvent &event);
48
49           virtual void UpdatePoints(wxCommandEvent &event);
50       void UpdatePoints_();
51
52       void InsertCollection();
53       void InsertCollectionBefore_();
54       void OnInsertCollectionBefore_();
55       void OnInsertCollectionBefore(wxCommandEvent &event);
56       void InsertCollectionAfter_();
57       void OnInsertCollectionAfter_();
58       void OnInsertCollectionAfter(wxCommandEvent &event);
59       void OnDeleteCollection_();
60       void OnDeleteCollection(wxCommandEvent &event);
61       void DeleteCollection_();
62       void OnBackCollection(wxCommandEvent &event);
63       void OnNextCollection(wxCommandEvent &event);
64       void OnSaveCollections(wxCommandEvent &event);
65       void OnSaveCollections_( std::string filename );
66       void OnLoadCollections(wxCommandEvent &event);
67       void OnLoadCollections_( std::string filename );
68       void ResetCollections_();
69       void OnResetCollections_();
70       void OnResetCollections(wxCommandEvent &event);
71       void GetCollectionPoint(int idCol,int idPoint, double *pPoint);
72
73       void OnUndo(wxCommandEvent &event);
74       void OnRedo(wxCommandEvent &event);
75       void UndoRedo_SaveCollection();
76       std::string GetUndoRedoFileName();
77
78
79       void RefreshCollectionText();
80       void RefreshColourCollection();
81       void InvertLstPoints_();
82       void OnInvertLstPoints_();
83
84       // EED 2022-05-19
85           //void RefreshPoint(int id);
86       //void RefreshPoints();
87       //void AddVtkPoint();
88
89           void SetColour(std::vector<double> colour);
90           void SetOpacity(double opacity);
91           void SetRadio(double radio);
92           void SetImage(vtkImageData *image);
93           void SetRenderer(vtkRenderer *renderer);
94           void SetReferencePoint(std::vector<int> point);
95
96           void AddPoint(int x, int y, int z, std::string label);
97       void OnInsertPoint_();
98           void InsertPoint(int x, int y, int z, std::string label);//CFT
99
100       int GetLstModelShowNPointsSize();
101           ModelShowNPoints* GetModelShowNPoints();
102       ViewShowNPoints* GetViewShowNPoints();
103           void SetInitLstPoints( std::vector<int> initLstPointsX,  std::vector<int> initLstPointsY, std::vector<int> initLstPointsZ, std::vector<std::string> initLstLabels );
104
105       void          SetType(int type);
106       int           GetType();
107       double        GetRadio();
108       double        GetOpacity();
109       virtual void  SetOutputBox();
110       void          ErasePoint(int id);
111
112       std::vector<int> GetLstPointsX();
113       std::vector<int> GetLstPointsY();
114       std::vector<int> GetLstPointsZ();
115       std::vector<std::string> GetLstLabels();
116       std::vector<int> GetLstIndexs();
117
118     
119
120   protected:
121
122   private:
123     
124       // EED 2022-05-19
125       //vtkRenderer                       *renderer;
126           //std::vector<vtkActor*>            lstActorsSphere;//NTU changed from prop3D to Actor
127           //std::vector<vtkTextActor3D*>      lstActorsText;
128       //std::vector<vtkSphereSource*>     lstSourceSphere;
129       //std::vector<double>               mcolour;
130       //ModelShowNPoints*                 mmodelShowNPoints;
131       //double                            mopacity;
132       std::vector<ViewShowNPoints*>       lstViewShowNPoints;
133
134     
135           //NTU: For updating points
136           wxStaticText                              * askPointLabel;
137           wxTextCtrl                                * textCtrl;
138       wxStaticText                      * txtNrCollections;
139       wxStaticText                          * txtNrPoints;
140           wxSlider                                  * sdrOpacity;
141           wxSlider                                  * sdrRadio;
142       wxCheckBox                        * cbTrackPoint;
143       wxCheckBox                        * cbAutoAddPoints;
144
145       std::vector<ModelShowNPoints*>    lstModelShowNPoints;
146           int                                                       mtype;
147       int                               mActualCollection;
148 //    bool                              trackPointFlag;
149       int                               idTrack;
150       int                               idUndoRedo;
151       int                               maxUndoRedo;
152       std::string                       UndoRedoDir;
153 };
154
155
156
157
158
159
160 #endif // __WidgetShowNPoints_h_INCLUDED__
161