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