<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Karthik,<br>
<br>
Thanks! your example works fine, however that was not what I had
meant...<br>
<br>
I would like to reinitialize the widget, i.e. Once I make one
measurement (as it is now in the example), I would like to be able to
make another measurement without having to drag and drop the two nodes
(after calling one method) I can click on the screen. <br>
<br>
Can you drive me how to proceed, please?<br>
<br>
I could not find the way to remove the two points from the scene...<br>
<br>
<br>
Thanks,<br>
Arnaud<br>
<br>
<br>
On 07/20/2010 01:47 PM, Karthik Krishnan wrote:
<blockquote
 cite="mid:AANLkTimdNKYmVe4Did3cVwMzmh5m7H2qj6S7VgQeAYgN@mail.gmail.com"
 type="cite">Arnaud:<br>
  <br>
The attached example works. <br>
  <br>
Please make sure you "git pull" now. I just fixed a bug (thanks to your
use case) when the widget is defined prior to enabling it. <br>
  <br>
I rearranged a few lines in your example code, (removed the
interactor-&gt;Start() being called twice etc, added a prop so the
camera doesn't go out of whack), nothing significant.<br>
  <br>
--------<br>
&nbsp; commit d832206da3502f395281e447e28305d11ff301c6<br>
&nbsp; Author: Karthik Krishnan &lt;<a moz-do-not-send="true"
 href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>&gt;<br>
&nbsp; Date:&nbsp;&nbsp; Tue Jul 20 23:10:00 2010 +0530<br>
  <br>
&nbsp; &nbsp; &nbsp; ENH: The interactor must be set before enabling the widget.<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When the method WidgetIsDefined() is called (ie the widget is
defined<br>
&nbsp;&nbsp; &nbsp;&nbsp; programmatically) and then the method SetEnabled is invoked, we
run<br>
&nbsp; &nbsp; &nbsp; into a bug, in that the internal HandleWidgets are enabled without<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; having their interactors set. Hence propagate the interactor from
self<br>
&nbsp;&nbsp; &nbsp;&nbsp; into the child widgets always.<br>
---------<br>
  <br>
Thanks for the feedback.<br>
--<br>
karthik<br>
  <br>
  <br>
  <div class="gmail_quote">On Tue, Jul 20, 2010 at 9:52 PM, Arnaud
GELAS <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:arnaud_gelas@hms.harvard.edu">arnaud_gelas@hms.harvard.edu</a>&gt;</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">Hi Karthik,<br>
    <br>
Thanks for looking at it!<br>
    <br>
I have been trying it (by modifying the example from the wiki), but
it's still not clear to me what has changed in the behaviour of the
window? and how to "reinitialize the widget"?<br>
I guess I may have made mistakes in the code. Can you have a look and
tell me what I am doing wrong, please?<br>
    <br>
Thanks,<br>
    <font color="#888888">Arnaud</font>
    <div>
    <div class="h5"><br>
    <br>
    <br>
On 07/19/2010 02:44 PM, Karthik Krishnan wrote:
    <blockquote type="cite">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>
&nbsp; // Description:<br>
&nbsp; // Set the state of the widget to "defined" (in case its widget and
its <br>
&nbsp; // representation were initialized programmatically). This must
generally<br>
&nbsp; // be followed by a Render() for things to visually take effect.<br>
&nbsp; virtual void WidgetIsDefined();<br>
      <br>
&nbsp; // Description:<br>
&nbsp; // Has the widget been defined completely yet ? ie. Have the end
points been<br>
&nbsp; // laid and is it in Manipulate mode ?<br>
&nbsp; virtual int IsWidgetDefined(); <br>
      <br>
      <br>
So what you can do is :<br>
      <br>
&nbsp;representation-&gt;SetPoint1WorldPosition(...)<br>
&nbsp;representation-&gt;SetPoint2WorldPosition(...)<br>
&nbsp;distanceWidget-&gt;SetRepresentation(representation);<br>
&nbsp;distanceWidget-&gt;EnabledOn();<br>
&nbsp;distanceWidget-&gt;WidgetIsDefined();<br>
&nbsp;distanceWidget-&gt;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">&lt;<a moz-do-not-send="true"
 href="mailto:karthik.krishnan@kitware.com" target="_blank">karthik.krishnan@kitware.com</a>&gt;</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><br>
        <br>
        <div class="gmail_quote">On Thu, Jul 15, 2010 at 7:37 PM,
Arnaud
GELAS <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:arnaud_gelas@hms.harvard.edu" target="_blank">arnaud_gelas@hms.harvard.edu</a>&gt;</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><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">&lt;<a moz-do-not-send="true"
 href="mailto:arnaud_gelas@hms.harvard.edu" target="_blank">arnaud_gelas@hms.harvard.edu</a>&gt;</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>
&nbsp;* delete points/handles from these widgets with a key<br>
&nbsp;* 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 moz-do-not-send="true" href="http://www.kitware.com"
 target="_blank">www.kitware.com</a><br>
              <br>
Visit other Kitware open-source projects at <a moz-do-not-send="true"
 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
 moz-do-not-send="true" 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 moz-do-not-send="true"
 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>
    </blockquote>
    <br>
    </div>
    </div>
    </div>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
</body>
</html>