sdrRadio -> SetToolTip( _T("Radio") );
sdrOpacity -> SetToolTip( _T("Opacity") );
-
Connect(btnBackCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnBackCollection );
Connect(btnNextCollection->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & WidgetShowNPoints::OnNextCollection );
if ( (mtype==0) || (mtype==3) || (mtype==4) )
{
// Widget interface
-// askPointLabel = new wxStaticText(panel, -1, _T("Label:")); // JPR
- textCtrl = new wxTextCtrl(panel, -1, wxEmptyString , wxDefaultPosition, sizeButton);
- wxButton *btnAddPoint = new wxButton( panel, -1, _T("+") , wxDefaultPosition, sizeButton );
- wxButton *btnInsertPoint = new wxButton( panel, -1, _T("(+)") , wxDefaultPosition, sizeButton );//CFT
- wxButton *btnSetPositionPoint= new wxButton( panel, -1, _T("Set") , wxDefaultPosition, sizeButton );
- cbTrackPoint = new wxCheckBox(panel,-1, _T("Tra.") , wxDefaultPosition, sizeButton );
- wxButton *btnRenamePoint = new wxButton( panel, -1, _T("Ren.") , wxDefaultPosition, sizeButton );
- 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 *btnSavePoints = NULL;
- wxButton *btnLoadPoints = NULL;
+// askPointLabel = new wxStaticText(panel, -1, _T("Label:")); // JPR
+ textCtrl = new wxTextCtrl(panel, -1, wxEmptyString , wxDefaultPosition, sizeButton);
+ cbAutoAddPoints = new wxCheckBox(panel,-1, _T("Auto") , wxDefaultPosition, sizeButton );
+ wxButton *btnAddPoint = new wxButton( panel, -1, _T("+") , wxDefaultPosition, sizeButton );
+ wxButton *btnInsertPoint = new wxButton( panel, -1, _T("(+)") , wxDefaultPosition, sizeButton );//CFT
+ wxButton *btnSetPositionPoint = new wxButton( panel, -1, _T("Set") , wxDefaultPosition, sizeButton );
+ cbTrackPoint = new wxCheckBox(panel,-1, _T("Tra.") , wxDefaultPosition, sizeButton );
+ wxButton *btnRenamePoint = new wxButton( panel, -1, _T("Ren.") , wxDefaultPosition, sizeButton );
+ 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 *btnSavePoints = NULL;
+ wxButton *btnLoadPoints = NULL;
+ cbAutoAddPoints -> SetToolTip( _T("Auto Add point") );
btnAddPoint -> SetToolTip( _T("+ Add point") );
btnInsertPoint -> SetToolTip( _T("(-) Insert point") );
btnErasePoint -> SetToolTip( _T("- Erase point") );
Connect(sdrOpacity->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
Connect(sdrRadio->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &WidgetShowNPoints::UpdatePoints);
} // if mtype 0 3
+ Connect(cbAutoAddPoints->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WidgetShowNPoints::OnAutoAddPoints);
Connect(btnAddPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnAddPoint);
Connect(btnInsertPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnInsertPoint);//CFT
Connect(btnSetPositionPoint->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint);
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_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnTrackPoint);
+ 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);
wxFlexGridSizer *sizer0 = new wxFlexGridSizer(1);
wxFlexGridSizer *sizer5 = new wxFlexGridSizer(2);
sizer1->Add( textCtrl );
sizer1->Add( btnRenamePoint );
+ sizer2->Add( cbAutoAddPoints );
+ sizer2->Add( new wxStaticText(panel, -1, _T(" ")) );
sizer2->Add( btnAddPoint );
sizer2->Add( btnInsertPoint );//CFT
sizer3->Add( btnSetPositionPoint );
{
// EED 2022-05-19
//if (this->renderer==NULL)
+
+ StopAutoAddPoints();
+ StopTrackPoint();
if (GetViewShowNPoints()->renderer==NULL)
{
return;
}
//------------------------------------------------------------------------
-void WidgetShowNPoints::OnAddPoint_()
+void WidgetShowNPoints::OnInsertPoint (wxCommandEvent& event)//CFT
+{
+ OnInsertPoint_();
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnAddPoint__()
{
// EED 2022-05-19
//if (this->renderer==NULL)
UndoRedo_SaveCollection();
}
+void WidgetShowNPoints::OnAddPoint_()
+{
+ StopAutoAddPoints();
+ StopTrackPoint();
+ OnAddPoint__();
+}
+
//------------------------------------------------------------------------
void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event)
{
}
//------------------------------------------------------------------------
-void WidgetShowNPoints::OnInsertPoint (wxCommandEvent& event)//CFT
+void WidgetShowNPoints::AutoAddPoints()
{
- OnInsertPoint_();
+ if ( cbAutoAddPoints->GetValue() == true )
+ {
+ OnAddPoint__();
+ } // if cbAutoAddPoints
}
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnAutoAddPoints_tool()
+{
+ cbAutoAddPoints->SetValue( !cbAutoAddPoints->GetValue() );
+ OnTrackPoint_();
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnAutoAddPoints_()
+{
+ StopTrackPoint();
+ printf("EED WidgetShowNPoints::OnAutoAddPoints_ \n");
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnAutoAddPoints(wxCommandEvent& event)
+{
+ StopTrackPoint();
+ printf("EED WidgetShowNPoints::OnAutoAddPoints \n");
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::StopAutoAddPoints( )
+{
+ cbAutoAddPoints->SetValue(false);
+}
//------------------------------------------------------------------------
void WidgetShowNPoints::SetOutputBox()
//------------------------------------------------------------------------
void WidgetShowNPoints::OnSetPoint_()
{
+ StopAutoAddPoints();
+ StopTrackPoint();
+
int id=GetModelShowNPoints()->GetNearestPoint();
if((id==-1) && (mtype==1))
{
//------------------------------------------------------------------------
void WidgetShowNPoints::OnTrackPoint_()
{
+ StopAutoAddPoints();
+
idTrack = -1;
if ( cbTrackPoint->GetValue() == true )
{
//------------------------------------------------------------------------
void WidgetShowNPoints::OnTrackPoint(wxCommandEvent& event)
{
+ printf("WidgetShowNPoints::OnTrackPoint \n");
OnTrackPoint_();
}
//------------------------------------------------------------------------
void WidgetShowNPoints::OnErasePoint_()
{
+ StopAutoAddPoints();
+ StopTrackPoint();
+
ErasePoint( GetModelShowNPoints()->IdInsidePoint() );
SetOutputBox();
// EED 2022-05-19
// EED 2022-05-19
//ErasePoint( lstActorsSphere.size()-1 );
//renderer->GetRenderWindow()->Render();
+ StopAutoAddPoints();
+ StopTrackPoint();
+
int id = GetViewShowNPoints()->lstActorsSphere.size()-1;
ErasePoint( id );
UndoRedo_SaveCollection();
void WidgetShowNPoints::OnDeleteAllPoints_()
{
+ StopAutoAddPoints();
+ StopTrackPoint();
+
DeleteAllPoints_();
UndoRedo_SaveCollection();
}
//------------------------------------------------------------------------
void WidgetShowNPoints::OnInvertLstPoints_()
{
+ StopAutoAddPoints();
+ StopTrackPoint();
+
InvertLstPoints_();
SetOutputBox();
UndoRedo_SaveCollection();