[vtkusers] annotion

liuyang liuyang at fimmu.com
Fri Sep 2 03:37:03 EDT 2005


Hi,
 I meet a strange problem about annotion.Runing my program is ok.But when i 
close the renwin,the error message is "user breakpoint called from code at 
0x7c921230".
my code as foolows: 

vtkTextProperty *textproperty=vtkTextProperty::New();
	           textproperty->SetFontSize(50);
		  textproperty->SetColor(1,1,1);
		  textproperty->AntiAliasingOn(); 

 vtkTextMapper *textMapper=vtkTextMapper::New();
	      textMapper->SetInput("This is\n multi-line\n text output\n ");
         textMapper->SetTextProperty(textproperty);

vtkTextActor *textActor=vtkTextActor::New();
		    textActor->SetMapper(textMapper);
	        textActor->ScaledTextOn();
			textActor->SetTextProperty(textproperty);
			textActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedDispla 
y();
			textActor->GetPositionCoordinate()->SetValue(0.5,0.5);
		 

     vtkRenderer *render=vtkRenderer::New();
		

     vtkRenderWindow *renwin=vtkRenderWindow::New();
	   renwin->AddRenderer(render);
      renwin->SetSize(800,600);
	
    vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();
      iren->SetRenderWindow(renwin);

	   render->AddActor(textActor);
	
    renwin->Render();
	 render->Render();
    iren->Start(); 

	
	textMapper->Delete();
	textproperty->Delete();
	textActor->Delete();
	render->Delete();
	renwin->Delete();
   iren->Delete(); 

}
Anyone could help me?
Thanks!



More information about the vtkusers mailing list