<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:tahoma,new york,times,serif;font-size:10pt"><div>Hi,<br><br>I need to save and load some widgets (distance widget, angle widget, etc...). I cannot find a way to create and place these widgets programmatically. Look at that example (for distance widget):<br><br><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">vtkDistanceWidget *widget = vtkDistanceWidget::New();</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">widget-&gt;SetInteractor(Interactor);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">vtkPointHandleRepresentation2D *handle
 = vtkPointHandleRepresentation2D::New();</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">handle-&gt;GetProperty()-&gt;SetColor(1, 0, 0);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">vtkDistanceRepresentation2D *rep = vtkDistanceRepresentation2D::New();</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">rep-&gt;SetHandleRepresentation(handle);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> rep-&gt;GetAxis()-&gt;SetNumberOfMinorTicks(4);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span
 style="font-family: Courier New,courier,monaco,monospace,sans-serif;">rep-&gt;GetAxis()-&gt;SetTickLength(9);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">rep-&gt;GetAxis()-&gt;SetTitlePosition(0.2);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">widget-&gt;SetRepresentation(rep);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">widget-&gt;On();</span><br><br>I have tried to place the points manually with a code like the following:<br><br><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">double pos1[3] = { ......., 0 }, pos2[3] = { ......, 0 };</span><br><span style="font-family: Courier
 New,courier,monaco,monospace,sans-serif;">rep-&gt;SetPoint1DisplayPosition(pos1);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">rep-&gt;SetPoint2DisplayPosition(pos2);</span><br><br>but nothing happen. What I have to do?<br><br>Many thanks in advance,<br><br>- AGPX<br></div></div><br>



      </body></html>