2 #ifndef __WidgetShowNPoints_h_INCLUDED__
3 #define __WidgetShowNPoints_h_INCLUDED__
5 #include "ModelShowNPoints.h"
6 #include "ViewShowNPoints.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>
15 #include "vtkPolyData.h"
19 class WidgetShowNPoints : public wxPanel
22 WidgetShowNPoints( wxWindow *parent , int type );
24 void SetCurrentPoint(int idCurrentPoint );
25 void OnBackPoint(wxCommandEvent &event);
26 void OnNextPoint(wxCommandEvent &event);
27 void StopAutoAddPoints();
29 void OnAutoAddPoints_tool();
30 void OnAutoAddPoints_();
31 void OnAutoAddPoints(wxCommandEvent& event);
34 void OnAddPoint(wxCommandEvent &event);
35 void OnInsertPoint(wxCommandEvent& event);//CFT
37 void OnSetPoint(wxCommandEvent& event);
38 void OnTrackPoint(wxCommandEvent& event);
40 void OnTrackPoint_tool();
42 void StopTrackPoint();
43 void DetectCollectionActive();
45 void OnRenamePoint(wxCommandEvent& event);
47 void OnErasePoint(wxCommandEvent& event);
48 void OnEraseLastPoint(wxCommandEvent &event);
49 void DeleteAllPoints_();
50 void OnDeleteAllPoints_();
51 void OnDeleteAllPoints(wxCommandEvent &event);
53 void OnSavePoints(wxCommandEvent &event);
54 void OnLoadPoints(wxCommandEvent &event);
56 virtual void UpdatePoints(wxCommandEvent &event);
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();
88 void MovePoint_(double step);
89 void OnMovePointUp(wxCommandEvent& event);
90 void OnMovePointDown(wxCommandEvent& event);
92 void RefreshCollectionText();
93 void RefreshColourCollection();
94 void InvertLstPoints_();
95 void OnInvertLstPoints_();
98 //void RefreshPoint(int id);
99 //void RefreshPoints();
100 //void AddVtkPoint();
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);
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
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 );
119 void SetType(int type);
123 virtual void SetOutputBox();
124 bool ErasePoint(int id);
126 void SetAuxMesh(vtkPolyData* , std::vector<double> spc, std::vector<double> params);
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();
138 std::vector<ViewShowNPoints*> lstViewShowNPoints;
139 //NTU: For updating points
140 wxStaticText *askPointLabel;
141 wxTextCtrl *textCtrl;
142 wxStaticText *txtNrCollections;
143 wxStaticText *txtNrPoints;
145 // wxSlider *sdrOpacity;
146 // wxSlider *sdrRadio;
147 wxSpinCtrl *sCtrlRadio;
148 wxSpinCtrl *sCtrlOpacity;
150 wxCheckBox *cbTrackPoint;
151 wxCheckBox *cbAutoAddPoints;
152 wxCheckBox *cbVisuActualCollection;
154 std::vector<ModelShowNPoints*> lstModelShowNPoints;
156 int mActualCollection;
160 std::string UndoRedoDir;
162 vtkPolyData *aux_mesh;
163 std::vector<double> aux_mesh_spc;
173 #endif // __WidgetShowNPoints_h_INCLUDED__