4 // ----------------------------------------------------------------------------
5 // ----------------------------------------------------------------------------
6 // ----------------------------------------------------------------------------
10 _wxvtkbaseview = NULL;
13 // ----------------------------------------------------------------------------
14 PointView::~PointView()
19 // ----------------------------------------------------------------------------
20 void PointView::DeletePoints()
27 // ----------------------------------------------------------------------------
28 void PointView::SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview)
30 _wxvtkbaseview = wxvtkbaseview;
33 // ----------------------------------------------------------------------------
34 void PointView::Refresh()
36 _wxvtkbaseview->GetRenWin()->Render();
39 // ----------------------------------------------------------------------------
40 void PointView::CreateNewPoint(double x, double y, int type)
42 vtkSphereSource* aSphere =vtkSphereSource::New();
43 aSphere->SetRadius(1);
44 aSphere->SetCenter(x,y,0);
46 point_mapped.push_back(vtkPolyDataMapper::New());
47 // point_mapped.back()->ImmediateModeRenderingOn();
48 //point_mapped.back()->ScalarVisibilityOff( );
49 point_mapped.back()->SetInput(aSphere->GetOutput());
51 point_actor.push_back(vtkActor::New());
52 point_actor.back()->SetMapper(point_mapped.back());
53 // point_actor.back()->GetProperty()->BackfaceCullingOff();
57 case PointView::BLUE : point_actor.back()->GetProperty()->SetColor(0, 0, 1);
59 case PointView::MAGENTA : point_actor.back()->GetProperty()->SetColor(1, 0, 1);
61 case PointView::GREEN : point_actor.back()->GetProperty()->SetColor(0, 1, 0);
63 case PointView::YELLOW : point_actor.back()->GetProperty()->SetColor(0, 1, 1);
65 default: point_actor.back()->GetProperty()->SetColor(0, 0, 1);
69 //point_actor.back()->GetProperty()->SetColor(0, 1, 0);
71 point_actor.back()->ApplyProperties();
73 _wxvtkbaseview->GetRenderer()->AddActor(point_actor.back());
74 _wxvtkbaseview->GetRenWin()->Render();
77 // ----------------------------------------------------------------------------
78 void PointView::DeleteVtkObjects()
80 int i,size=point_mapped.size();
81 for (i=0;i<size; i++){
82 if ( point_mapped[i] != NULL ) {
83 point_mapped[i] -> Delete();
85 if ( point_actor[i] != NULL ) {
86 _wxvtkbaseview->GetRenderer()->RemoveActor(point_actor[i]);
87 point_actor[i] -> Delete();
89 point_actor[i] = NULL;
90 point_mapped[i] = NULL;