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