Arnaud:<br><br>I just pushed a bunch of changes. The class vtkDistanceWidget, vtkAngleWidget and vtkBiDimensionalWidget all now have the following two methods :<br><br> // Description:<br> // Set the state of the widget to "defined" (in case its widget and its <br>
// representation were initialized programmatically). This must generally<br> // be followed by a Render() for things to visually take effect.<br> virtual void WidgetIsDefined();<br><br> // Description:<br> // Has the widget been defined completely yet ? ie. Have the end points been<br>
// laid and is it in Manipulate mode ?<br> virtual int IsWidgetDefined(); <br><br><br>So what you can do is :<br><br> representation->SetPoint1WorldPosition(...)<br> representation->SetPoint2WorldPosition(...)<br>
distanceWidget->SetRepresentation(representation);<br>
distanceWidget->EnabledOn();<br> distanceWidget->WidgetIsDefined();<br> distanceWidget->Render();<br>
<br>Internally, the WidgetIsDefined() call, sets the widget state to
"manipulate", releases any focus that it may have grabbed during the
define phase, builds the representation and shows/hides the handles
properly.<br>
<br>The same is the case for the other 2 widgets....<br><br>If I can slowly add it to a good number of widgets (several widgets have a "define" phase during which their query is invalid), then I'd like to make this a default no-op method in the base class, vtkAbstractWidget, so that subclasses can implement it in whatever way they choose to.<br>
<br>Please let me know if you have any issues.<br><br>Thanks<br>--<br>karthik<br><br><br><div class="gmail_quote">On Fri, Jul 16, 2010 at 12:38 AM, Karthik Krishnan <span dir="ltr"><<a href="mailto:karthik.krishnan@kitware.com" target="_blank">karthik.krishnan@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Yes. That's missing and its an often needed feature. I'll add this functionality in tomorrow Arnaud.<br>
<br>Thanks<br>--<br><font color="#888888">karthik</font><div><div></div><div><br><br><div class="gmail_quote">On Thu, Jul 15, 2010 at 7:37 PM, Arnaud GELAS <span dir="ltr"><<a href="mailto:arnaud_gelas@hms.harvard.edu" target="_blank">arnaud_gelas@hms.harvard.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Actually I am more interested in being able to reinitialize these
widgets.<br>
For instance, when you want to measure different objects that are far
apart, and I guess it would be faster to reinitialize the widget than
to drag these points to another part of my image (quite far from here).<br>
<br>
How should I proceed?<br>
<br>
Thanks,<br><font color="#888888">
Arnaud</font><div><div></div><div><br>
<br>
On 07/15/2010 09:56 AM, Karthik Krishnan wrote:
<blockquote type="cite">How can the widget exist in a valid state without its end
points ? Do you mean you want to re-define the widget from start in
response to a key press ?<br>
<br>
Please let us know.<br>
<br>
Thanks<br>
--<br>
karthik<br>
<br>
<div class="gmail_quote">On Thu, Jul 15, 2010 at 7:21 PM, Arnaud
GELAS <span dir="ltr"><<a href="mailto:arnaud_gelas@hms.harvard.edu" target="_blank">arnaud_gelas@hms.harvard.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi
all,<br>
<br>
I would like to be able to<br>
* delete points/handles from these widgets with a key<br>
* reinitialize these widgets without any points/handle on the screen.<br>
<br>
I could not figure out how to proceed?<br>
Is it possible with the existing code?<br>
<br>
Thanks,<br>
<br>
Best Regards,<br>
Arnaud<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote>
</div>
<br>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br>