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>
15 class WidgetShowNPoints : public wxPanel
18 WidgetShowNPoints( wxWindow *parent , int type );
20 void StopAutoAddPoints();
22 void OnAutoAddPoints_tool();
23 void OnAutoAddPoints_();
24 void OnAutoAddPoints(wxCommandEvent& event);
25 void OnAddPoint(wxCommandEvent &event);
28 void OnInsertPoint(wxCommandEvent& event);//CFT
30 void OnSetPoint(wxCommandEvent& event);
31 void OnTrackPoint(wxCommandEvent& event);
33 void OnTrackPoint_tool();
35 void StopTrackPoint();
36 void DetectCollectionActive();
38 void OnRenamePoint(wxCommandEvent& event);
40 void OnErasePoint(wxCommandEvent& event);
41 void OnEraseLastPoint(wxCommandEvent &event);
42 void DeleteAllPoints_();
43 void OnDeleteAllPoints_();
44 void OnDeleteAllPoints(wxCommandEvent &event);
46 void OnSavePoints(wxCommandEvent &event);
47 void OnLoadPoints(wxCommandEvent &event);
49 virtual void UpdatePoints(wxCommandEvent &event);
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 CreatePointsIntoNewCollection();
60 void OnDeleteCollection_();
61 void OnDeleteCollection(wxCommandEvent &event);
62 void DeleteCollection_();
63 void OnBackCollection(wxCommandEvent &event);
64 void OnNextCollection(wxCommandEvent &event);
65 void OnSaveCollections(wxCommandEvent &event);
66 void OnSaveCollections_( std::string filename );
67 void OnLoadCollections(wxCommandEvent &event);
68 void OnLoadCollections_( std::string filename );
69 void ResetCollections_();
70 void OnResetCollections_();
71 void OnResetCollections(wxCommandEvent &event);
72 void GetCollectionPoint(int idCol,int idPoint, double *pPoint);
74 void SetCollectionPoint(int idCol, int idPoint, std::vector<double> modPoint);
75 void SetActualCollection( int actual );
77 void OnUndo(wxCommandEvent &event);
78 void OnRedo(wxCommandEvent &event);
79 void UndoRedo_SaveCollection();
80 std::string GetUndoRedoFileName();
83 void RefreshCollectionText();
84 void RefreshColourCollection();
85 void InvertLstPoints_();
86 void OnInvertLstPoints_();
89 //void RefreshPoint(int id);
90 //void RefreshPoints();
93 void SetColour(std::vector<double> colour);
94 void SetOpacity(double opacity);
95 void SetRadio(double radio);
96 void SetImage(vtkImageData *image);
97 void SetRenderer(vtkRenderer *renderer);
98 void SetReferencePoint(std::vector<double> point);
100 void AddPoint(double x, double y, double z, std::string label);
101 void OnInsertPoint_();
102 void InsertPoint(double x, double y, double z, std::string label);//CFT
104 int GetLstModelShowNPointsSize();
105 ModelShowNPoints* GetModelShowNPoints();
106 ModelShowNPoints* GetModelShowNPoints(int id);
107 ViewShowNPoints* GetViewShowNPoints();
108 void SetInitLstPoints( std::vector<double> initLstPointsX, std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels, std::vector<int> initLstIndexs );
110 void SetType(int type);
114 virtual void SetOutputBox();
115 void ErasePoint(int id);
117 std::vector<double> GetLstPointsX();
118 std::vector<double> GetLstPointsY();
119 std::vector<double> GetLstPointsZ();
120 std::vector<std::string> GetLstLabels();
121 std::vector<int> GetLstIndexs();
125 std::vector<ViewShowNPoints*> lstViewShowNPoints;
126 //NTU: For updating points
127 wxStaticText * askPointLabel;
128 wxTextCtrl * textCtrl;
129 wxStaticText * txtNrCollections;
130 wxStaticText * txtNrPoints;
131 wxSlider * sdrOpacity;
133 wxCheckBox * cbTrackPoint;
134 wxCheckBox * cbAutoAddPoints;
136 std::vector<ModelShowNPoints*> lstModelShowNPoints;
138 int mActualCollection;
142 std::string UndoRedoDir;
150 #endif // __WidgetShowNPoints_h_INCLUDED__