return lstPointsZ;
}
-
+//------------------------------------------------------------------------
+ std::vector<std::string> WidgetShowNPoints::GetLstLabels()
+{
+ return lstLabels;
+}
+
+
//------------------------------------------------------------------------
lstPointsX.push_back( mpoint[0] );
lstPointsY.push_back( mpoint[1] );
lstPointsZ.push_back( mpoint[2] );
+ lstLabels.push_back( (const char*) ( textCtrl->GetValue().mb_str() ) );
// Sphere
vtkSphereSource *vtksphere = vtkSphereSource::New();
renderer->AddActor( sphereActor );
// Actor
- vtkTextActor3D *text = vtkTextActor3D::New();
- text->SetPosition( mradio+spc[0]*mpoint[0] , spc[1]*mpoint[1] , spc[2]*mpoint[2] );
- text->SetInput( (const char*) ( textCtrl->GetValue().mb_str() ) );
- renderer->AddActor( text );
- lstActorsText.push_back(text);
+ vtkTextActor3D *textActor = vtkTextActor3D::New();
+ textActor->SetPosition( mradio+spc[0]*mpoint[0] , spc[1]*mpoint[1] , spc[2]*mpoint[2] );
+ textActor->SetInput( (const char*) ( textCtrl->GetValue().mb_str() ) );
+ renderer->AddActor( textActor );
+ lstActorsText.push_back(textActor);
renderer->GetRenderWindow()->Render();
- //--BBTK
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ"));
+ SetOutputBox();
} else {//mpoint.size
printf("creaMaracasVisu::ShowNPoints (not match point) \n");
} // renderer
}
+ void WidgetShowNPoints::SetOutputBox()
+ {
+ //--BBTK
+ mbbShowNPoints->bbSetOutputlstPointsX( GetLstPointsX() );
+ mbbShowNPoints->bbSetOutputlstPointsY( GetLstPointsY() );
+ mbbShowNPoints->bbSetOutputlstPointsZ( GetLstPointsZ() );
+ mbbShowNPoints->bbSetOutputlstLabels( GetLstLabels() );
+ mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX"));
+ mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY"));
+ mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ"));
+ mbbShowNPoints->bbSignalOutputModification(std::string("lstLabels"));
+ }
//------------------------------------------------------------------------
void WidgetShowNPoints::ErasePoint(int id)
lstActorsText[id]->Delete();
lstActorsSphere.erase( lstActorsSphere.begin()+id );
lstActorsText.erase( lstActorsText.begin()+id );
+
lstPointsX.erase( lstPointsX.begin()+id );
lstPointsY.erase( lstPointsY.begin()+id );
lstPointsZ.erase( lstPointsZ.begin()+id );
+ lstLabels.erase( lstLabels.begin()+id );
+
renderer->GetRenderWindow()->Render();
- //--BBTK
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ"));
+ SetOutputBox();
+
} // if id
} // if renderer
}
//------------------------------------------------------------------------
void WidgetShowNPoints::OnDeleteAllPoints(wxCommandEvent& event)
{
- int i,size=lstActorsSphere.size();
- if (this->renderer!=NULL){
- for (i=0;i<size;i++)
- {
- renderer->RemoveActor( lstActorsSphere[i] );
- renderer->RemoveActor( lstActorsText[i] );
- }
- lstActorsSphere.clear();
- lstActorsText.clear();
- lstPointsX.clear();
- lstPointsY.clear();
- lstPointsZ.clear();
- renderer->GetRenderWindow()->Render();
- //--BBTK
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ"));
- } // renderer
+ int id,size=lstActorsSphere.size();
+ for (id=size-1;id>=0;id--)
+ {
+ ErasePoint(id);
+ }
+
}
-
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ShowNPoints)
BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox);
bbSetOutputlstPointsX( mwxwidget->GetLstPointsX() );
bbSetOutputlstPointsY( mwxwidget->GetLstPointsY() );
bbSetOutputlstPointsZ( mwxwidget->GetLstPointsZ() );
+ bbSetOutputlstLabels( mwxwidget->GetLstLabels() );
} // mwxwidget
}