Troubles with printing 2D Texts - strong changes between 2.3 and 2.4 version

Ken Martin ken.martin at kitware.com
Wed Jul 21 09:09:33 EDT 1999


At 11:09 PM 7/20/99 -0400, Hugues Wisniewski wrote:
>Hello
>
> > >I'me sorry but I've downloaded the 2.4 version ... and it still doesn't print 2D texts. 
>
>I've just do what you said and the result is the same.
>I've taken the MFC sample as it is after installing VTK, and have just added this code :
>
>To SampleDoc.h, in public :
>vtkLabeledDataMapper    *m_pLabeledDataMapper;

I just modified the Sample to add a TextMapper and it worked fine.
I think the problem is in using labeledDataMapper. It relies on
SelectVisablePoints which relies on a valid zbuffer. The zbuffer 
is only valid after a render has been performed. When printing
a new window is created and only one render is done for
printing and print preview. So SelectVisiablePoints looks at the
zbuffer (before the first render) and determines that nothing is
visible and hence you get no annotation from labeledDataMapper.
I think if you modify the default OnDraw method in vtkMFCRenderView
so that it does two renders in a row when printing, (just duplicate
the Render() call) then that might fix your problem.

- Ken



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list