#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include <wx/notebook.h>
-#include <wx/spinctrl.h>
#include <vtkStaticPointLocator.h>
WidgetShowNPoints::WidgetShowNPoints(wxWindow *parent, int type)
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
{
+ printf("WidgetShowNPoints::WidgetShowNPoints Start\n");
aux_mesh = NULL;
aux_mesh_spc.push_back(1);
aux_mesh_spc.push_back(1);
wxDefaultSize,
wxNB_TOP );
panel2 = new wxPanel(bookGroupManager);
- wxCheckBox *cbVisuActualCollection = new wxCheckBox ( panel2,-1, _T("A.V.") , wxDefaultPosition, sizeButton );
+ cbVisuActualCollection = new wxCheckBox ( panel2,-1, _T("A.V.") , wxDefaultPosition, sizeButton );
txtNrCollections = new wxStaticText ( panel2,-1, _T(" 1/1 "));
wxButton *btnBackCollection = new wxButton ( panel2, -1, _T("<") , wxDefaultPosition, sizeButton );
wxButton *btnNextCollection = new wxButton ( panel2, -1, _T(">") , wxDefaultPosition, sizeButton );
wxButton *btnResetCollection = new wxButton ( panel2, -1, _T("--") , wxDefaultPosition, sizeButton );
wxButton *btnSaveCollection = new wxButton ( panel2, -1, _T("Save") , wxDefaultPosition, sizeButton );
wxButton *btnLoadCollection = new wxButton ( panel2, -1, _T("Load") , wxDefaultPosition, sizeButton );
+ wxButton *btnUndo = new wxButton ( panel2, -1, _T("Undo") , wxDefaultPosition, sizeButton );
+ wxButton *btnRedo = new wxButton ( panel2, -1, _T("Redo") , wxDefaultPosition, sizeButton );
+
+ sCtrlRadio = new wxSpinCtrl( panel2, -1 , wxEmptyString, wxDefaultPosition, sizeButton );
+ sCtrlRadio->SetRange(1,10);
+ sCtrlRadio->SetValue( 2 );
+ sCtrlOpacity= new wxSpinCtrl( panel2, -1 , wxEmptyString, wxDefaultPosition, sizeButton );
+ sCtrlOpacity->SetRange(0,10);
+ sCtrlOpacity->SetValue( 10 );
+
wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1);
wxFlexGridSizer *sizer2 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer3 = new wxFlexGridSizer(3);
wxFlexGridSizer *sizer4 = new wxFlexGridSizer(3);
- wxFlexGridSizer *sizer5 = new wxFlexGridSizer(1);
+ wxFlexGridSizer *sizer5 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer5a = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer6 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer7 = new wxFlexGridSizer(2);
- // wxStaticText* txOpacity = new wxStaticText(panel2, -1, wxString(_T("Op:")));
+ wxFlexGridSizer *sizer8 = new wxFlexGridSizer(2);
cbVisuActualCollection -> SetToolTip( _T("Visu actual collection") );
btnInsertCollectionBefore -> SetToolTip( _T("+ Add group before") );
btnInsertCollectionAfter -> SetToolTip( _T("+> Add group after") );
btnDeleteCollection -> SetToolTip( _T("- Erase group") );
btnResetCollection -> SetToolTip( _T("-- Reset : Erase all groups") );
+ sCtrlRadio -> SetToolTip( _T("Radio") );
+ sCtrlOpacity -> SetToolTip( _T("Opacity") );
- sdrOpacity = new wxSlider(panel2, -1, 0, 0, 100, wxDefaultPosition, sizeSlider, wxSL_LABELS);
-// wxStaticText* txRadio = new wxStaticText(panel2, -1, wxString(_T("R:")));
- sdrRadio = new wxSlider(panel2, -1, 0, 1, 50, wxDefaultPosition, sizeSlider, wxSL_LABELS);
-
- sdrRadio -> SetToolTip( _T("Radio") );
- sdrOpacity -> SetToolTip( _T("Opacity") );
+// sdrOpacity = new wxSlider(panel2, -1, 0, 0, 100, wxDefaultPosition, sizeSlider, wxSL_LABELS);
+// sdrRadio = new wxSlider(panel2, -1, 0, 1, 50, wxDefaultPosition, sizeSlider, wxSL_LABELS);
+// sdrRadio -> SetToolTip( _T("Radio") );
+// sdrOpacity -> SetToolTip( _T("Opacity") );
+
+ Connect(cbVisuActualCollection->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnVisuActualCollection );
+ Connect(btnBackCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) & WidgetShowNPoints::OnBackCollection );
+ Connect(btnNextCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) & WidgetShowNPoints::OnNextCollection );
+ Connect(btnInsertCollectionBefore->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) & WidgetShowNPoints::OnInsertCollectionBefore );
+ Connect(btnInsertCollectionAfter->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) & WidgetShowNPoints::OnInsertCollectionAfter );
+ Connect(btnDeleteCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) & WidgetShowNPoints::OnDeleteCollection );
- Connect(btnBackCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnBackCollection );
- Connect(btnNextCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnNextCollection );
- Connect(btnInsertCollectionBefore->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnInsertCollectionBefore );
- Connect(btnInsertCollectionAfter->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnInsertCollectionAfter );
- Connect(btnDeleteCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnDeleteCollection );
- Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction) & WidgetShowNPoints::UpdatePoints );
- Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction) & WidgetShowNPoints::UpdatePoints );
- Connect(btnSaveCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnSaveCollections );
- Connect(btnLoadCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnLoadCollections );
- Connect(btnResetCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnResetCollections );
+// Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) & WidgetShowNPoints::UpdatePoints );
+// Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) & WidgetShowNPoints::UpdatePoints );
+ Connect( sCtrlRadio->GetId() ,wxEVT_COMMAND_SPINCTRL_UPDATED ,(wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &WidgetShowNPoints::UpdatePoints);
+ Connect( sCtrlOpacity->GetId() ,wxEVT_COMMAND_SPINCTRL_UPDATED ,(wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &WidgetShowNPoints::UpdatePoints);
+ Connect(btnSaveCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) & WidgetShowNPoints::OnSaveCollections );
+ Connect(btnLoadCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) & WidgetShowNPoints::OnLoadCollections );
+ Connect(btnResetCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) & WidgetShowNPoints::OnResetCollections );
+ Connect(btnUndo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnUndo );
+ Connect(btnRedo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnRedo );
+
sizer2->Add( btnBackCollection );
sizer2->Add( btnNextCollection );
sizer3->Add( btnInsertCollectionBefore );
sizer4->Add( btnLoadCollection );
sizer4->Add( btnSaveCollection );
// sizer5->Add( txRadio ,wxGROW );
- sizer5->Add( sdrRadio ,wxGROW );
+// sizer5->Add( sdrRadio ,wxGROW );
// sizer5->Add( txOpacity ,wxGROW );
- sizer5->Add( sdrOpacity ,wxGROW );
-
- /*
- wxChoice *wxchoiceA = new wxChoice ( panel2 , -1, wxDefaultPosition,sizeButton2);
- wxChoice *wxchoiceB = new wxChoice ( panel2 , -1, wxDefaultPosition,sizeButton2);
- wxchoiceA->Append(_T("0") );
- wxchoiceA->Append(_T("1") );
- wxchoiceA->Append(_T("2") );
- wxchoiceA->Append(_T("3") );
- wxchoiceA->Append(_T("4") );
- wxchoiceA->Append(_T("5") );
- wxchoiceA->Append(_T("6") );
- wxchoiceA->Append(_T("7") );
- wxchoiceA->Append(_T("8") );
- wxchoiceA->Append(_T("9") );
- wxchoiceA->Append(_T("10") );
- wxchoiceB->Append(_T("0%") );
- wxchoiceB->Append(_T("10%") );
- wxchoiceB->Append(_T("20%") );
- wxchoiceB->Append(_T("30%") );
- wxchoiceB->Append(_T("40%") );
- wxchoiceB->Append(_T("50%") );
- wxchoiceB->Append(_T("60%") );
- wxchoiceB->Append(_T("70%") );
- wxchoiceB->Append(_T("80%") );
- wxchoiceB->Append(_T("90") );
- wxchoiceB->Append(_T("100") );
-*/
+// sizer5->Add( sdrOpacity ,wxGROW );
- wxSpinCtrl *mwxSpinButtonA = new wxSpinCtrl( panel2, -1 , wxEmptyString, wxDefaultPosition, sizeButton );
- mwxSpinButtonA->SetRange(1,10);
- mwxSpinButtonA->SetValue( 2 );
- wxSpinCtrl *mwxSpinButtonB = new wxSpinCtrl( panel2, -1 , wxEmptyString, wxDefaultPosition, sizeButton );
- mwxSpinButtonB->SetRange(0,10);
- mwxSpinButtonB->SetValue( 10 );
+ sizer5->Add( sCtrlRadio );
+ sizer5->Add( sCtrlOpacity );
-
-// sizer5a->Add( wxchoiceA ,wxGROW );
-// sizer5a->Add( wxchoiceB ,wxGROW );
- sizer5a->Add( mwxSpinButtonA ,wxGROW );
- sizer5a->Add( mwxSpinButtonB ,wxGROW );
-
-
sizer6->Add( btnDeleteCollection );
sizer6->Add( btnResetCollection );
- sizer7->Add( cbVisuActualCollection );
- sizer7->Add( txtNrCollections );
+ sizer7->Add( cbVisuActualCollection );
+ sizer7->Add( txtNrCollections );
+
+ sizer8->Add( btnUndo );
+ sizer8->Add( btnRedo );
sizer1->Add( sizer7 );
sizer1->Add( sizer2 );
sizer1->Add( sizer3 );
sizer1->Add( sizer6 );
sizer1->Add( sizer4 );
- sizer1->Add( sizer5a );
+ sizer1->Add( sizer5 );
+ sizer1->Add( sizer8 );
- sizer1->Add( sizer5 ,wxGROW );
+// sizer1->Add( sizer5 ,wxGROW );
MNPsizer = sizer1;
panel2->SetSizer( MNPsizer );
wxButton *btnErasePoint = new wxButton( panel, -1, _T("-") , wxDefaultPosition, sizeButton );
// wxButton *btnEraseLastPoint = new wxButton( panel, -1, _T("- lst") , wxDefaultPosition, sizeButton );
wxButton *btnDeleteAllPoints = new wxButton( panel, -1, _T("--") , wxDefaultPosition, sizeButton );
- wxButton *btnUndo = new wxButton( panel, -1, _T("Undo") , wxDefaultPosition, sizeButton );
- wxButton *btnRedo = new wxButton( panel, -1, _T("Redo") , wxDefaultPosition, sizeButton );
+
+ wxButton *btnUndo = NULL;
+ wxButton *btnRedo = NULL;
+
wxButton *btnSavePoints = NULL;
wxButton *btnLoadPoints = NULL;
- btnBackPoint -> SetToolTip( _T("Select befor point") );
- btnNextPoint -> SetToolTip( _T("Select next point") );
+ btnBackPoint -> SetToolTip( _T("Select befor point") );
+ btnNextPoint -> SetToolTip( _T("Select next point") );
cbAutoAddPoints -> SetToolTip( _T("Auto Add point") );
btnAddPoint -> SetToolTip( _T("+ Add point") );
- btnInsertPoint -> SetToolTip( _T("(-) Insert point") );
+ btnInsertPoint -> SetToolTip( _T("(+) Insert point") );
btnMovePointUp -> SetToolTip( _T("Move point Up in the normal direction") );
btnMovePointDown -> SetToolTip( _T("Move point Down in the normal direction") );
-
+ btnRenamePoint -> SetToolTip( _T("Rename label for each point") );
+ textCtrl -> SetToolTip( _T("Point label") );
+
+
btnErasePoint -> SetToolTip( _T("- Erase point") );
-// btnEraseLastPoint -> SetToolTip( _T("- lst Erase last point") );
+// btnEraseLastPoint -> SetToolTip( _T("- lst Erase last point") );
btnDeleteAllPoints -> SetToolTip( _T("-- Erase all points") );
if ( mtype==0 )
{
- btnSavePoints = new wxButton( panel, -1, _T("Save points"));
- btnLoadPoints = new wxButton( panel, -1, _T("Load points"));
- Connect(btnSavePoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSavePoints);
- Connect(btnLoadPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnLoadPoints);
+ btnUndo = new wxButton( panel, -1, _T("Undo") , wxDefaultPosition, sizeButton );
+ btnRedo = new wxButton( panel, -1, _T("Redo") , wxDefaultPosition, sizeButton );
+ btnSavePoints = new wxButton( panel, -1, _T("Save") , wxDefaultPosition, sizeButton );
+ btnLoadPoints = new wxButton( panel, -1, _T("Load") , wxDefaultPosition, sizeButton );
+ Connect(btnSavePoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSavePoints );
+ Connect(btnLoadPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnLoadPoints );
+ Connect(btnUndo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnUndo );
+ Connect(btnRedo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnRedo );
} // if mtype
txtNrPoints = new wxStaticText(panel,-1, _T(" -/-"));
if ( (mtype==0) || (mtype==3) )
{
//NTU: Sliders for opacity and radio change
- txOpacity = new wxStaticText(panel, -1, wxString(_T(" Points Opacity ")));
- sdrOpacity = new wxSlider(panel, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
- txRadio = new wxStaticText(panel, -1, wxString(_T(" Points Radius ")));
- sdrRadio = new wxSlider(panel, -1, 0, 1, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
- //NTU: Slider events
- Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
- Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
+// txOpacity = new wxStaticText(panel, -1, wxString(_T(" Points Opacity ")));
+// sdrOpacity = new wxSlider(panel, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
+// txRadio = new wxStaticText(panel, -1, wxString(_T(" Points Radius ")));
+// sdrRadio = new wxSlider(panel, -1, 0, 1, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
+// //NTU: Slider events
+// Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
+// Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
+
+ sCtrlRadio = new wxSpinCtrl( panel, -1 , wxEmptyString, wxDefaultPosition, sizeButton );
+ sCtrlRadio->SetRange(1,10);
+ sCtrlRadio->SetValue( 2 );
+ sCtrlOpacity= new wxSpinCtrl( panel, -1 , wxEmptyString, wxDefaultPosition, sizeButton );
+ sCtrlOpacity->SetRange(0,10);
+ sCtrlOpacity->SetValue( 10 );
+ Connect( sCtrlRadio->GetId() ,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &WidgetShowNPoints::UpdatePoints);
+ Connect( sCtrlOpacity->GetId() ,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &WidgetShowNPoints::UpdatePoints);
+
+
} // if mtype 0 3
- Connect(cbAutoAddPoints->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WidgetShowNPoints::OnAutoAddPoints);
- Connect(btnBackPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnBackPoint);
- Connect(btnNextPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnNextPoint);
- Connect(btnAddPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnAddPoint);
- Connect(btnInsertPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnInsertPoint);//CFT
- Connect(btnMovePointUp->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnMovePointUp);
- Connect(btnMovePointDown->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnMovePointDown);
- Connect(btnSetPositionPoint->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint);
- Connect(btnRenamePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnRenamePoint);
-// Connect(btnEraseLastPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnEraseLastPoint);
- Connect(btnErasePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnErasePoint);
- Connect(btnDeleteAllPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnDeleteAllPoints);
- Connect(cbTrackPoint->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WidgetShowNPoints::OnTrackPoint);
- Connect(btnUndo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnUndo);
- Connect(btnRedo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnRedo);
+ Connect(cbAutoAddPoints->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WidgetShowNPoints::OnAutoAddPoints );
+ Connect(btnBackPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnBackPoint );
+ Connect(btnNextPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnNextPoint );
+ Connect(btnAddPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnAddPoint );
+ Connect(btnInsertPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnInsertPoint );
+ Connect(btnMovePointUp->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnMovePointUp );
+ Connect(btnMovePointDown->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnMovePointDown );
+ Connect(btnSetPositionPoint->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint );
+ Connect(btnRenamePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnRenamePoint );
+// Connect(btnEraseLastPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnEraseLastPoint );
+ Connect(btnErasePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnErasePoint );
+ Connect(btnDeleteAllPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnDeleteAllPoints );
+ Connect(cbTrackPoint->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WidgetShowNPoints::OnTrackPoint );
wxFlexGridSizer *sizer0 = new wxFlexGridSizer(1);
wxFlexGridSizer *sizer1 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer2 = new wxFlexGridSizer(3);
wxFlexGridSizer *sizer3 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer4 = new wxFlexGridSizer(3);
- wxFlexGridSizer *sizer5 = new wxFlexGridSizer(2);
+// wxFlexGridSizer *sizer5 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer6 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer7 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer8 = new wxFlexGridSizer(2);
sizer4->Add( btnErasePoint );
// sizer4->Add( btnEraseLastPoint );
sizer4->Add( btnDeleteAllPoints );
- sizer5->Add( btnUndo );
- sizer5->Add( btnRedo );
+// sizer5->Add( btnUndo );
+// sizer5->Add( btnRedo );
sizer6->Add( btnBackPoint );
sizer6->Add( btnNextPoint );
sizer7->Add( btnMovePointUp );
sizer0->Add(sizer3);
sizer0->Add(sizer4);
sizer0->Add(sizer1);
- sizer0->Add(sizer5);
+ // sizer0->Add(sizer5);
if ( (mtype==0) || (mtype==3) )
{
- wxFlexGridSizer *sizer5 = new wxFlexGridSizer(1);
- sizer5->Add(txRadio);
- sizer5->Add(sdrRadio,1,wxGROW );
- sizer5->Add(txOpacity);
- sizer5->Add(sdrOpacity,1,wxGROW );
+ wxFlexGridSizer *sizer5 = new wxFlexGridSizer(2);
+// sizer5->Add(txRadio);
+// sizer5->Add(sdrRadio,1,wxGROW );
+// sizer5->Add(txOpacity);
+// sizer5->Add(sdrOpacity,1,wxGROW );
+
+ sizer5->Add( sCtrlRadio );
+ sizer5->Add( sCtrlOpacity );
+
+
sizer0->Add(sizer5);
+
} // if mtype 0 3
if ( mtype==0 )
{
+ wxFlexGridSizer *sizer5 = new wxFlexGridSizer(2);
wxFlexGridSizer *sizer6 = new wxFlexGridSizer(2);
- sizer6->Add(btnSavePoints);
- sizer6->Add(btnLoadPoints);
- sizer0->Add(sizer6);
+ sizer6->Add( btnSavePoints );
+ sizer6->Add( btnLoadPoints );
+ sizer5->Add( btnUndo );
+ sizer5->Add( btnRedo );
+ sizer0->Add( sizer6 );
+ sizer0->Add( sizer5 );
} // if mtype 0
sizer = sizer0;
}
txtNrPoints = new wxStaticText(panel,-1, _T("-/-"));
//NTU: Sliders for opacity and radio change
+// sdrRadio = new wxSlider(panel, -1, 0, 1, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
+// sdrOpacity = new wxSlider(panel, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
+// Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
+// Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
wxStaticText* txOpacity = new wxStaticText(panel, -1, wxString(_T(" Points Opacity ")));
- sdrOpacity = new wxSlider(panel, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
wxStaticText* txRadio = new wxStaticText(panel, -1, wxString(_T(" Points Radio ")));
- sdrRadio = new wxSlider(panel, -1, 0, 1, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
+
+ sCtrlRadio = new wxSpinCtrl( panel, -1 , wxEmptyString, wxDefaultPosition, sizeButton );
+ sCtrlRadio->SetRange(1,10);
+ sCtrlRadio->SetValue( 2 );
+ sCtrlOpacity= new wxSpinCtrl( panel, -1 , wxEmptyString, wxDefaultPosition, sizeButton );
+ sCtrlOpacity->SetRange(0,10);
+ sCtrlOpacity->SetValue( 10 );
+ Connect( sCtrlRadio->GetId() ,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &WidgetShowNPoints::UpdatePoints);
+ Connect( sCtrlOpacity->GetId() ,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &WidgetShowNPoints::UpdatePoints);
+
+
Connect(btnSetPositionPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint);
- Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
- Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1);
sizer1->Add(btnSetPositionPoint);
sizer1->Add(txtNrPoints);
sizer1->Add(txRadio);
- sizer1->Add(sdrRadio,1,wxGROW );
- sizer1->Add(txOpacity);
- sizer1->Add(sdrOpacity,1,wxGROW );
+ //sizer1->Add(sdrRadio,1,wxGROW );
+ //sizer1->Add(sdrOpacity,1,wxGROW );
+ sizer1->Add(sCtrlRadio );
+ sizer1->Add(sCtrlOpacity);
sizer = sizer1;
}
panelParent->Layout();
} // if sizer
} // if mtype 4
+
+ printf("WidgetShowNPoints::WidgetShowNPoints End\n");
+
}
//------------------------------------------------------------------------
lstModelShowNPoints[i]->SetRadio( radio );
} // for i
//NTU: For Slider
- sdrRadio->SetValue(radio);
+// sdrRadio->SetValue(radio);
+ sCtrlRadio->SetValue(radio);
}
//------------------------------------------------------------------------
lstViewShowNPoints[i]->mopacity = opacity;
} // for i
//NTU: For Slider
- sdrOpacity->SetValue( opacity*100.0 );
+// sdrOpacity->SetValue( opacity*100.0 );
+ sCtrlOpacity->SetValue( opacity*10.0 );
+
}
//GetModelShowNPoints()->SetRadio( sdrRadio->GetValue() ) ;
//RefreshPoints();
- double opacity = sdrOpacity->GetValue()/100.0;
- double radio = sdrRadio->GetValue();
+// double opacity = sdrOpacity->GetValue()/100.0;
+// double radio = sdrRadio->GetValue();
+ double opacity = (sCtrlOpacity->GetValue()*10)/100.0;
+ double radio = sCtrlRadio->GetValue();
+
int i,size = lstViewShowNPoints.size();
for (i=0 ; i<size ; i++)
{
//------------------------------------------------------------------------
double WidgetShowNPoints::GetRadio()
{
- return sdrRadio->GetValue();
+// return sdrRadio->GetValue();
+ return sCtrlRadio->GetValue();
}
//------------------------------------------------------------------------
double WidgetShowNPoints::GetOpacity()
{
- return sdrOpacity->GetValue()/100;
+// return sdrOpacity->GetValue()/100;
+ return (sCtrlOpacity->GetValue()*10)/100.0;
}
//------------------------------------------------------------------------
{
lstViewShowNPoints[i] -> mcolour = colourAll;
lstViewShowNPoints[i] -> ratioRadio = 1;
+ if (cbVisuActualCollection->GetValue()==true)
+ {
+ lstViewShowNPoints[i] -> mopacity = 0.0;
+ } else {
+ lstViewShowNPoints[i] -> mopacity = sCtrlOpacity->GetValue()*10.0/100.0;
+ }
lstViewShowNPoints[i]->RefreshEachPoint();
} // for i
// Actual collection
lstViewShowNPoints[mActualCollection] -> mcolour = colourActualGroup;
+ lstViewShowNPoints[mActualCollection] -> mopacity = sCtrlOpacity->GetValue()*10.0/100.0;
lstViewShowNPoints[mActualCollection] -> ratioRadio = 1.1;
lstViewShowNPoints[mActualCollection] -> RefreshEachPoint();
colourActualPoint.push_back(0);
colourActualPoint.push_back(1);
double radio = GetModelShowNPoints()->GetRadio();
- lstViewShowNPoints[mActualCollection] -> mcolour = colourActualPoint;
+ lstViewShowNPoints[mActualCollection] -> mcolour = colourActualPoint;
lstViewShowNPoints[mActualCollection]->RefreshPoint( curPnt );
lstViewShowNPoints[mActualCollection] -> mcolour = colourActualGroup;
- }
+ } // if
lstViewShowNPoints[mActualCollection] -> renderer->GetRenderWindow()->Render();
}
aux_mesh_type = 0;
}// if params size
}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnVisuActualCollection(wxCommandEvent &event)
+{
+ printf("EED WidgetShowNPoints::OnVisuActualCollection \n");
+ RefreshCollectionText();
+ RefreshColourCollection();
+}