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 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();
90 void MovePoint_(double step);
91 void OnMovePointUp(wxCommandEvent& event);
92 void OnMovePointDown(wxCommandEvent& event);
94 void RefreshCollectionText();
95 void RefreshColourCollection();
96 void InvertLstPoints_();
97 void OnInvertLstPoints_();
100 //void RefreshPoint(int id);
101 //void RefreshPoints();
102 //void AddVtkPoint();
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);
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
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 );
121 void SetType(int type);
125 virtual void SetOutputBox();
126 bool ErasePoint(int id);
128 void SetAuxMesh(vtkPolyData* , std::vector<double> spc, std::vector<double> params);
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();
140 std::vector<ViewShowNPoints*> lstViewShowNPoints;
141 //NTU: For updating points
142 wxStaticText *askPointLabel;
143 wxTextCtrl *textCtrl;
144 wxStaticText *txtNrCollections;
145 wxStaticText *txtNrPoints;
147 // wxSlider *sdrOpacity;
148 // wxSlider *sdrRadio;
149 wxSpinCtrl *sCtrlRadio;
150 wxSpinCtrl *sCtrlOpacity;
152 wxCheckBox *cbTrackPoint;
153 wxCheckBox *cbAutoAddPoints;
154 wxCheckBox *cbVisuActualCollection;
156 std::vector<ModelShowNPoints*> lstModelShowNPoints;
158 int mActualCollection;
162 std::string UndoRedoDir;
164 vtkPolyData *aux_mesh;
165 std::vector<double> aux_mesh_spc;
175 #endif // __WidgetShowNPoints_h_INCLUDED__