<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
hi for all:<BR>
i am trying to use the getcurserposition function into plane wigdet that is used to load dicom images in 3 views.the problem is the drawing is done far from the true point i've clicked on.i checked for the code it takes the real point but even though the excution is in another point.<BR>
the conclusion that i reached is that it takes the point from the image but excute it relative to the whole vtkformcontrol.<BR>
i need a scaling function that will help me to draw in the right position.<BR>
thanks in advance.<BR>
the code is<BR>
<BR><FONT size=2>
firstpoint = XYPlaneWidget.GetCurrentCursorPosition();<BR></FONT><FONT size=2>
secondpoint = XYPlaneWidget.GetCurrentCursorPosition();<BR></FONT><FONT color=#008080 size=2>
vtkPoints</FONT><FONT color=#000000 size=2> polylinepoints = </FONT><FONT color=#0000ff size=2>new</FONT><FONT color=#000000 size=2> </FONT><FONT color=#008080 size=2>vtkPoints</FONT><FONT size=2><FONT color=#000000>();</FONT><BR>
<FONT color=#000000></FONT><BR>
</FONT><FONT color=#008080 size=2>vtkPolyData</FONT><FONT size=2> polydata = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>vtkPolyData</FONT><FONT size=2>();<BR>
</FONT><FONT color=#008080 size=2>vtkPolyDataMapper2D</FONT><FONT size=2> mapper = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>vtkPolyDataMapper2D</FONT><FONT size=2>();<BR>
</FONT><FONT color=#008080 size=2>vtkActor2D</FONT><FONT size=2> actor = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>vtkActor2D</FONT><FONT size=2>();<BR></FONT><FONT size=2>
x1 = firstpoint[0];<BR>
y1 = firstpoint[1];<BR>
z1 = firstpoint[2];<BR>
x2 = secondpoint[0];<BR>
y2 = secondpoint[1];<BR>
z2 = secondpoint[2];<BR>
polylinepoints.InsertPoint(0, x1, y1, z1);<BR>
polylinepoints.InsertPoint(1, x2, y2 , z2);<BR><FONT color=#008080 size=2>
vtkCellArray</FONT><FONT color=#000000 size=2> linexy = </FONT><FONT color=#0000ff size=2>new</FONT><FONT color=#000000 size=2> </FONT><FONT color=#008080 size=2>vtkCellArray</FONT><FONT size=2><FONT color=#000000>();</FONT><BR>
linexy.InsertNextCell(2);<BR>
linexy.InsertCellPoint(0);<BR>
linexy.InsertCellPoint(1); <BR>
polydata.SetPoints(polylinepoints);<BR>
polydata.SetLines(linexy);<BR>
mapper.SetInput(polydata);<BR>
mapper.SetScalarModeToUseCellData();<BR>
XYRenderer.RemoveActor(actor);<BR>
actor.SetMapper(mapper);<BR>
actor.GetProperty().SetColor(1, 0, 0);<BR>
actor.GetProperty().SetLineWidth(2);<BR>
XYRenderer.AddActor(actor);<BR>
XYRenderer.GetRenderWindow().Render();<BR></FONT>
</FONT><BR><BR> <BR>
<P align=center><FONT face="Lucida Handwriting, Cursive" color=#800000 size=4><STRONG>اللهم قدرني علي من ظلمني.....لأجعل عفوى عنه</STRONG></FONT></P>
<P align=center><FONT face="Lucida Handwriting, Cursive" color=#800000 size=4><STRONG>شكرا لك علي قدرتي عليه</STRONG></FONT></P><br /><hr />Need to know now? Get instant answers with Windows Live Messenger. <a href='http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008' target='_new'>IM on your terms.</a></body>
</html>