<!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.16481" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>OK, here's a 
simple code:<BR><BR>#include "vtkActor2D.h"<BR>#include 
"vtkRenderWindow.h"<BR>#include "vtkRenderer.h"<BR>#include 
"vtkRenderWindowInteractor.h"<BR>#include "vtkPolyDataMapper2D.h"<BR>#include 
"vtkLineSource.h"<BR>#include "vtkProperty2D.h"<BR><BR>int main(int argc, char 
*argv[]){<BR><BR>&nbsp;&nbsp;&nbsp; vtkLineSource 
*linea=vtkLineSource::New();<BR>&nbsp;&nbsp;&nbsp; 
linea-&gt;SetPoint1(-100.0,600.0,0.0);<BR>&nbsp;&nbsp;&nbsp; 
linea-&gt;SetPoint2(-800.0,500.0,0.0);<BR><BR>&nbsp;&nbsp;&nbsp; 
vtkPolyDataMapper2D *mapper=vtkPolyDataMapper2D::New();<BR>&nbsp;&nbsp;&nbsp; 
mapper-&gt;SetInput(linea-&gt;GetOutput());<BR><BR>&nbsp;&nbsp;&nbsp; vtkActor2D 
*actor=vtkActor2D::New();<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetMapper(mapper);<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;GetProperty()-&gt;SetColor(1.0,0.0,0.0);<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetWidth(0.25);<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetHeight(0.25);<BR><BR>&nbsp;&nbsp;&nbsp; vtkRenderer 
*render=vtkRenderer::New();<BR>&nbsp;&nbsp;&nbsp; vtkRenderWindow 
*ventana=vtkRenderWindow::New();<BR>&nbsp;&nbsp;&nbsp; 
ventana-&gt;AddRenderer(render);<BR><BR>&nbsp;&nbsp;&nbsp; 
vtkRenderWindowInteractor 
*interac=vtkRenderWindowInteractor::New();<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;SetRenderWindow(ventana);<BR><BR>&nbsp;&nbsp;&nbsp; 
render-&gt;AddActor2D(actor);<BR>&nbsp;&nbsp;&nbsp; 
render-&gt;SetBackground(0.1,0.2,0.4);<BR><BR>&nbsp;&nbsp;&nbsp; 
ventana-&gt;SetSize(600,400);<BR>&nbsp;&nbsp;&nbsp; 
ventana-&gt;Render();<BR><BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;Initialize();<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;Start();<BR><BR>&nbsp;&nbsp;&nbsp; 
linea-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
mapper-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
render-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
ventana-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;Delete();<BR><BR>&nbsp;&nbsp;&nbsp; return 0;}<BR><BR>Now, try to 
change window's size with your mouse and you'll see that the <BR>line don't 
scale and an xyplotactor. There's where my problem started...<BR><BR>3RD) I've 
already seen the help file. I meant I couldn't find anything in 
<BR>vtkActor2D.h.<BR><BR>Isidro.<BR><BR>----- Original Message ----- <BR>From: 
"Dean Inglis" &lt;</FONT><A href="mailto:dean.inglis@sympatico.ca"><FONT 
face="Times New Roman" size=3>dean.inglis@sympatico.ca</FONT></A><FONT 
face="Times New Roman" size=3>&gt;<BR>To: &lt;</FONT><A 
href="mailto:vtkusers@vtk.org"><FONT face="Times New Roman" 
size=3>vtkusers@vtk.org</FONT></A><FONT face="Times New Roman" 
size=3>&gt;<BR>Cc: &lt;</FONT><A href="mailto:morenoisidro@yahoo.com.ar"><FONT 
face="Times New Roman" size=3>morenoisidro@yahoo.com.ar</FONT></A><FONT 
face="Times New Roman" size=3>&gt;<BR>Sent: Tuesday, July 03, 2007 10:56 
PM<BR>Subject: [vtkusers] Drawing a simple line graph 
(CONTINUES...)<BR><BR><BR>&gt; Hi Isidro,<BR>&gt;<BR>&gt; 1st) if you post code 
examples, they are useful<BR>&gt; if they are complete and can be compiled and 
run by<BR>&gt; anybody. Can you post a very simple and complete<BR>&gt; example 
that illustrates your problem (a tcl script would<BR>&gt; be easiest), for 
example, a line drawn from<BR>&gt; (-100,600) to (-800, 500).<BR>&gt;<BR>&gt; 
2nd) got it.&nbsp; It might be interesting to show what<BR>&gt; happens if you 
draw the same line/function on an<BR>&gt; image with vtkImageCanvasSource2D and 
visualize with<BR>&gt; vtkImageViewer...<BR>&gt;<BR>&gt; (3rd)?<BR>&gt; HOWEVER, 
I found there is no definition of GetPositionCoordinates()<BR>&gt; and 
GetPosition2Coordinates() methods in vtkActor2D.h . Where are them<BR>&gt; 
defined in?<BR>&gt;<BR>&gt; From the vtk documentation:<BR>&gt;<BR>&gt; 
//<BR>&gt; virtual vtkCoordinate* vtkActor2D::GetPositionCoordinate&nbsp; 
(&nbsp;&nbsp;&nbsp;&nbsp; ) <BR>&gt; [virtual]<BR>&gt;<BR>&gt;&nbsp;&nbsp; Get 
the PositionCoordinate instance of vtkCoordinate. This is used for<BR>&gt; 
complicated or relative positioning. The position variable controls the<BR>&gt; 
lower left corner of the Actor2D<BR>&gt;<BR>&gt; Referenced by 
vtkAxisActor2D::GetPoint1Coordinate().<BR>&gt; //<BR>&gt;<BR>&gt; "Why should I 
change "reference coordinate" to NULL? In fact, position2 is<BR>&gt; relative to 
position..."<BR>&gt;<BR>&gt; The documentation (as well as the source code) of 
vtkCoordinate and any<BR>&gt; examples or<BR>&gt; tests for that class should be 
more helpful.&nbsp; Position2 is not necessarily<BR>&gt; relative to 
position(1).<BR>&gt;<BR>&gt; (4th)?<BR>&gt; "Finally I tried with 
actor-&gt;PrintSelf(cout,0) and everything seemed to be<BR>&gt; 
OK..."<BR>&gt;<BR>&gt; PrintSelf will not tell you much other than what Set/Get 
objects or ivars<BR>&gt; are and what they were set to.&nbsp; Setting an object 
to, for example,<BR>&gt; myObject-&gt;DebugOn() and then capturing the output 
with the following will<BR>&gt; tell you much more:<BR>&gt;<BR>&gt; #include 
"vtkOutputWindow.h"<BR>&gt; #include "vtkFileOutputWindow.h"<BR>&gt;<BR>&gt; 
void myvtkmain(void)<BR>&gt; {<BR>&gt;&nbsp; vtkOutputWindow* ow = 
vtkOutputWindow::GetInstance();<BR>&gt;&nbsp; vtkFileOutputWindow* fow = 
vtkFileOutputWindow::New();<BR>&gt;&nbsp; 
fow-&gt;SetFileName("my_debug_log.txt");<BR>&gt;&nbsp; 
if(ow)<BR>&gt;&nbsp;&nbsp;&nbsp; {<BR>&gt;&nbsp;&nbsp;&nbsp; 
ow-&gt;SetInstance(fow);<BR>&gt;&nbsp;&nbsp;&nbsp; }<BR>&gt;&nbsp; 
fow-&gt;Delete();<BR>&gt;<BR>&gt;&nbsp; vtkSomeObject* myobject = 
vtkSomeObject::New();<BR>&gt;&nbsp; 
myobject-&gt;DebugOn();<BR>&gt;<BR>&gt;&nbsp; // ...<BR>&gt;<BR>&gt;&nbsp; 
myobject-&gt;Delete();<BR>&gt; }<BR>&gt;<BR>&gt; 
Dean<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; -- <BR>&gt; No virus found in this incoming 
message.<BR>&gt; Checked by AVG Free Edition.<BR>&gt; Version: 7.5.476 / Virus 
Database: 269.9.12/878 - Release Date: 28/6/2007 <BR>&gt; 17:57<BR>&gt;<BR>&gt; 
</FONT><BR></FONT></DIV></BODY></HTML>