[vtkusers] annotion

liuy liuyang at fimmu.com
Sun Sep 4 20:52:49 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? 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050905/0071460f/attachment.htm>


More information about the vtkusers mailing list