]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h
3f444fa785429d212f0f3f7035cf78c16e208dbc
[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
134   protected:
135   private:
136         std::vector<ViewShowNPoints*>   lstViewShowNPoints;
137         //NTU: For updating points
138         wxStaticText                        *askPointLabel;
139         wxTextCtrl                          *textCtrl;
140         wxStaticText                    *txtNrCollections;
141         wxStaticText                        *txtNrPoints;
142     
143 //        wxSlider                              *sdrOpacity;
144 //        wxSlider                              *sdrRadio;
145         wxSpinCtrl                      *sCtrlRadio;
146         wxSpinCtrl                      *sCtrlOpacity;
147
148         wxCheckBox                      *cbTrackPoint;
149         wxCheckBox                      *cbAutoAddPoints;
150         wxCheckBox                      *cbVisuActualCollection;
151
152         std::vector<ModelShowNPoints*>  lstModelShowNPoints;
153         int                                                         mtype;
154         int                             mActualCollection;
155         int                             idTrack;
156         int                             idUndoRedo;
157         int                             maxUndoRedo;
158         std::string                     UndoRedoDir;
159     
160         vtkPolyData                     *aux_mesh;
161         std::vector<double>             aux_mesh_spc;
162         int                             aux_mesh_type;
163     
164 };
165
166
167
168
169
170
171 #endif // __WidgetShowNPoints_h_INCLUDED__
172