[vtkusers] Bug in vtkXYPlotActor ?

Mathieu Malaterre mathieu.malaterre at kitware.com
Thu May 27 12:21:24 EDT 2004


Aurélien,

	I have added a bug report for that:
	
http://vtk.org/Bug/bug.php?op=show&bugid=884

Patch welcome :)

Thanks for report,
Mathieu


REGAT-BARREL Aurélien wrote:
> Hi,
> I think there is a bug in vtkXYPlotActor.
> The following curve is clipped on the Y axis if offset < 0.1 :
>  
> #include <vtkRenderWindow.h>
> #include <vtkRenderWindowInteractor.h>
> #include <vtkRenderer.h>
> #include <vtkXYPlotActor.h>
> #include <vtkFloatArray.h>
> #include <vtkFieldData.h>
> #include <vtkDataObject.h>
> #ifdef _MSC_VER
> #pragma comment( lib, "vtkCommon.lib" )
> #pragma comment( lib, "vtkRendering.lib" )
> #pragma comment( lib, "vtkHybrid.lib" )
> #endif
> int main()
> {
>     // rendering stuff
>     vtkRenderWindow * renWin = vtkRenderWindow::New();
>     vtkRenderWindowInteractor * Iter = vtkRenderWindowInteractor::New();
>     renWin->SetInteractor( Iter );
>     vtkRenderer * ren = vtkRenderer::New();       
>     renWin->AddRenderer( ren );
>     // plot actor
>     vtkXYPlotActor * xyplot = vtkXYPlotActor::New();       
>     xyplot->SetWidth( 1 );
>     xyplot->SetHeight( 1 );
>     xyplot->SetPosition( 0, 0 );
>     ren->AddActor2D( xyplot );
>     // add buggy curve ([0, 0.09], [1, 1.59])
>     vtkFloatArray * xarray = vtkFloatArray::New();
>     vtkFloatArray * yarray = vtkFloatArray::New();
>  
>     double offset = 0.09;
>     xarray->InsertNextValue( 0 );
>     yarray->InsertNextValue( offset );
>     xarray->InsertNextValue( 1 );
>     yarray->InsertNextValue( 1.50 + offset );
>  
>     vtkFieldData * values = vtkFieldData::New();
>     values->AllocateArrays( 2 );
>     values->AddArray( xarray );
>     values->AddArray( yarray );
>    
>     vtkDataObject * data = vtkDataObject::New();
>     data->SetFieldData( values );
>     xyplot->AddDataObjectInput( data );
>     xyplot->SetDataObjectYComponent( 0, 1 );
>     // render
>     renWin->SetSize( 500, 500 );
>     renWin->Render();
>     Iter->Initialize();
>     Iter->Start();
> }
>  
> If offset >= 0.1 there is no problem.
> I use vtk 4.4. with vtkXYPlotActor.cxx revision 1.52.
> 
> 
> Aurélien REGAT-BARREL
> 
> ------------------------------------------------------------------------
> Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
> Créez votre Yahoo! Mail 
> <http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/mail/mail_taglines/default/*http://fr.benefits.yahoo.com/> 
> 
> 
> Dialoguez en direct avec vos amis grâce à Yahoo! Messenger ! 
> <http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com/> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list