<div class="gmail_quote">On Fri, Mar 26, 2010 at 6:24 AM,  <span dir="ltr">&lt;<a href="mailto:edoardo.belletti@alice.it">edoardo.belletti@alice.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">







<div>


<p><font size="2">Hi<br>
I have a problem with this exaple:<br>
<br>
/*=========================================================================<br>
<br>
  Program:   Visualization Toolkit<br>
  Module:    $RCSfile: Cylinder.cxx,v $<br>
<br>
  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen<br>
  All rights reserved.<br>
  See Copyright.txt or <a href="http://www.kitware.com/Copyright.htm" target="_blank">http://www.kitware.com/Copyright.htm</a> for details.<br>
<br>
     This software is distributed WITHOUT ANY WARRANTY; without even<br>
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR<br>
     PURPOSE.  See the above copyright notice for more information.<br>
<br>
=========================================================================*/<br>
//This example demonstrates the use of vtkXYPlotActor to display three<br>
//probe lines using three different techniques.  In this example, we are<br>
//loading data using the vtkPLOT3DReader.  We are using the vtkProbeFilter<br>
//to extract the underlying point data along three probe lines.<br>
<br>
//<br>
//First we include the VTK Tcl packages which will make available<br>
//all of the vtk commands to Tcl.<br>
//<br>
#include &quot;vtkPLOT3DReader.h&quot;<br>
#include &quot;vtkLineSource.h&quot;<br>
#include &quot;vtkTransform.h&quot;<br>
#include &quot;vtkTransformPolyDataFilter.h&quot;<br>
#include &quot;vtkProbeFilter.h&quot;<br>
#include &quot;vtkProperty2D.h&quot;<br>
<br>
#include &quot;vtkAppendPolyData.h&quot;<br>
#include &quot;vtkTubeFilter.h&quot;<br>
<br>
#include &quot;vtkPolyDataMapper.h&quot;<br>
#include &quot;vtkActor.h&quot;<br>
#include &quot;vtkXYPlotActor.h&quot;<br>
#include &quot;vtkTextProperty.h&quot;<br>
#include &quot;vtkStructuredGridOutlineFilter.h&quot;<br>
<br>
#include &quot;vtkRenderer.h&quot;<br>
#include &quot;vtkRenderWindow.h&quot;<br>
#include &quot;vtkRenderWindowInteractor.h&quot;<br>
#include &quot;vtkProperty.h&quot;<br>
#include &quot;vtkCamera.h&quot;<br>
<br>
int main()<br>
{<br>
  //Create a PLOT3D reader and load the data.<br>
//<br>
vtkPLOT3DReader *pl3d=vtkPLOT3DReader::New();<br>
    pl3d-&gt;SetXYZFileName(&quot;combxyz.bin&quot;);<br>
    pl3d-&gt;SetQFileName(&quot;combq.bin&quot;);<br>
    pl3d-&gt;SetScalarFunctionNumber(100);<br>
    pl3d-&gt;SetVectorFunctionNumber(202);<br>
    pl3d-&gt;Update();<br>
<br>
//Create three the line source to use for the probe lines.<br>
vtkLineSource *line=vtkLineSource::New();<br>
    line-&gt;SetResolution(30);<br>
<br>
<br>
//Move the line into place and create the probe filter.  For vtkProbeFilter,<br>
//the probe line is the input, and the underlying data set is the source.<br>
vtkTransform *transL1=vtkTransform::New();<br>
    transL1-&gt;Translate(3.7,0.0,28.37);<br>
    transL1-&gt;Scale(5,5,5);<br>
    transL1-&gt;RotateY(90);<br>
vtkTransformPolyDataFilter *tf=vtkTransformPolyDataFilter::New();<br>
    tf-&gt;SetInputConnection(line-&gt;GetOutputPort());<br>
    tf-&gt;SetTransform(transL1);<br>
vtkProbeFilter *probe=vtkProbeFilter::New();<br>
    probe-&gt;SetInputConnection(tf-&gt;GetOutputPort());<br>
    probe-&gt;SetSource(pl3d-&gt;GetOutput());<br>
<br>
//Move the line again and create another probe filter.<br>
vtkTransform *transL2=vtkTransform::New();<br>
    transL2-&gt;Translate(9.2,0.0,31.20);<br>
    transL2-&gt;Scale (5, 5, 5);<br>
    transL2-&gt; RotateY (90);<br>
vtkTransformPolyDataFilter *tf2=vtkTransformPolyDataFilter::New();<br>
    tf2-&gt; SetInputConnection (line-&gt; GetOutputPort());<br>
    tf2 -&gt;SetTransform (transL2);<br>
vtkProbeFilter *probe2=vtkProbeFilter::New();<br>
    probe2-&gt; SetInputConnection (tf2 -&gt;GetOutputPort());<br>
    probe2-&gt; SetSource (pl3d-&gt; GetOutput());<br>
<br>
//Move the line again and create a third probe filter.<br>
vtkTransform *transL3=vtkTransform::New();<br>
    transL3-&gt; Translate( 13.27, 0.0, 33.40);<br>
    transL3-&gt;Scale( 4.5, 4.5, 4.5);<br>
    transL3-&gt; RotateY( 90);<br>
vtkTransformPolyDataFilter *tf3=vtkTransformPolyDataFilter::New();<br>
    tf3-&gt; SetInputConnection(line-&gt;GetOutputPort());<br>
    tf3-&gt; SetTransform (transL3);<br>
vtkProbeFilter *probe3=vtkProbeFilter::New();<br>
    probe3-&gt; SetInputConnection (tf3 -&gt;GetOutputPort());<br>
    probe3-&gt; SetSource(pl3d-&gt; GetOutput());<br>
<br>
//Create a vtkAppendPolyData to merge the output of the three probe filters<br>
//into one data set.<br>
vtkAppendPolyData *appendF=vtkAppendPolyData::New();<br>
    appendF-&gt; AddInput (probe-&gt; GetPolyDataOutput());<br>
    appendF-&gt; AddInput (probe2-&gt; GetPolyDataOutput());<br>
    appendF-&gt; AddInput (probe3-&gt; GetPolyDataOutput());<br>
<br>
//Create a tube filter to represent the lines as tubes.  Set up the associated<br>
//mapper and actor.<br>
vtkTubeFilter *tuber=vtkTubeFilter::New();<br>
    tuber-&gt; SetInputConnection (appendF-&gt;GetOutputPort());<br>
    tuber-&gt; SetRadius (0.1);<br>
vtkPolyDataMapper *lineMapper=vtkPolyDataMapper::New();<br>
    lineMapper-&gt; SetInputConnection (tuber-&gt; GetOutputPort());<br>
vtkActor *lineActor=vtkActor::New();<br>
    lineActor-&gt; SetMapper( lineMapper);<br>
<br>
// Create an xy-plot using the output of the 3 probe filters as input.<br>
//The x-values we are plotting are arc length.<br>
vtkXYPlotActor *xyplot=vtkXYPlotActor::New();<br>
    xyplot-&gt; AddInput (probe-&gt; GetOutput());<br>
    xyplot-&gt; AddInput (probe2-&gt; GetOutput());<br>
    xyplot-&gt;AddInput (probe3-&gt; GetOutput());<br>
    xyplot-&gt;GetPositionCoordinate()-&gt; SetValue (0.0, 0.67, 0);<br>
    xyplot-&gt; GetPosition2Coordinate()-&gt; SetValue (1.0, 0.33, 0);    //relative to<br>
Position<br>
    xyplot-&gt; SetXValuesToArcLength();<br>
    xyplot-&gt; SetNumberOfXLabels( 6);<br>
    xyplot -&gt;SetTitle (&quot;Pressure vs. Arc Length (Zoomed View)&quot;);<br>
    xyplot-&gt; SetXTitle( &quot;&quot;);<br>
    xyplot-&gt; SetYTitle (&quot;P&quot;);<br>
    xyplot-&gt; SetXRange( .1 ,.35);<br>
    xyplot-&gt; SetYRange( .2, .4);<br>
    xyplot-&gt; GetProperty()-&gt; SetColor (0, 0, 0);<br>
    xyplot-&gt; GetProperty()-&gt; SetLineWidth( 2);<br>
    //Set text prop color (same color for backward compat with test)<br>
    //Assign same object to all text props<br>
vtkTextProperty *tprop;<br>
    tprop =xyplot-&gt; GetTitleTextProperty();<br>
    tprop -&gt;SetColor(xyplot-&gt; GetProperty()-&gt; GetColor());<br>
    xyplot -&gt;SetAxisTitleTextProperty (tprop);<br>
    xyplot-&gt; SetAxisLabelTextProperty (tprop);<br>
<br>
//Create an xy-plot using the output of the 3 probe filters as input.<br>
//The x-values we are plotting are normalized arc length.<br>
vtkXYPlotActor *xyplot2=vtkXYPlotActor::New();<br>
    xyplot2-&gt; AddInput (probe-&gt; GetOutput());<br>
    xyplot2 -&gt;AddInput (probe2 -&gt;GetOutput());<br>
    xyplot2-&gt; AddInput (probe3 -&gt;GetOutput());<br>
    xyplot2-&gt; GetPositionCoordinate()-&gt; SetValue (0.00 ,0.33, 0);<br>
    xyplot2-&gt; GetPosition2Coordinate()-&gt; SetValue( 1.0, 0.33, 0);        //<br>
relative to Position<br>
    xyplot2-&gt; SetXValuesToNormalizedArcLength();<br>
    xyplot2-&gt; SetNumberOfXLabels (6);<br>
    xyplot2-&gt; SetTitle (&quot;Pressure vs. Normalized Arc Length&quot;);<br>
    xyplot2-&gt; SetXTitle (&quot;&quot;);<br>
    xyplot2 -&gt;SetYTitle (&quot;P&quot;);<br>
    xyplot2-&gt; PlotPointsOn();<br>
    xyplot2 -&gt;PlotLinesOff();<br>
    xyplot2-&gt; GetProperty()-&gt; SetColor (1 ,0, 0);<br>
    xyplot2-&gt; GetProperty()-&gt; SetPointSize (2);<br>
    //Set text prop color (same color for backward compat with test)<br>
    //Assign same object to all text props<br>
//vtkTextProperty *tprop;<br>
    tprop =xyplot2-&gt; GetTitleTextProperty();<br>
    tprop -&gt;SetColor(xyplot-&gt; GetProperty()-&gt; GetColor());<br>
    xyplot2 -&gt;SetAxisTitleTextProperty (tprop);<br>
    xyplot2-&gt; SetAxisLabelTextProperty (tprop);<br>
<br>
//Create an xy-plot using the output of the 3 probe filters as input.<br>
//The x-values we are plotting are the underlying point data values.<br>
vtkXYPlotActor *xyplot3=vtkXYPlotActor::New();<br>
    xyplot3-&gt; AddInput (probe-&gt; GetOutput());<br>
    xyplot3-&gt; AddInput (probe2-&gt; GetOutput());<br>
    xyplot3 -&gt;AddInput (probe3 -&gt;GetOutput());<br>
    xyplot3-&gt; GetPositionCoordinate()-&gt; SetValue (0.0, 0.0 ,0);<br>
    xyplot3-&gt; GetPosition2Coordinate()-&gt; SetValue (1.0, 0.33, 0);           <br>
//relative to Position<br>
    xyplot3 -&gt;SetXValuesToIndex();<br>
    xyplot3-&gt; SetNumberOfXLabels (6);<br>
    xyplot3 -&gt;SetTitle (&quot;Pressure vs. Point Id&quot;);<br>
    xyplot3-&gt; SetXTitle (&quot;Probe Length&quot;);<br>
    xyplot3 -&gt;SetYTitle (&quot;P&quot;);<br>
    xyplot3 -&gt;PlotPointsOn();<br>
    xyplot3-&gt;GetProperty()-&gt; SetColor (0 ,0, 1);<br>
    xyplot3-&gt; GetProperty()-&gt; SetPointSize (3);<br>
   // Set text prop color (same color for backward compat with test)<br>
    //sign same object to all text props<br>
//vtkTextProperty *tprop;<br>
    tprop =xyplot3-&gt; GetTitleTextProperty();<br>
    tprop -&gt;SetColor(xyplot-&gt; GetProperty()-&gt; GetColor());<br>
    xyplot3 -&gt;SetAxisTitleTextProperty (tprop);<br>
    xyplot3-&gt; SetAxisLabelTextProperty (tprop);<br>
<br>
//aw an outline of the PLOT3D data set.<br>
vtkStructuredGridOutlineFilter *outline=vtkStructuredGridOutlineFilter::New();<br>
    outline -&gt;SetInputConnection (pl3d-&gt; GetOutputPort());<br>
vtkPolyDataMapper *outlineMapper=vtkPolyDataMapper::New();<br>
    outlineMapper-&gt; SetInputConnection (outline -&gt;GetOutputPort());<br>
vtkActor *outlineActor=vtkActor::New();<br>
    outlineActor-&gt; SetMapper (outlineMapper);<br>
    outlineActor-&gt; GetProperty()-&gt; SetColor( 0, 0, 0);<br>
<br>
//Create the Renderers, RenderWindow, and RenderWindowInteractor.<br>
  vtkRenderer *ren1 = vtkRenderer::New();<br>
  vtkRenderer *ren2 = vtkRenderer::New();<br>
<br>
  vtkRenderWindow *renWin = vtkRenderWindow::New();<br>
  renWin-&gt;AddRenderer(ren1);<br>
  renWin-&gt;AddRenderer(ren2);<br>
<br>
  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>
  iren-&gt;SetRenderWindow(renWin);<br>
<br>
//Set the background, viewport (necessary because we want to have the<br>
//renderers draw to different parts of the render window) of the first<br>
// renderer.  Add the outline and line actors to the renderer. <br>
ren1-&gt; SetBackground (0.6784 ,0.8471, 0.9020);<br>
ren1 -&gt;SetViewport (0, 0, .5, 1);<br>
ren1-&gt; AddActor (outlineActor);<br>
ren1 -&gt;AddActor (lineActor);<br>
// Set the background and viewport of the second renderer.  Add the xy-plot<br>
//actors to the renderer.  Set the size of the render window.<br>
ren2 -&gt;SetBackground (1, 1, 1);<br>
ren2 -&gt;SetViewport (0.5 ,0.0 ,1.0, 1.0);<br>
ren2 -&gt;AddActor2D (xyplot);<br>
ren2-&gt;AddActor2D (xyplot2);<br>
ren2-&gt; AddActor2D (xyplot3);<br>
renWin-&gt; SetSize (500, 250);<br>
  // We&#39;ll zoom in a little by accessing the camera and invoking a &quot;Zoom&quot;<br>
  // method on it.<br>
  ren1-&gt;ResetCamera();<br>
  ren1-&gt;GetActiveCamera()-&gt;Zoom(1.5);<br>
  renWin-&gt;Render();<br>
<br>
 <br>
// Set up the camera parameters.<br>
  vtkCamera *cam1;<br>
     cam1= ren1 -&gt;GetActiveCamera();<br>
     cam1-&gt; SetClippingRange (3.95297, 100);<br>
     cam1-&gt; SetFocalPoint (8.88908, 0.595038 ,29.3342);<br>
     cam1-&gt; SetPosition (-12.3332, 31.7479, 41.2387);<br>
     cam1-&gt; SetViewUp (0.060772, -0.319905, 0.945498);<br>
iren -&gt;Initialize();<br>
<br>
<br>
<br>
  // This starts the event loop and as a side effect causes an initial render.<br>
 // iren-&gt;Start();<br>
<br>
  // Exiting from here, we have to delete all the instances that<br>
  // have been created.<br>
  pl3d-&gt;Delete();<br>
  line-&gt;Delete();<br>
  transL1-&gt;Delete();<br>
        tf-&gt;Delete();<br>
        probe-&gt;Delete();<br>
        transL2-&gt;Delete();<br>
        tf2-&gt;Delete();<br>
        probe2-&gt;Delete();<br>
        transL3-&gt;Delete();<br>
        tf3-&gt;Delete();<br>
        probe3-&gt;Delete();<br>
        appendF-&gt;Delete();<br>
        tuber-&gt;Delete();<br>
        lineMapper-&gt;Delete();<br>
        lineActor-&gt;Delete();<br>
        xyplot-&gt;Delete();<br>
        xyplot2-&gt;Delete();<br>
        xyplot3-&gt;Delete();<br>
        outline-&gt;Delete();<br>
        outlineMapper-&gt;Delete();<br>
        outlineActor-&gt;Delete();<br>
  ren1-&gt;Delete();<br>
  ren2-&gt;Delete();<br>
  renWin-&gt;Delete();<br>
  iren-&gt;Delete();<br>
<br>
  return 0;<br>
}<br>
<br>
<br>
why my output is that?:<br>
<br>
~$ make<br>
[100%] Building CXX object CMakeFiles/xyPlot.dir/xyPlot.o<br>
/home/edoardo/VTK/plot/src/xyPlot.cxx: In function ‘int main()’:<br>
/home/edoardo/VTK/plot/src/xyPlot.cxx:73: error: no matching function for call to ‘vtkProbeFilter::SetSource(vtkStructuredGrid*)’<br>
/usr/local/include/vtk-5.4/vtkProbeFilter.h:55: note: candidates are: void vtkProbeFilter::SetSource(vtkDataObject*)<br>
/home/edoardo/VTK/plot/src/xyPlot.cxx:85: error: no matching function for call to ‘vtkProbeFilter::SetSource(vtkStructuredGrid*)’<br>
/usr/local/include/vtk-5.4/vtkProbeFilter.h:55: note: candidates are: void vtkProbeFilter::SetSource(vtkDataObject*)<br>
/home/edoardo/VTK/plot/src/xyPlot.cxx:97: error: no matching function for call to ‘vtkProbeFilter::SetSource(vtkStructuredGrid*)’<br>
/usr/local/include/vtk-5.4/vtkProbeFilter.h:55: note: candidates are: void vtkProbeFilter::SetSource(vtkDataObject*)<br>
/home/edoardo/VTK/plot/src/xyPlot.cxx:124: error: ‘Position’ was not declared in this scope<br>
/home/edoardo/VTK/plot/src/xyPlot.cxx:125: error: expected ‘;’ before ‘xyplot’<br>
/home/edoardo/VTK/plot/src/xyPlot.cxx:150: error: ‘relative’ was not declared in this scope<br>
/home/edoardo/VTK/plot/src/xyPlot.cxx:150: error: expected ‘;’ before ‘to’<br>
make[2]: *** [CMakeFiles/xyPlot.dir/xyPlot.o] Errore 1<br>
make[1]: *** [CMakeFiles/xyPlot.dir/all] Errore 2<br>
make: *** [all] Errore 2<br>
<br>
Thank you very much for the interest<br>
Best regards<br>
</font></p><p><font size="2"><br></font></p></div></blockquote><div>Where did you get this code? In the actual VTK cvs or release? I got the same error when compiling it. You can fix it by adding:</div><div><br></div>#include &quot;vtkStructuredGrid.h&quot;</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">If you got this from an official source, we need to update it there, too.</div><div class="gmail_quote"><br clear="all">Thanks,<br><br><div>David</div></div>