<p>void CVtkloadView::OnDraw(CDC* pDC)<br>{<br> CVtkloadDoc* pDoc = GetDocument();<br> ASSERT_VALID(pDoc);<br> // TODO: add draw code for native data here<br> if ( !this->iren->GetInitialized() )<br> {<br> CRect rect;
<br> this->GetClientRect(&rect);<br> this->iren->Initialize();<br> this->renWin->SetSize(rect.right-rect.left,rect.bottom-rect.top);<br> this->renderer->ResetCamera();<br> }</p>
<p> switch(way)<br> {<br> case hoppe :Hoppe();break;<br> <br> case delau: Delaun();break;<br> case gly: Pipe();break;<br> }<br> </p>
<div> this->renWin->Render();<br> <br>}</div>
<div> </div>
<div>
<p>void CVtkloadView::Delaun()<br>{<br> int iNo = this->points->GetNumberOfPoints();<br> if(!iNo)<br> return ;</p>
<p> this->data->SetPoints(points);</p>
<p><br> this->del->SetInput (data);<br> this->del-> BoundingTriangulationOn();<br> this->del-> SetTolerance (0.001);<br> this->del-> SetAlpha (0.0);<br> this->del-> BoundingTriangulationOff();
<br> <br><br>this->shrink->SetInput((vtkDataSet *)(del->GetOutput()));<br>this->shrink->SetShrinkFactor( 0.9);</p>
<p><br>this-> mapD->SetInput ((vtkDataSet *)shrink->GetOutput());</p>
<p><br>this-> surfaceActor->SetMapper(mapD);<br> this-> surfaceActor->GetProperty()->SetColor(1, 0, 0);<br> this->renWin->AddRenderer( renderer);<br> this->iren-> SetRenderWindow( renWin);
</p>
<p>this->renderer-> AddActor (surfaceActor);<br>this->renderer-> SetBackground (1, 1, 1);<br>}</p>
<p> </p>
<p>It just writed according to the MFC SDI example.</p>
<p>but the event does not work in the View.</p></div>