AddPoint(x,y,z,label);
}
GetViewShowNPoints()->RefreshPoints();
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnInsertPoint_()
+{
+ // EED 2022-05-19
+ //if (this->renderer==NULL)
+ if (GetViewShowNPoints()->renderer==NULL)
+ {
+ return;
+ }
+ std::vector<int> point = GetModelShowNPoints()->GetReferencePoint();
+ if (point.size()==3)
+ {
+ InsertPoint(point[0],point[1],point[2], (const char*) ( textCtrl->GetValue().mb_str() ) );
+ SetOutputBox();
+ } else {//mpoint.size
+ printf("creaMaracasVisu::ShowNPoints (not match point) \n");
+ }
}
+
+
//------------------------------------------------------------------------
void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event)
{
//------------------------------------------------------------------------
void WidgetShowNPoints::OnInsertPoint (wxCommandEvent& event)//CFT
-{
- // EED 2022-05-19
- //if (this->renderer==NULL)
- if (GetViewShowNPoints()->renderer==NULL)
- {
- return;
- }
-
- std::vector<int> point = GetModelShowNPoints()->GetReferencePoint();
- if (point.size()==3)
- {
- InsertPoint(point[0],point[1],point[2], (const char*) ( textCtrl->GetValue().mb_str() ) );
- SetOutputBox();
- } else {//mpoint.size
- printf("creaMaracasVisu::ShowNPoints (not match point) \n");
- }
+{
+ OnInsertPoint_();
}
} // dialog box
}
-
- //------------------------------------------------------------------------
- void WidgetShowNPoints::OnSetPoint(wxCommandEvent& event)
- {
- int id=GetModelShowNPoints()->GetNearestPoint();
- if((id==-1) && (mtype==1))
- {
- id=0;
- AddPoint(0,0,0,"");
- SetOutputBox();
- }
-
- if (id>=0)
- {
- GetModelShowNPoints()->SetPointId_mReferencePoint(id);
- // EED 2022-05-19
- //RefreshPoint(id);
- //renderer->GetRenderWindow()->Render();
- GetViewShowNPoints()->RefreshPoint(id);
- GetViewShowNPoints()->Render();
- } // if id
- SetOutputBox();
- }
-
//------------------------------------------------------------------------
-void WidgetShowNPoints::OnTrackPoint(wxCommandEvent& event)
+void WidgetShowNPoints::OnSetPoint_()
{
- idTrack = -1;
-// trackPointFlag = cbTrackPoint->GetValue();
- if ( cbTrackPoint->GetValue() == true )
+ int id=GetModelShowNPoints()->GetNearestPoint();
+ if((id==-1) && (mtype==1))
{
- idTrack = GetModelShowNPoints()->IdInsidePoint();
- } // if trackPointFlag
+ id=0;
+ AddPoint(0,0,0,"");
+ SetOutputBox();
+ }
+ if (id>=0)
+ {
+ GetModelShowNPoints()->SetPointId_mReferencePoint(id);
+ // EED 2022-05-19
+ //RefreshPoint(id);
+ //renderer->GetRenderWindow()->Render();
+ GetViewShowNPoints()->RefreshPoint(id);
+ GetViewShowNPoints()->Render();
+ } // if id
+ SetOutputBox();
}
//------------------------------------------------------------------------
-void WidgetShowNPoints::TrackPoint( )
+void WidgetShowNPoints::OnSetPoint(wxCommandEvent& event)
+{
+ OnSetPoint_();
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::TrackingPoint( )
{
if ( cbTrackPoint->GetValue() == true )
{
} // if trackPointFlag
}
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnTrackPoint_tool()
+{
+ cbTrackPoint->SetValue( !cbTrackPoint->GetValue() );
+ OnTrackPoint_();
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnTrackPoint_()
+{
+ idTrack = -1;
+ if ( cbTrackPoint->GetValue() == true )
+ {
+ idTrack = GetModelShowNPoints()->IdInsidePoint();
+ } // if trackPointFlag
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnTrackPoint(wxCommandEvent& event)
+{
+ OnTrackPoint_();
+}
+
//------------------------------------------------------------------------
void WidgetShowNPoints::StopTrackPoint( )
{
idTrack=-1;
}
-
//------------------------------------------------------------------------
void WidgetShowNPoints::OnRenamePoint(wxCommandEvent& event)
{
}
//------------------------------------------------------------------------
- void WidgetShowNPoints::OnErasePoint(wxCommandEvent& event)
- {
- ErasePoint( GetModelShowNPoints()->IdInsidePoint() );
- SetOutputBox();
+ void WidgetShowNPoints::OnErasePoint_()
+ {
+ ErasePoint( GetModelShowNPoints()->IdInsidePoint() );
+ SetOutputBox();
// EED 2022-05-19
- //renderer->GetRenderWindow()->Render();
+ //renderer->GetRenderWindow()->Render();
GetViewShowNPoints()->Render();
StopTrackPoint();
+ }
+
+//------------------------------------------------------------------------
+ void WidgetShowNPoints::OnErasePoint(wxCommandEvent& event)
+ {
+ OnErasePoint_();
}
//------------------------------------------------------------------------
void WidgetShowNPoints::DeleteAllPoints()
{
// EED 2022-05-19
- //int id,size=lstActorsSphere.size();
+ //int id,size=lstActorsSphere.size();
int id,size=GetViewShowNPoints()->lstActorsSphere.size();
- for (id=size-1;id>=0;id--)
- {
- ErasePoint(id);
- }
- SetOutputBox();
+ for (id=size-1;id>=0;id--)
+ {
+ ErasePoint(id);
+ }
+ SetOutputBox();
// EED 2022-05-19
- //renderer->GetRenderWindow()->Render();
+ //renderer->GetRenderWindow()->Render();
GetViewShowNPoints()->Render();
}
+
//------------------------------------------------------------------------
void WidgetShowNPoints::OnDeleteAllPoints(wxCommandEvent& event)
{
}
//------------------------------------------------------------------------
-void WidgetShowNPoints::OnInsertCollectionAfter(wxCommandEvent &event)
+void WidgetShowNPoints::OnInsertCollectionAfter_()
{
mActualCollection++;
InsertCollection();
StopTrackPoint();
}
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnInsertCollectionAfter(wxCommandEvent &event)
+{
+ OnInsertCollectionAfter_();
+}
+
//------------------------------------------------------------------------
void WidgetShowNPoints::DeleteCollection_()
{
}
//------------------------------------------------------------------------
-void WidgetShowNPoints::OnDeleteCollection(wxCommandEvent &event)
+void WidgetShowNPoints::OnDeleteCollection_()
{
DeleteCollection_();
RefreshCollectionText();
StopTrackPoint();
}
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnDeleteCollection(wxCommandEvent &event)
+{
+ OnDeleteCollection_();
+}
+
//------------------------------------------------------------------------
void WidgetShowNPoints::OnBackCollection(wxCommandEvent &event)
{
return lstIndexs;
}
+
+void WidgetShowNPoints::CreatePatch01()
+{
+ if ( (lstModelShowNPoints.size()==1) && (GetModelShowNPoints()->GetLstPointsSize()==4) )
+ {
+ StopTrackPoint();
+ double px,py,pz;
+ double dx,dy,dz,s;
+ std::vector<int> lstX = GetModelShowNPoints()->GetLstPointsX();
+ std::vector<int> lstY = GetModelShowNPoints()->GetLstPointsY();
+ std::vector<int> lstZ = GetModelShowNPoints()->GetLstPointsZ();
+
+ // --- Group 0 ---
+ ErasePoint( 2 );
+ ErasePoint( 2 );
+ dx=lstX[1]-lstX[0];
+ dy=lstY[1]-lstY[0];
+ dz=lstZ[1]-lstZ[0];
+ s=0.33333;
+ px = lstX[0] + dx*s;
+ py = lstY[0] + dy*s;
+ pz = lstZ[0] + dz*s;
+ InsertPoint(px ,py, pz,"");
+ s=s*2;
+ px = lstX[0] + dx*s;
+ py = lstY[0] + dy*s;
+ pz = lstZ[0] + dz*s;
+ InsertPoint(px ,py, pz,"");
+
+ // --- Group 1 ---
+ OnInsertCollectionAfter_();
+ px = (lstX[0]+lstX[3])/2;
+ py = (lstY[0]+lstY[3])/2;
+ pz = (lstZ[0]+lstZ[3])/2;
+ InsertPoint(px ,py, pz,"");
+ px = (lstX[1]+lstX[2])/2;
+ py = (lstY[1]+lstY[2])/2;
+ pz = (lstZ[1]+lstZ[2])/2;
+ InsertPoint(px ,py, pz,"");
+ px = (lstX[0]+lstX[1]+lstX[2]+lstX[3])/4;
+ py = (lstY[0]+lstY[1]+lstY[2]+lstY[3])/4;
+ pz = (lstZ[0]+lstZ[1]+lstZ[2]+lstZ[3])/4;
+ InsertPoint(px ,py, pz,"");
+
+
+ // --- Group 2 ---
+ OnInsertCollectionAfter_();
+ px = lstX[3];
+ py = lstY[3];
+ pz = lstZ[3];
+ InsertPoint(px ,py, pz,"");
+ px = lstX[2];
+ py = lstY[2];
+ pz = lstZ[2];
+ InsertPoint(px ,py, pz,"");
+ dx=lstX[2]-lstX[3];
+ dy=lstY[2]-lstY[3];
+ dz=lstZ[2]-lstZ[3];
+ s=0.33333;
+ px = lstX[3] + dx*s;
+ py = lstY[3] + dy*s;
+ pz = lstZ[3] + dz*s;
+ InsertPoint(px ,py, pz,"");
+ s=s*2;
+ px = lstX[3] + dx*s;
+ py = lstY[3] + dy*s;
+ pz = lstZ[3] + dz*s;
+ InsertPoint(px ,py, pz,"");
+
+
+ SetOutputBox();
+ } else {
+ printf("EED WidgetShowNPoints::CreatePatch01 Warning patch not apply. Need juste one group with four points\n");
+ } // if
+}