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