[vtkusers] vtk event does not work

fan ding fan.ding.hust at gmail.com
Fri Sep 15 21:03:43 EDT 2006


void CVtkloadView::OnDraw(CDC* pDC)
{
 CVtkloadDoc* pDoc = GetDocument();
 ASSERT_VALID(pDoc);
 // TODO: add draw code for native data here
 if ( !this->iren->GetInitialized() )
 {
  CRect rect;
  this->GetClientRect(&rect);
  this->iren->Initialize();
  this->renWin->SetSize(rect.right-rect.left,rect.bottom-rect.top);
  this->renderer->ResetCamera();
 }

 switch(way)
 {
 case hoppe :Hoppe();break;

 case delau: Delaun();break;
 case gly: Pipe();break;
 }

 this->renWin->Render();

}


void CVtkloadView::Delaun()
{
  int iNo = this->points->GetNumberOfPoints();
  if(!iNo)
  return ;

  this->data->SetPoints(points);


 this->del->SetInput (data);
 this->del-> BoundingTriangulationOn();
 this->del-> SetTolerance (0.001);
 this->del-> SetAlpha (0.0);
 this->del-> BoundingTriangulationOff();


this->shrink->SetInput((vtkDataSet *)(del->GetOutput()));
this->shrink->SetShrinkFactor( 0.9);


this->    mapD->SetInput ((vtkDataSet *)shrink->GetOutput());


this->    surfaceActor->SetMapper(mapD);
 this->   surfaceActor->GetProperty()->SetColor(1, 0, 0);
 this->renWin->AddRenderer( renderer);
 this->iren-> SetRenderWindow( renWin);

this->renderer-> AddActor (surfaceActor);
this->renderer-> SetBackground (1, 1, 1);
}



It just writed according to the MFC SDI example.

but the event does not work in the View.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060916/8816c89c/attachment.htm>


More information about the vtkusers mailing list