[vtkusers] How to use vtkLabeledDataMapper with a vtkPolyData input ?

Jérôme Blocquaux jerome.blocquaux at rueil.principia.fr
Thu Jul 18 12:36:51 EDT 2002


Hello,

I'm trying to use vtkLabeledMapper (to label Points) as explained in the book (labeling data)
and my "raw data" is made with a vtkPolyData (I made a correct SetPoint and a SetPolys).

void CLabeledData::Label( vtkPolyData *polyData )
{
    //vtkIdFilter *m_IdFilter = vtkIdFilter::New();           [done in constructor]
    m_IdFilter->SetInput( polyData );
    m_IdFilter->SetPointIdsOn();
    m_IdFilter->SetFieldDataOn();

    //vtkLabeledDataMapper * m_LabeledDataMapper = vtkLabeledDataMapper::New();         [done in constructor]

    m_LabeledDataMapper->SetLabelFormat( "%g" );
    m_LabeledDataMapper->SetLabelModeToLabelFieldData();

    m_LabeledDataMapper->SetInput( m_IdFilter->GetPolyDataOutput() );

    //vtkActor2D * m_Actor2D = vtkActor2D::New();         [done in constructor]
    m_Actor2D->SetMapper( m_LabeledDataMapper );

    m_Renderer->AddActor( m_Actor2D );

    //deletion are done in destructor
}

I have an access violation due to this code (when render) in the vtkCommon.dll without understanding why...
I know i'm not using any derivative of vtkSource. Is it the reason ?
And then how to make this work ? Thanks in advance for your remarks,

J. Blocquaux
Software developper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020718/d4da6bab/attachment.htm>


More information about the vtkusers mailing list