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