- //=========================================================================
-
- void wxVtkSceneManager::configureBaseView()
- {
-printf("EED wxVtkSceneManager::configureBaseView 0\n");
- vtkInteractorStyleBaseView2D *interactorstylebaseview = vtkInteractorStyleBaseView2D::New();
-
- _baseView->SetInteractorStyleBaseView(interactorstylebaseview);
-
- // Important to activate the 2D interaction system
- wxVTKRenderWindowInteractor *iren = _baseView->GetWxVTKRenderWindowInteractor();
- interactorstylebaseview->SetInteractor ( iren );
- iren->SetInteractorStyle(interactorstylebaseview);
- interactorstylebaseview->SetwxVtkBaseView(_baseView);
-
- _baseView->GetRenderer()->GetActiveCamera()->ParallelProjectionOn();
- _baseView->GetRenderer()->ResetCamera(-100,100,-100,100,800,1100);
-
- _baseView->GetRenderer()->SetBackground(0.9,0.9,0.9);
- _baseView->GetRenderer()->GradientBackgroundOn();
- _baseView->Refresh();
-
- // Actos Port_Text
- _textActor = vtkTextActor3D::New();
- _textActor->SetPosition( -9999 , -9999 , 900 );
- _textActor->SetInput( "<void>" );
- _textActor->GetTextProperty()->SetFontSize(60);
- _textActor->GetTextProperty()->BoldOn();
- _textActor->GetTextProperty()->SetColor(PORTTEXT_NH_R,PORTTEXT_NH_G,PORTTEXT_NH_B);
-
- _baseView->GetRenderer()->AddActor( _textActor );
-
-
- // Actor Fill_Port_Text
-
- //------------
- double xInic = 0;
- double yInic = 0;
- double zInic = 900;
-
- vtkPolygon *aPolygon = vtkPolygon::New();
- _fillObjectActor = vtkActor::New();
-
- _pts = vtkPoints::New();
-
- double w=100,h=10,b=h/15,t=3;
- _pts->SetNumberOfPoints(21);
- _pts->InsertPoint(0, xInic+w*0.33-t/2 , yInic , zInic );
- _pts->InsertPoint(1, xInic+w*0.33 , yInic-t , zInic );
- _pts->InsertPoint(2, xInic+w*0.33+t/2 , yInic , zInic );
- _pts->InsertPoint(3, xInic+w*0.33+t/2 , yInic , zInic );
- _pts->InsertPoint(4, xInic+w-b*4 , yInic+b*0 , zInic );
-
- _pts->InsertPoint( 5, xInic+w-b*4 , yInic+b*0 , zInic );
- _pts->InsertPoint( 6, xInic+w-b*2 , yInic+b*1 , zInic );
- _pts->InsertPoint( 7, xInic+w-b*1 , yInic+b*2 , zInic );
- _pts->InsertPoint( 8, xInic+w-b*0 , yInic+b*4 , zInic );
-
- _pts->InsertPoint( 9, xInic+w-b*0 , yInic+h-b*4 , zInic );
- _pts->InsertPoint(10, xInic+w-b*1 , yInic+h-b*2 , zInic );
- _pts->InsertPoint(11, xInic+w-b*2 , yInic+h-b*1 , zInic );
- _pts->InsertPoint(12, xInic+w-b*4 , yInic+h-b*0 , zInic );
-
- _pts->InsertPoint(13, xInic+b*4 , yInic+h-b*0 , zInic );
- _pts->InsertPoint(14, xInic+b*2 , yInic+h-b*1 , zInic );
- _pts->InsertPoint(15, xInic+b*1 , yInic+h-b*2 , zInic );
- _pts->InsertPoint(16, xInic+b*0 , yInic+h-b*4 , zInic );
-
- _pts->InsertPoint(17, xInic+b*0 , yInic+b*4 , zInic );
- _pts->InsertPoint(18, xInic+b*1 , yInic+b*2 , zInic );
- _pts->InsertPoint(19, xInic+b*2 , yInic+b*1 , zInic );
- _pts->InsertPoint(20, xInic+b*4 , yInic+b*0 , zInic );
-
- aPolygon->GetPointIds()->SetNumberOfIds(21);
- for (int i=0;i<21; i++)
- {
- aPolygon->GetPointIds()->SetId(i, i);
- }
-
- vtkUnstructuredGrid *aPolygonGrid = vtkUnstructuredGrid::New();
- aPolygonGrid->Allocate(1, 1);
- aPolygonGrid->InsertNextCell(aPolygon->GetCellType(), aPolygon->GetPointIds());
- aPolygonGrid->SetPoints(_pts);
- _aPolygonMapper = vtkDataSetMapper::New();
- _aPolygonMapper->SetInput(aPolygonGrid);
- _fillObjectActor->SetMapper(_aPolygonMapper);
- _fillObjectActor->GetProperty()->SetColor(PORTFILL_NH_R,PORTFILL_NH_G,PORTFILL_NH_B);
- _fillObjectActor->GetProperty()->SetOpacity(0);
- _aPolygonMapper->Modified();
-
- _baseView->GetRenderer()->AddActor( _fillObjectActor );
-printf("EED wxVtkSceneManager::configureBaseView 1\n");
+ vtkUnstructuredGrid *aPolygonGrid = vtkUnstructuredGrid::New();
+ aPolygonGrid->Allocate(1, 1);
+ aPolygonGrid->InsertNextCell(aPolygon->GetCellType(),
+ aPolygon->GetPointIds());
+ aPolygonGrid->SetPoints(_pts);
+ _aPolygonMapper = vtkDataSetMapper::New();
+ _aPolygonMapper->SetInput(aPolygonGrid);
+ _fillObjectActor->SetMapper(_aPolygonMapper);
+ _fillObjectActor->GetProperty()->SetColor(PORTFILL_NH_R, PORTFILL_NH_G,
+ PORTFILL_NH_B);
+ _fillObjectActor->GetProperty()->SetOpacity(0);
+ _aPolygonMapper->Modified();
+
+ _baseView->GetRenderer()->AddActor(_fillObjectActor);
+ printf("EED wxVtkSceneManager::configureBaseView 1\n");
+}
+
+//=========================================================================
+
+std::string wxVtkSceneManager::generateANewNameForABox() {
+ std::stringstream boxname;
+ if (_numBoxes < 10) {
+ boxname << "Box0" << _numBoxes;
+ } else {
+ boxname << "Box" << _numBoxes;