<!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>
<DIV><FONT face=Arial size=2>Hi, I have been dealing with vtkActor2D problem for 
the last 3 week and got no solutions. I found somebody in vtkusers archive who 
had the same problem. For those who don know excactly what I'm talking about and 
would like to help me, please visit:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><A 
href="http://public.kitware.com/pipermail/vtkusers/2006-November/088196.html">http://public.kitware.com/pipermail/vtkusers/2006-November/088196.html</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>It's unbelievable that a simple line or polygon 
can't be drawn in the plane properly. I think somebody must have the answer to 
my question.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Now, supposing you must have seen Beth's code 
while&nbsp;following the subject in the link above, I'll show you my own code 
(and the answers from those who have tried&nbsp;give me some&nbsp;help - you can 
find more in VTKUSER'S ARCHIVES - subjects:&nbsp;"vtkLineSource and drawing a 
curve line"; "vtkCoordinate a simple test program"; "vtkActor2D ignores 
SetPosition2() methods"; "Scale vtkActord2D while resize window").</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In sum, the problem is that I can't use methods for 
changing my vtkActor2D dimensions.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//THIS EXAMPLE DRAWS A SINUS FUNCTION'S 
PERIOD</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>vtkLineSource 
*linea=vtkLineSource::New();<BR>&nbsp;&nbsp;&nbsp; vtkPolyDataMapper2D 
*mapper=vtkPolyDataMapper2D::New();<BR>&nbsp;&nbsp;&nbsp; vtkActor2D 
*actor=vtkActor2D::New();<BR>&nbsp;&nbsp;&nbsp; vtkRenderer 
*render=vtkRenderer::New();<BR>&nbsp;&nbsp;&nbsp; vtkRenderWindow 
*ventana=vtkRenderWindow::New();<BR>&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor 
*interac=vtkRenderWindowInteractor::New();<BR>&nbsp;&nbsp;&nbsp; vtkCoordinate 
*coor=vtkCoordinate::New();</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>&nbsp;&nbsp;&nbsp; int *dim_ven=new int [2];<BR>&nbsp;&nbsp;&nbsp; 
dim_ven[0]=600;<BR>&nbsp;&nbsp;&nbsp; dim_ven[1]=400;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; int segmentos;<BR>&nbsp;&nbsp;&nbsp; 
cout&lt;&lt;"Ingrese cantidad de segmentos: ";<BR>&nbsp;&nbsp;&nbsp; 
cin&gt;&gt;segmentos;<BR>&nbsp;&nbsp;&nbsp; 
cout&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
linea-&gt;SetResolution(segmentos);<BR>&nbsp;&nbsp;&nbsp; 
linea-&gt;Update();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; double PI=3.1416;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; double 
delta=2*PI/(dim_ven[0]*1.0);<BR>&nbsp;&nbsp;&nbsp; double 
resolucion=(dim_ven[0]*1.0)/(segmentos*1.0);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; for(int 
i=0;i&lt;linea-&gt;GetOutput()-&gt;GetPoints()-&gt;GetNumberOfPoints();i++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
linea-&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
GetOutput()-&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
GetPoints()-&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
SetPoint(i,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
i*resolucion,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(dim_ven[1]/2)*sin(i*resolucion*delta)+(dim_ven[1]/2),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
0.0);}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; mapper-&gt;SetInput(linea-&gt;GetOutput());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; actor-&gt;SetMapper(mapper);<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;GetProperty()-&gt;SetColor(1.0,0.0,0.0);</DIV>
<DIV>//&nbsp; actor-&gt;GetPosition2Coordinate-&gt;SetValue(double width, double 
height)&nbsp;&nbsp;THIS METHOD AND IT'S FAMILY DON'T WORK!!</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; render-&gt;AddActor2D(actor);<BR>&nbsp;&nbsp;&nbsp; 
render-&gt;SetBackground(0.1,0.2,0.4);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; ventana-&gt;AddRenderer(render);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
interac-&gt;SetRenderWindow(ventana);<BR>&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp; ventana-&gt;Render();<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;Start();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&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>&nbsp;&nbsp;&nbsp; 
coor-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; delete [] dim_ven;</DIV>
<DIV>&nbsp;</DIV>
<DIV>--- Thanks for your time/help!! ---</DIV>
<DIV>&nbsp;</DIV>
<DIV><U>These are the responses&nbsp;ordered from the newest to the 
oldest:</U></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&gt; OK, let's see; as you must have seen the code below, it consist of 
drawing <BR>&gt; a diagonal line. Width a Height are the dimensions the 
rectangle in which <BR>&gt; this line is defined in. Using these two methods is 
the same as doing <BR>&gt; 
vtkActor2D-&gt;GetPosition2Coordinate-&gt;SetValue(x,y) (where x=width &amp; 
<BR>&gt; y=height - see HTML help of vtkActor2D) as I've explained below. The 
<BR>&gt; pourpose of all these is to autoscale any figure in the plane when the 
<BR>&gt; window's size changes (not just a line but also a polygon, rectangle, 
<BR>&gt; etc). In fact, I've used this code to draw a period of the sinus 
function <BR>&gt; and it was fine! But I can't make it fit my window. It put a 
simple line <BR>&gt; in the code below to make the things easier to understand, 
but you're the <BR>&gt; second who asks me the same question. Should I be more 
clear and put the <BR>&gt; actual code? Sorry for my english, I'm spanish 
speaker.<BR>&gt;&nbsp;&nbsp;&nbsp; I know I can do this with actor 3D, but I 
think It's not good using it <BR>&gt; in terms of design since I'm working in 
the plane and many unused memory <BR>&gt; would be kept in if I use 
actor3D.<BR>&gt;<BR>&gt;<BR>&gt;&gt; Isidro,<BR>&gt;&gt;<BR>&gt;&gt; Could you 
be a bit more clear about what you want to do exactly?<BR>&gt;&gt; Does not a 
line have zero 'width' and 'height' by definition?<BR>&gt;&gt; If you want to 
change the size of your line, perhaps you could change <BR>&gt;&gt; 
Point1<BR>&gt;&gt; and Point2 on your line when you needed.&nbsp; Otherwise you 
could also <BR>&gt;&gt; position<BR>&gt;&gt; your line in 3D instead of using an 
Actor2D, this would give you some <BR>&gt;&gt; more<BR>&gt;&gt; 
flexibility.<BR>&gt;&gt;<BR>&gt;&gt; -SN<BR>&gt;&gt;<BR>&gt;&gt; -----Original 
Message-----<BR>&gt;&gt;<BR>&gt;&gt; I've been trying so hard, and It seems 
vtkActor2D ignores SetPositon2()<BR>&gt;&gt; method (or 
vtkActor2D-&gt;GetPosition2Coordinate-&gt;SetValue(x,y) method - see<BR>&gt;&gt; 
HTML vtkActor2D help). Could somebody help me if this is what's 
actually<BR>&gt;&gt; happening?<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;&gt;&gt; On 
6/26/07, Isidro Moreno &lt;<A 
href="mailto:morenoisidro@yahoo.com.ar">morenoisidro@yahoo.com.ar</A>&gt; 
wrote:<BR>&gt;&gt;&gt;&gt;&gt; 
Mark,<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp; 
SetWidth() and SetHeight() methods (vtkProp's methods),define 
the<BR>&gt;&gt;&gt;&gt;&gt; dimensions of the rectangle in which the line is 
drawn (it could be <BR>&gt;&gt;&gt;&gt;&gt; not<BR>&gt;&gt;&gt;&gt;&gt; 
a<BR>&gt;&gt;&gt;&gt;&gt; line, but also a circle, a polygon, etc.). In fact, 
that rectangle is<BR>&gt;&gt;&gt;&gt;&gt; which<BR>&gt;&gt;&gt;&gt;&gt; I want 
to autoscale when window's size changes. As a result, the 
line<BR>&gt;&gt;&gt;&gt;&gt; would<BR>&gt;&gt;&gt;&gt;&gt; fit to it. That's 
what I've understood till now. But I could be <BR>&gt;&gt;&gt;&gt;&gt; 
wrong...<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; 
Isidro<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt; On 6/26/07, Isidro Moreno &lt;<A 
href="mailto:morenoisidro@yahoo.com.ar">morenoisidro@yahoo.com.ar</A>&gt; 
wrote:<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; Hello! I've made a simple VTK/C++ test 
program. It's just a 2D <BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
line.<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; Now,<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
I<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; don't know how to make the line size change. 
I've tried many <BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
methods;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; and<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
changing vtkActor's coordinate system (vtkActor2D's), but no 
<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; results.<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
I<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; even<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; wonder 
what coordinate system is vtkLineSource defined in (see 
code<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; below).<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; Here's my 
code:<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
vtkLineSource *line=vtkLineSource::New();<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
line-&gt;SetPoint1(20.0,20.0,0.0);&nbsp;&nbsp;&nbsp; // what Coordinate 
System??<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
line-&gt;SetPoint2(80.0,150.0,0.0);&nbsp; // what Coordinate 
System??<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
vtkPolyDataMapper2D *mapper=vtkPolyDataMapper2D::New();<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
mapper-&gt;SetInput(line-&gt;GetOutput());<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; vtkActor2D 
*actor=vtkActor2D::New();<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
actor-&gt;SetMapper(mapper);<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
actor-&gt;GetProperty()-&gt;SetColor(1.0,0.0,0.0);<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; actor-&gt;SetWidth(0.5);&nbsp;&nbsp;&nbsp; // 
Doesn't work!! - The same happens<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; with 
vtkActor2D-&gt;GetPosition2Coordinate-&gt;SetValue(double width 
,<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; double height)<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; actor-&gt;SetHeight(0.5);&nbsp;&nbsp; // 
Doesn't work!! - The same happens<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; with 
vtkActor2D-&gt;GetPosition2Coordinate-&gt;SetValue(double width 
,<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; double height)<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; vtkRenderer 
*render=vtkRenderer::New();<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; vtkRenderWindow 
*win=vtkRenderWindow::New();<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
win-&gt;AddRenderer(render);<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
vtkRenderWindowInteractor<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
*interac=vtkRenderWindowInteractor::New();<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
interac-&gt;SetRenderWindow(win);<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
render-&gt;AddActor2D(actor);<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
render-&gt;SetBackground(0.1,0.2,0.4);<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
win-&gt;Render();<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
interac-&gt;Initialize();<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; interac-&gt;Start();<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
line-&gt;Delete();<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
mapper-&gt;Delete();<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
actor-&gt;Delete();<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
render-&gt;Delete();<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
win-&gt;Delete();<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
interac-&gt;Delete();<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; 
&gt;&gt; I want to make the line resize when changing windows size. I'd 
be<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; very<BR>&gt;&gt;&gt;&gt;&gt; &gt;&gt; 
grateful if somebody could help me with this. 
Thanks!!!<BR>&gt;&gt;<BR></DIV></FONT></DIV></BODY></HTML>