<!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> </DIV>
<DIV style="FONT: 10pt arial">
<DIV><FONT face=Arial size=2>Hi! I think this method <U>definitely doesn't
work</U>:
vtkActor2D->GetPosition2Coordinate->SetValue(x,y,z).</FONT></DIV></DIV>
<DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This is my code (a simple straight
line):</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>/*This should draw a diagonal in the left-bottom
quarter of the window, but the diagonal crosses the whole screen. If the
commented lines below are enabled, the behaviour it's the same*/</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#include "vtkActor2D.h"<BR>#include
"vtkRenderWindow.h"<BR>#include "vtkRenderer.h"<BR>#include
"vtkRenderWindowInteractor.h"<BR>#include "vtkPolyDataMapper2D.h"<BR>#include
"vtkProperty2D.h"<BR>#include "vtkPolyData.h"<BR>#include
"vtkPoints.h"<BR>#include "vtkCellArray.h"<BR>#include
"vtkCamera.h"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>int main(int argc, char *argv[]){</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkPolyData
*linea=vtkPolyData::New();<BR> vtkPoints
*puntos=vtkPoints::New();<BR> vtkCellArray
*lineas=vtkCellArray::New();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkPolyDataMapper2D
*mapper=vtkPolyDataMapper2D::New();<BR> vtkActor2D
*actor=vtkActor2D::New();<BR> vtkRenderer
*render=vtkRenderer::New();<BR> vtkRenderWindow
*ventana=vtkRenderWindow::New();<BR> vtkRenderWindowInteractor
*interac=vtkRenderWindowInteractor::New();<BR> vtkCoordinate
*coor=vtkCoordinate::New();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
lineas->InsertNextCell(2);<BR>
lineas->InsertCellPoint(0);<BR>
lineas->InsertCellPoint(1);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
puntos->InsertPoint(0,0.0,0.0,0.0);<BR>
puntos->InsertPoint(1,1.0,1.0,0.0);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
linea->SetPoints(puntos);<BR>
linea->SetLines(lineas);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
coor->SetCoordinateSystemToNormalizedViewport();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
mapper->SetInput(linea);<BR>
mapper->SetTransformCoordinate(coor);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
actor->SetMapper(mapper);<BR>
actor->GetProperty()->SetColor(1.0,0.0,0.0);<BR>
actor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();<BR>
actor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();<BR>
//actor->GetPosition2Coordinate()->SetReferenceCoordinate(NULL);<BR>
</FONT></DIV>
<DIV><FONT face=Arial size=2>
actor->GetPositionCoordinate()->SetValue(0.0,0.0,0.0);<BR>
<STRONG>actor->GetPosition2Coordinate()->SetValue(0.5,0.5,0.0); //
﹛?ere!!!</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2> render->AddActor2D(actor);<BR>
render->SetBackground(0.1,0.2,0.4);<BR>//
render->ResetCamera();<BR>//
render->ResetCameraClippingRange();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
ventana->AddRenderer(render);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
interac->SetRenderWindow(ventana);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
ventana->Render();<BR> interac->Start();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
linea->Delete();<BR>
puntos->Delete();<BR> lineas->Delete();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
mapper->Delete();<BR>
actor->Delete();<BR>
render->Delete();<BR>
ventana->Delete();<BR>
interac->Delete();<BR> coor->Delete();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> return
0;}</FONT></DIV></DIV></BODY></HTML>