[vtkusers] Ploting curve.

Jan Palach palach16 at yahoo.com.br
Thu Apr 6 08:46:39 EDT 2006


Hi,
 
 I'm writing one example of XYPlot using VTK(vtkXYPlotActor), well, the code is following:
 
 #include "vtkPolyDataMapper.h"
 #include "vtkActor.h"
 #include "vtkRenderWindow.h"
 #include "vtkRenderer.h"
 #include "vtkRenderWindowInteractor.h"
 #include "vtkXYPlotActor.h"
 #include "vtkLineSource.h"
 #include "vtkConeSource.h"
 #include "vtkProperty.h"
 
 main()
 {
         vtkLineSource *line = vtkLineSource::New();
         line->SetResolution(60);
 
         vtkXYPlotActor *xyplot = vtkXYPlotActor::New();
         xyplot->AddInput(line->GetOutput());
         xyplot->GetPositionCoordinate()->SetValue(0.0,0.67,0);
         xyplot->GetPosition2Coordinate()->SetValue(1.0,0.33,0);
 
         xyplot->SetTitle("Pressure vs. Arc Length (Zoomed View) EITA CARAMBA!");
         xyplot->SetXTitle("Time");
         xyplot->SetYTitle("Press");
         xyplot->SetXRange(0,0.8);
         xyplot->SetYRange(0,12);
         xyplot->SetLegend(1);
         xyplot->SetLegendPosition(.0,.2);
         xyplot->SetBorder(1);
 
         vtkRenderer *ren1 = vtkRenderer::New();
         vtkRenderWindow *renWin = vtkRenderWindow::New();
         renWin->AddRenderer(ren1);
         vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
         iren->SetRenderWindow(renWin);
 
         ren1->SetBackground(0,0,1);
         ren1->AddActor(xyplot);
 
         renWin->SetSize(600,300);
 
       for(;;)
         iren->Start();
 
     return 0;
 }
 
 this code make a XYPlot contain just XY axes. How do show an curve in this example?
 
 Thank's!!!
 []'s
 

/(        )`
                              \ \___   / |
                              /- _  `-/  '
                             (/\/ \ \   /\
                             / /   | `    \
                             O O   ) /     |
                             `-^--'`<      '
                             (_.)  _  )   /
                             `.___/`    / 
                               `-----' /
                  <----.     __ / __   \
                  <----|====O)))==) \) /====
                  <----'    `--' `.__,' \
                                |        |
                                \       /       /\
                          ______( (_  / \______/
                         ,'  ,-----'   |  Jan Palach, programador:
                         `--{__________)  Python, C/C++
		
---------------------------------
 Abra sua conta no Yahoo! Mail - 1GB de espaço, alertas de e-mail no celular e anti-spam realmente eficaz. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060406/a08d66ea/attachment.htm>


More information about the vtkusers mailing list