Troubles with printing 2D Texts - strong changes between 2.3 and 2.4 version
Hugues Wisniewski
h_wski at yahoo.com
Tue Jul 20 23:09:51 EDT 1999
Hello
> >I'me sorry but I've downloaded the 2.4 version ... and it still doesn't print 2D texts.
> It does for us. So my guess is that the way you are doing
> print preview may not match how we are doing it. You must use the
> render into memory methods in the Win32OpenGLRenderWindow.
> The Sample MFC app shows the basics of how to do this. You don't
> need MFC to do this either. But the MFC sample shows the basic code.
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;
vtkActor2D *m_pLabelActor;
vtkSphereSource *m_pSphere;
To SampleDoc.cpp, just before the end of the constructor :
m_pSphere=vtkSphereSource::New();
m_pSphere->SetRadius(1.);
m_pLabeledDataMapper=vtkLabeledDataMapper::New();
m_pLabeledDataMapper->SetLabelFormat("%ld");
m_pLabeledDataMapper->SetLabelModeToLabelIds();
m_pLabeledDataMapper->SetInput(m_pSphere->GetOutput());
m_pLabelActor=vtkActor2D::New();
m_pLabelActor->SetMapper(m_pLabeledDataMapper);
m_pLabelActor->GetProperty()->SetColor(0.,0.,0.);
To SampleDoc.cpp, in destructor
m_pSphere->Delete();
m_pLabeledDataMapper->Delete();
m_pLabelActor->Delete();
To SampleView.cpp, in CSampleView::OnUpdate :
void CSampleView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
...
...
this->Renderer->AddProp(GetDocument()->m_pLabelActor);
this->vtkMFCRenderView::OnUpdate(pSender, lHint, pHint);
}
I can see all the data as 2D text actors in the window, in fact these values are all set to 0, but
I can't see them in print preview.
thanks a lot again for your help
Hugues
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
-----------------------------------------------------------------------------
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