]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h
193f287ea1700bad888ce65dc36283394e975333
[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 CreatePointsIntoNewCollection();
60       void OnDeleteCollection_();
61       void OnDeleteCollection(wxCommandEvent &event);
62       void DeleteCollection_();
63       void OnBackCollection(wxCommandEvent &event);
64       void OnNextCollection(wxCommandEvent &event);
65       void OnSaveCollections(wxCommandEvent &event);
66       void OnSaveCollections_( std::string filename );
67       void OnLoadCollections(wxCommandEvent &event);
68       void OnLoadCollections_( std::string filename );
69       void ResetCollections_();
70       void OnResetCollections_();
71       void OnResetCollections(wxCommandEvent &event);
72       void GetCollectionPoint(int idCol,int idPoint, double *pPoint);
73       
74       void SetCollectionPoint(int idCol, int idPoint, std::vector<double> modPoint);
75       void SetActualCollection( int actual );
76     
77       void OnUndo(wxCommandEvent &event);
78       void OnRedo(wxCommandEvent &event);
79       void UndoRedo_SaveCollection();
80       std::string GetUndoRedoFileName();
81
82
83       void RefreshCollectionText();
84       void RefreshColourCollection();
85       void InvertLstPoints_();
86       void OnInvertLstPoints_();
87
88       // EED 2022-05-19
89           //void RefreshPoint(int id);
90       //void RefreshPoints();
91       //void AddVtkPoint();
92
93           void SetColour(std::vector<double> colour);
94           void SetOpacity(double opacity);
95           void SetRadio(double radio);
96           void SetImage(vtkImageData *image);
97           void SetRenderer(vtkRenderer *renderer);
98           void SetReferencePoint(std::vector<double> point);
99
100           void AddPoint(double x, double y, double z, std::string label);
101       void OnInsertPoint_();
102           void InsertPoint(double x, double y, double z, std::string label);//CFT
103
104       int GetLstModelShowNPointsSize();
105           ModelShowNPoints* GetModelShowNPoints();
106           ModelShowNPoints* GetModelShowNPoints(int id);
107       ViewShowNPoints* GetViewShowNPoints();
108           void SetInitLstPoints( std::vector<double> initLstPointsX,  std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels,  std::vector<int> initLstIndexs );
109
110       void          SetType(int type);
111       int           GetType();
112       double        GetRadio();
113       double        GetOpacity();
114       virtual void  SetOutputBox();
115       void          ErasePoint(int id);
116
117       std::vector<double>       GetLstPointsX();
118       std::vector<double>       GetLstPointsY();
119       std::vector<double>       GetLstPointsZ();
120       std::vector<std::string>  GetLstLabels();
121       std::vector<int>          GetLstIndexs();
122
123   protected:
124   private:
125       std::vector<ViewShowNPoints*>       lstViewShowNPoints;
126           //NTU: For updating points
127           wxStaticText                              * askPointLabel;
128           wxTextCtrl                                * textCtrl;
129       wxStaticText                      * txtNrCollections;
130       wxStaticText                          * txtNrPoints;
131           wxSlider                                  * sdrOpacity;
132           wxSlider                                  * sdrRadio;
133       wxCheckBox                        * cbTrackPoint;
134       wxCheckBox                        * cbAutoAddPoints;
135
136       std::vector<ModelShowNPoints*>    lstModelShowNPoints;
137           int                                                       mtype;
138       int                               mActualCollection;
139       int                               idTrack;
140       int                               idUndoRedo;
141       int                               maxUndoRedo;
142       std::string                       UndoRedoDir;
143 };
144
145
146
147
148
149
150 #endif // __WidgetShowNPoints_h_INCLUDED__
151