<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7655.8">
<TITLE>problem with xyPlot</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<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">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 "vtkPLOT3DReader.h"<BR>
#include "vtkLineSource.h"<BR>
#include "vtkTransform.h"<BR>
#include "vtkTransformPolyDataFilter.h"<BR>
#include "vtkProbeFilter.h"<BR>
#include "vtkProperty2D.h"<BR>
<BR>
#include "vtkAppendPolyData.h"<BR>
#include "vtkTubeFilter.h"<BR>
<BR>
#include "vtkPolyDataMapper.h"<BR>
#include "vtkActor.h"<BR>
#include "vtkXYPlotActor.h"<BR>
#include "vtkTextProperty.h"<BR>
#include "vtkStructuredGridOutlineFilter.h"<BR>
<BR>
#include "vtkRenderer.h"<BR>
#include "vtkRenderWindow.h"<BR>
#include "vtkRenderWindowInteractor.h"<BR>
#include "vtkProperty.h"<BR>
#include "vtkCamera.h"<BR>
<BR>
int main()<BR>
{<BR>
//Create a PLOT3D reader and load the data.<BR>
//<BR>
vtkPLOT3DReader *pl3d=vtkPLOT3DReader::New();<BR>
pl3d->SetXYZFileName("combxyz.bin");<BR>
pl3d->SetQFileName("combq.bin");<BR>
pl3d->SetScalarFunctionNumber(100);<BR>
pl3d->SetVectorFunctionNumber(202);<BR>
pl3d->Update();<BR>
<BR>
//Create three the line source to use for the probe lines.<BR>
vtkLineSource *line=vtkLineSource::New();<BR>
line->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->Translate(3.7,0.0,28.37);<BR>
transL1->Scale(5,5,5);<BR>
transL1->RotateY(90);<BR>
vtkTransformPolyDataFilter *tf=vtkTransformPolyDataFilter::New();<BR>
tf->SetInputConnection(line->GetOutputPort());<BR>
tf->SetTransform(transL1);<BR>
vtkProbeFilter *probe=vtkProbeFilter::New();<BR>
probe->SetInputConnection(tf->GetOutputPort());<BR>
probe->SetSource(pl3d->GetOutput());<BR>
<BR>
//Move the line again and create another probe filter.<BR>
vtkTransform *transL2=vtkTransform::New();<BR>
transL2->Translate(9.2,0.0,31.20);<BR>
transL2->Scale (5, 5, 5);<BR>
transL2-> RotateY (90);<BR>
vtkTransformPolyDataFilter *tf2=vtkTransformPolyDataFilter::New();<BR>
tf2-> SetInputConnection (line-> GetOutputPort());<BR>
tf2 ->SetTransform (transL2);<BR>
vtkProbeFilter *probe2=vtkProbeFilter::New();<BR>
probe2-> SetInputConnection (tf2 ->GetOutputPort());<BR>
probe2-> SetSource (pl3d-> GetOutput());<BR>
<BR>
//Move the line again and create a third probe filter.<BR>
vtkTransform *transL3=vtkTransform::New();<BR>
transL3-> Translate( 13.27, 0.0, 33.40);<BR>
transL3->Scale( 4.5, 4.5, 4.5);<BR>
transL3-> RotateY( 90);<BR>
vtkTransformPolyDataFilter *tf3=vtkTransformPolyDataFilter::New();<BR>
tf3-> SetInputConnection(line->GetOutputPort());<BR>
tf3-> SetTransform (transL3);<BR>
vtkProbeFilter *probe3=vtkProbeFilter::New();<BR>
probe3-> SetInputConnection (tf3 ->GetOutputPort());<BR>
probe3-> SetSource(pl3d-> 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-> AddInput (probe-> GetPolyDataOutput());<BR>
appendF-> AddInput (probe2-> GetPolyDataOutput());<BR>
appendF-> AddInput (probe3-> 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-> SetInputConnection (appendF->GetOutputPort());<BR>
tuber-> SetRadius (0.1);<BR>
vtkPolyDataMapper *lineMapper=vtkPolyDataMapper::New();<BR>
lineMapper-> SetInputConnection (tuber-> GetOutputPort());<BR>
vtkActor *lineActor=vtkActor::New();<BR>
lineActor-> 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-> AddInput (probe-> GetOutput());<BR>
xyplot-> AddInput (probe2-> GetOutput());<BR>
xyplot->AddInput (probe3-> GetOutput());<BR>
xyplot->GetPositionCoordinate()-> SetValue (0.0, 0.67, 0);<BR>
xyplot-> GetPosition2Coordinate()-> SetValue (1.0, 0.33, 0); //relative to<BR>
Position<BR>
xyplot-> SetXValuesToArcLength();<BR>
xyplot-> SetNumberOfXLabels( 6);<BR>
xyplot ->SetTitle ("Pressure vs. Arc Length (Zoomed View)");<BR>
xyplot-> SetXTitle( "");<BR>
xyplot-> SetYTitle ("P");<BR>
xyplot-> SetXRange( .1 ,.35);<BR>
xyplot-> SetYRange( .2, .4);<BR>
xyplot-> GetProperty()-> SetColor (0, 0, 0);<BR>
xyplot-> GetProperty()-> 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-> GetTitleTextProperty();<BR>
tprop ->SetColor(xyplot-> GetProperty()-> GetColor());<BR>
xyplot ->SetAxisTitleTextProperty (tprop);<BR>
xyplot-> 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-> AddInput (probe-> GetOutput());<BR>
xyplot2 ->AddInput (probe2 ->GetOutput());<BR>
xyplot2-> AddInput (probe3 ->GetOutput());<BR>
xyplot2-> GetPositionCoordinate()-> SetValue (0.00 ,0.33, 0);<BR>
xyplot2-> GetPosition2Coordinate()-> SetValue( 1.0, 0.33, 0); //<BR>
relative to Position<BR>
xyplot2-> SetXValuesToNormalizedArcLength();<BR>
xyplot2-> SetNumberOfXLabels (6);<BR>
xyplot2-> SetTitle ("Pressure vs. Normalized Arc Length");<BR>
xyplot2-> SetXTitle ("");<BR>
xyplot2 ->SetYTitle ("P");<BR>
xyplot2-> PlotPointsOn();<BR>
xyplot2 ->PlotLinesOff();<BR>
xyplot2-> GetProperty()-> SetColor (1 ,0, 0);<BR>
xyplot2-> GetProperty()-> 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-> GetTitleTextProperty();<BR>
tprop ->SetColor(xyplot-> GetProperty()-> GetColor());<BR>
xyplot2 ->SetAxisTitleTextProperty (tprop);<BR>
xyplot2-> 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-> AddInput (probe-> GetOutput());<BR>
xyplot3-> AddInput (probe2-> GetOutput());<BR>
xyplot3 ->AddInput (probe3 ->GetOutput());<BR>
xyplot3-> GetPositionCoordinate()-> SetValue (0.0, 0.0 ,0);<BR>
xyplot3-> GetPosition2Coordinate()-> SetValue (1.0, 0.33, 0); <BR>
//relative to Position<BR>
xyplot3 ->SetXValuesToIndex();<BR>
xyplot3-> SetNumberOfXLabels (6);<BR>
xyplot3 ->SetTitle ("Pressure vs. Point Id");<BR>
xyplot3-> SetXTitle ("Probe Length");<BR>
xyplot3 ->SetYTitle ("P");<BR>
xyplot3 ->PlotPointsOn();<BR>
xyplot3->GetProperty()-> SetColor (0 ,0, 1);<BR>
xyplot3-> GetProperty()-> 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-> GetTitleTextProperty();<BR>
tprop ->SetColor(xyplot-> GetProperty()-> GetColor());<BR>
xyplot3 ->SetAxisTitleTextProperty (tprop);<BR>
xyplot3-> SetAxisLabelTextProperty (tprop);<BR>
<BR>
//aw an outline of the PLOT3D data set.<BR>
vtkStructuredGridOutlineFilter *outline=vtkStructuredGridOutlineFilter::New();<BR>
outline ->SetInputConnection (pl3d-> GetOutputPort());<BR>
vtkPolyDataMapper *outlineMapper=vtkPolyDataMapper::New();<BR>
outlineMapper-> SetInputConnection (outline ->GetOutputPort());<BR>
vtkActor *outlineActor=vtkActor::New();<BR>
outlineActor-> SetMapper (outlineMapper);<BR>
outlineActor-> GetProperty()-> 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->AddRenderer(ren1);<BR>
renWin->AddRenderer(ren2);<BR>
<BR>
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<BR>
iren->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-> SetBackground (0.6784 ,0.8471, 0.9020);<BR>
ren1 ->SetViewport (0, 0, .5, 1);<BR>
ren1-> AddActor (outlineActor);<BR>
ren1 ->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 ->SetBackground (1, 1, 1);<BR>
ren2 ->SetViewport (0.5 ,0.0 ,1.0, 1.0);<BR>
ren2 ->AddActor2D (xyplot);<BR>
ren2->AddActor2D (xyplot2);<BR>
ren2-> AddActor2D (xyplot3);<BR>
renWin-> SetSize (500, 250);<BR>
// We'll zoom in a little by accessing the camera and invoking a "Zoom"<BR>
// method on it.<BR>
ren1->ResetCamera();<BR>
ren1->GetActiveCamera()->Zoom(1.5);<BR>
renWin->Render();<BR>
<BR>
<BR>
// Set up the camera parameters.<BR>
vtkCamera *cam1;<BR>
cam1= ren1 ->GetActiveCamera();<BR>
cam1-> SetClippingRange (3.95297, 100);<BR>
cam1-> SetFocalPoint (8.88908, 0.595038 ,29.3342);<BR>
cam1-> SetPosition (-12.3332, 31.7479, 41.2387);<BR>
cam1-> SetViewUp (0.060772, -0.319905, 0.945498);<BR>
iren ->Initialize();<BR>
<BR>
<BR>
<BR>
// This starts the event loop and as a side effect causes an initial render.<BR>
// iren->Start();<BR>
<BR>
// Exiting from here, we have to delete all the instances that<BR>
// have been created.<BR>
pl3d->Delete();<BR>
line->Delete();<BR>
transL1->Delete();<BR>
tf->Delete();<BR>
probe->Delete();<BR>
transL2->Delete();<BR>
tf2->Delete();<BR>
probe2->Delete();<BR>
transL3->Delete();<BR>
tf3->Delete();<BR>
probe3->Delete();<BR>
appendF->Delete();<BR>
tuber->Delete();<BR>
lineMapper->Delete();<BR>
lineActor->Delete();<BR>
xyplot->Delete();<BR>
xyplot2->Delete();<BR>
xyplot3->Delete();<BR>
outline->Delete();<BR>
outlineMapper->Delete();<BR>
outlineActor->Delete();<BR>
ren1->Delete();<BR>
ren2->Delete();<BR>
renWin->Delete();<BR>
iren->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>
Edoardo</FONT>
</P>
</BODY>
</HTML>