]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h
5ed2ea19225b999f1d9932ba460268336bc79298
[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 OnLoadCollections(wxCommandEvent &event);
76       void OnLoadCollections_( std::string filename );
77       void ResetCollections_();
78       void OnResetCollections_();
79       void OnResetCollections(wxCommandEvent &event);
80       void GetCollectionPoint(int idCol,int idPoint, double *pPoint);
81       void SetCollectionPoint(int idCol, int idPoint, std::vector<double> modPoint);
82       void SetActualCollection( int actual );
83       void OnUndo(wxCommandEvent &event);
84       void OnRedo(wxCommandEvent &event);
85       void UndoRedo_SaveCollection();
86       std::string GetUndoRedoFileName();
87
88       void MovePoint_(double step);
89       void OnMovePointUp(wxCommandEvent& event);
90       void OnMovePointDown(wxCommandEvent& event);
91
92       void RefreshCollectionText();
93       void RefreshColourCollection();
94       void InvertLstPoints_();
95       void OnInvertLstPoints_();
96
97       // EED 2022-05-19
98           //void RefreshPoint(int id);
99       //void RefreshPoints();
100       //void AddVtkPoint();
101
102           void SetColour(std::vector<double> colour);
103           void SetOpacity(double opacity);
104           void SetRadio(double radio);
105           void SetImage(vtkImageData *image);
106           void SetRenderer(vtkRenderer *renderer);
107           void SetReferencePoint(std::vector<double> point);
108
109           void AddPoint(double x, double y, double z, std::string label);
110       void OnInsertPoint_();
111           void InsertPoint(double x, double y, double z, std::string label);//CFT
112
113       int GetLstModelShowNPointsSize();
114           ModelShowNPoints* GetModelShowNPoints();
115           ModelShowNPoints* GetModelShowNPoints(int id);
116       ViewShowNPoints* GetViewShowNPoints();
117           void SetInitLstPoints( std::vector<double> initLstPointsX,  std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels,  std::vector<int> initLstIndexs );
118
119     void                        SetType(int type);
120     int                         GetType();
121     double                      GetRadio();
122     double                      GetOpacity();
123     virtual void                SetOutputBox();
124     bool                        ErasePoint(int id);
125
126     void                        SetAuxMesh(vtkPolyData* , std::vector<double> spc, std::vector<double> params);
127     
128     std::vector<double>         GetLstPointsX();
129     std::vector<double>         GetLstPointsY();
130     std::vector<double>         GetLstPointsZ();
131     std::vector<std::string>    GetLstLabels();
132     std::vector<int>            GetLstIndexs();
133     std::vector<int>            GetLstSelectedIndexs();
134
135
136   protected:
137   private:
138         std::vector<ViewShowNPoints*>   lstViewShowNPoints;
139         //NTU: For updating points
140         wxStaticText                        *askPointLabel;
141         wxTextCtrl                          *textCtrl;
142         wxStaticText                    *txtNrCollections;
143         wxStaticText                        *txtNrPoints;
144     
145 //        wxSlider                              *sdrOpacity;
146 //        wxSlider                              *sdrRadio;
147         wxSpinCtrl                      *sCtrlRadio;
148         wxSpinCtrl                      *sCtrlOpacity;
149
150         wxCheckBox                      *cbTrackPoint;
151         wxCheckBox                      *cbAutoAddPoints;
152         wxCheckBox                      *cbVisuActualCollection;
153
154         std::vector<ModelShowNPoints*>  lstModelShowNPoints;
155         int                                                         mtype;
156         int                             mActualCollection;
157 //        int                             idTrack;
158         int                             idUndoRedo;
159         int                             maxUndoRedo;
160         std::string                     UndoRedoDir;
161     
162         vtkPolyData                     *aux_mesh;
163         std::vector<double>             aux_mesh_spc;
164         int                             aux_mesh_type;
165     
166 };
167
168
169
170
171
172
173 #endif // __WidgetShowNPoints_h_INCLUDED__
174