<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR>
<STYLE>@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=white>
<DIV><FONT size=2><FONT face=Arial>Thanks John! Everything worked fine! Although 
I agree with you in the fact that it's easier to use data object rather than a 
dataset, I wondered If you could tell me why the 
<STRONG>SetDataObject...Component(... , ...)</STRONG> function doesn't work fine 
in my example and what's the difference between 
<STRONG>SetDataObjectPlotModeToColumns</STRONG>() and 
<STRONG>SetDataObjectPlotModeToRows</STRONG>(), since I don't know&nbsp;what 
<STRONG>columns</STRONG> and <STRONG>rows</STRONG> these functions refer to 
(I've already seen the HTML help).</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks again! Isidro.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV style="FONT: 10pt arial">----- Original Message ----- 
<DIV style="BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A 
title=jcplatt@dsl.pipex.com href="mailto:jcplatt@dsl.pipex.com">John Platt</A> 
</DIV>
<DIV><B>To:</B> <A title=morenoisidro@yahoo.com.ar 
href="mailto:morenoisidro@yahoo.com.ar">'Isidro Moreno'</A> </DIV>
<DIV><B>Cc:</B> <A title=vtkusers@vtk.org href="mailto:vtkusers@vtk.org">vtk 
Users</A> </DIV>
<DIV><B>Sent:</B> Thursday, December 13, 2007 7:39 PM</DIV>
<DIV><B>Subject:</B> RE: [vtkusers] Strange behaviour of vtkXYPlotActor 
class</DIV></DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">It may be easier to use 
data object input rather than a data set. You could try the 
following.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkFloatArray.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkFieldData.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkDataObject.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkXYPlotActor.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkXYPlotWidget.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkMath.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkRenderWindow.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkRenderer.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">#include 
"vtkRenderWindowInteractor.h"</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">int APIENTRY 
wWinMain(HINSTANCE hInstance,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
HINSTANCE hPrevInstance,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
LPSTR&nbsp;&nbsp;&nbsp;&nbsp; lpCmdLine,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nCmdShow)</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">{</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkFloatArray* vtkXYValues = vtkFloatArray::New();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkXYValues-&gt;SetNumberOfComponents( static_cast&lt;vtkIdType&gt;(2) 
);</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; for ( int 
i = 0; i &lt; 360; ++i )</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
{</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
float xy[2];</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
xy[0] = static_cast&lt;float&gt;(i);</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
xy[1] = sin( xy[0]*vtkMath::DegreesToRadians() );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
vtkXYValues-&gt;InsertNextTuple( xy );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
}</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkFieldData* vtkGraphFieldData = vtkFieldData::New();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraphFieldData-&gt;AddArray( vtkXYValues );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkXYValues-&gt;Delete();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkDataObject* vtkGraphDataObject = vtkDataObject::New();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraphDataObject-&gt;SetFieldData( vtkGraphFieldData );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraphFieldData-&gt;Delete();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkXYPlotActor* vtkGraph = vtkXYPlotActor::New();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraph-&gt;AddDataObjectInput( vtkGraphDataObject );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraphDataObject-&gt;Delete();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraph-&gt;SetDataObjectPlotModeToColumns(); </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraph-&gt;SetXValuesToValue();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; // Must 
state the component for the X &amp; Y otherwise 0 is assumed for 
both!!</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; int curve 
= 0;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraph-&gt;SetDataObjectXComponent( curve, 0 );&nbsp;&nbsp; </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraph-&gt;SetDataObjectYComponent( curve, 1 );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraph-&gt;SetXRange( 0, 360 );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraph-&gt;SetYRange( -1, 1 );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkGraph-&gt;SetPlotColor( curve, 1,0,0 );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkRenderer* renderer = vtkRenderer::New();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
renderer-&gt;AddActor2D( vtkGraph );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkRenderWindow* renderWin = vtkRenderWindow::New();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
renderWin-&gt;AddRenderer( renderer );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkRenderWindowInteractor* interactor = 
vtkRenderWindowInteractor::New();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
interactor-&gt;SetRenderWindow( renderWin );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkXYPlotWidget* vtkXYPlotWidget = vtkXYPlotWidget::New(); </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkXYPlotWidget-&gt;SetXYPlotActor( vtkGraph );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkXYPlotWidget-&gt;SetInteractor( interactor );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
vtkXYPlotWidget-&gt;SetEnabled( true );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
interactor-&gt;Initialize();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; 
interactor-&gt;Start();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp; return 
0;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">}</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">HTH 
John.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Tahoma size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original 
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> 
vtkusers-bounces+jcplatt=dsl.pipex.com@vtk.org 
[mailto:vtkusers-bounces+jcplatt=dsl.pipex.com@vtk.org] <B><SPAN 
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Isidro Moreno<BR><B><SPAN 
style="FONT-WEIGHT: bold">Sent:</SPAN></B> </SPAN></FONT><FONT face=Tahoma 
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">13 December 
2007</SPAN></FONT><FONT face=Tahoma size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> </SPAN></FONT><FONT face=Tahoma 
size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">18:37</SPAN></FONT><FONT 
face=Tahoma size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN 
style="FONT-WEIGHT: bold">To:</SPAN></B> vtkusers@vtk.org<BR><B><SPAN 
style="FONT-WEIGHT: bold">Subject:</SPAN></B> [vtkusers] Strange behaviour of 
vtkXYPlotActor class</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi! I'm a beginer in VTK and I've 
been trying to draw the sinus func with vtkxyplotactor for teaching purposes. 
The strange thing is that although I indicate which are&nbsp;the x-y components 
in the values&nbsp;array, the system draws the "arc sin" function. I don't know 
how to understand this;&nbsp;Am I&nbsp;wrong? or the system swap 
components?</SPAN></FONT></P></DIV>
<DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here's the 
code:</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">#include 
"vtkPointData.h"<BR>#include "vtkPoints.h"<BR>#include 
"vtkCellArray.h"<BR>#include "vtkPolyData.h"<BR>#include 
"vtkRenderer.h"<BR>#include "vtkRenderWindow.h"<BR>#include 
"vtkRenderWindowInteractor.h"<BR>#include "vtkXYPlotActor.h"<BR>#include 
"vtkDataSetCollection.h"</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">int main(){</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; CONSOLE:&nbsp;how many 
points entry to form the "line".</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; CONSOLA: Ingreso de la 
cantidad de puntos que formarán la "curva".</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; int 
data_puntos;<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;"Ingrese cantidad de puntos 
(1-50): ";<BR>&nbsp;&nbsp;&nbsp; cin&gt;&gt;data_puntos;</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; Creación de una Celda - 
Definición topológica y geométrica</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; Definición 
Topológica<BR>//&nbsp; Inserción de 1(una) celda con 'n' 
puntos<BR>&nbsp;&nbsp;&nbsp; vtkCellArray 
*cellarray=vtkCellArray::New();<BR>&nbsp;&nbsp;&nbsp; 
cellarray-&gt;InsertNextCell(data_puntos);</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; Definición Geométrica y 
relación con la topología</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; vtkPoints 
*puntos=vtkPoints::New();</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; for(int 
j=0;j&lt;data_puntos;j++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
cellarray-&gt;InsertCellPoint(j); // ___ j = nºID de cada 
punto<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
puntos-&gt;InsertPoint(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
j, // _________________________ nº 
ID<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
j/5.0, // _____________________ valor de 
"x"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sin(j/5.0), // ________________ valor de 
"y"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
0.0 // _________________________valor de 
"z"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
);}</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; Agregado de información 
topológica y geométrica al DataSet</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; vtkPolyData 
*polydata=vtkPolyData::New();<BR>&nbsp;&nbsp;&nbsp; 
polydata-&gt;SetPoints(puntos);&nbsp;&nbsp; // Puntos<BR>&nbsp;&nbsp;&nbsp; 
polydata-&gt;SetLines(cellarray); // Celdas - 1(una)</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; 
polydata-&gt;GetPointData()-&gt;SetScalars(puntos-&gt;GetData());<BR>&nbsp;&nbsp;&nbsp; 
polydata-&gt;GetPointData()-&gt;Update();</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; Creación de un 
Actor</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; vtkXYPlotActor 
*actor=vtkXYPlotActor::New();</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; 
actor-&gt;SetXValuesToValue();<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetDataObjectXComponent(0,1);<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetDataObjectYComponent(0,2);</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; 
actor-&gt;AddInput(polydata);<BR>&nbsp;&nbsp;&nbsp; </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">// The following&nbsp;didn't help me 
enough... : ( </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; 
cout&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetInputList()-&gt;GetNumberOfItems()="&lt;&lt;actor-&gt;GetInputList()-&gt;GetNumberOfItems()&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetDataObjectXComponent(0)="&lt;&lt;actor-&gt;GetDataObjectXComponent(0)&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetDataObjectYComponent(0)="&lt;&lt;actor-&gt;GetDataObjectYComponent(0)&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetXValues()="&lt;&lt;actor-&gt;GetXValues()&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetXValuesAsString()="&lt;&lt;actor-&gt;GetXValuesAsString()&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetPointComponent(0)="&lt;&lt;actor-&gt;GetPointComponent(0);</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; Creación de objetos de 
renderización</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; vtkRenderer 
*renderer=vtkRenderer::New();<BR>&nbsp;&nbsp;&nbsp; 
renderer-&gt;AddActor2D(actor);<BR>&nbsp;&nbsp;&nbsp; 
renderer-&gt;SetBackground(0.0,0.0,0.0);</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; vtkRenderWindow 
*ventana=vtkRenderWindow::New();<BR>&nbsp;&nbsp;&nbsp; 
ventana-&gt;AddRenderer(renderer);</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; 
vtkRenderWindowInteractor 
*interac=vtkRenderWindowInteractor::New();<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;SetRenderWindow(ventana);</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; 
ventana-&gt;Render(); // Inicio de la renderización<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;Initialize();<BR>&nbsp;&nbsp;&nbsp; interac-&gt;Start();&nbsp; // 
Inicia el "looping"</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; 
polydata-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
puntos-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
cellarray-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
renderer-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
ventana-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;Delete();</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; return 
0;}</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" 
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks in advance! 
Isidro.</SPAN></FONT></P></DIV></DIV></DIV>
<P>
<HR>

<P></P>No virus found in this incoming message.<BR>Checked by AVG Free Edition. 
<BR>Version: 7.5.503 / Virus Database: 269.16.17/1177 - Release Date: 7/12/2007 
13:11<BR></BODY></HTML>