<!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">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Check.
Everything is allready there.<br>
<br>
In main:<br>
<br>
<font face="Courier New, Courier, monospace">KeyPressInteractorStyle
*kpis = KeyPressInteractorStyle::New();<br>
kpis-&gt;planeWidget = iPlane;</font><br>
<br>
while <font face="Courier New, Courier, monospace">iPlane </font>is
the interactivePlaneWidget2.<br>
<br>
And the <font face="Courier New, Courier, monospace">class </font>looks
like the one below, but still the line<br>
<br>
</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><font
 face="Courier New, Courier, monospace">vtkImplicitPlaneRepresentation*
rep = <font color="#ff0000"><b>planeWidget</b></font>-&gt;GetRepresentation();<br>
<br>
<font face="Helvetica, Arial, sans-serif">can't be interpreted: <br>
<br>
</font>error C2440: 'initializing' : cannot convert from
'vtkWidgetRepresentation *' to 'vtkImplicitPlaneRepresentation *'<br>
</font></font></font><br>
Am 15.03.2010 14:03, schrieb David Doria:
<blockquote
 cite="mid:c19fcadc1003150603q167081d1x67ab514179e98c2a@mail.gmail.com"
 type="cite">
  <div>On Mon, Mar 15, 2010 at 8:57 AM, Sebastian Gatzka <span
 dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:sebastian.gatzka@stud.tu-darmstadt.de">sebastian.gatzka@stud.tu-darmstadt.de</a>&gt;</span>
wrote:</div>
  <div class="gmail_quote">
  <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"><font size="-1"><font
 face="Helvetica, Arial, sans-serif">Somthing like
this? I'm not getting it ...<br>
    <br>
    <font face="Courier New, Courier, monospace">
    <div class="im">class
KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera<br>
{<br>
&nbsp; public:<br>
&nbsp;&nbsp;&nbsp; static KeyPressInteractorStyle* New();<br>
&nbsp;<br>
    </div>
&nbsp;&nbsp;&nbsp; <font color="#ff0000">vtkImplicitPlaneWidget2 *planeWidget;</font>
    <div class="im"><br>
    <br>
&nbsp;&nbsp;&nbsp; virtual void OnKeyPress() <br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //get the keypress<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor *rwi = this-&gt;Interactor;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::string key = rwi-&gt;GetKeySym();<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (key.compare("p") == 0)<br>
&nbsp;&nbsp;&nbsp; &nbsp; {<br>
    </div>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; vtkImplicitPlaneRepresentation* rep = <font color="#ff0000"><b>planeWidget</b></font>-&gt;GetRepresentation();<br>
    <br>
    <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; rep-&gt;SetNormal(1,0,0);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; planeWidget-&gt;SetRepresentation(rep);
    <div class="im"><br>
&nbsp;&nbsp;&nbsp; &nbsp; }<br>
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //handle an arrow key<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(key.compare("Up") == 0)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; "The up arrow was pressed." &lt;&lt; endl;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // forward events<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkInteractorStyleTrackballCamera::OnKeyPress();<br>
&nbsp;&nbsp;&nbsp; }<br>
    <br>
&nbsp;&nbsp;&nbsp; <br>
    </div>
};<br>
    <br>
    <font color="#ff0000"><b><font face="Helvetica, Arial, sans-serif">This
leads
to problems: The planeWidget inside the {}-brackets is unknown.</font></b></font><br>
    </font></font></font></div>
    <div bgcolor="#ffffff" text="#000000"><font size="-1"><font
 face="Helvetica, Arial, sans-serif"><font
 face="Courier New, Courier, monospace"><font color="#ff0000"><b><font
 face="Helvetica, Arial, sans-serif"><br>
    </font></b></font></font></font></font></div>
  </blockquote>
  <div><br>
  </div>
  <div><br>
  </div>
  <div><span class="Apple-style-span"
 style="font-family: 'Courier New',Courier,monospace; border-collapse: collapse;">
  <div class="im" style="color: rgb(80, 0, 80);">class
KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera<br>
{<br>
&nbsp;&nbsp;...<br>
  </div>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ff0000">vtkImplicitPlaneWidget2 *planeWidget;</font>
  <div class="im" style="color: rgb(80, 0, 80);"><br>
  <br>
&nbsp;&nbsp;&nbsp; virtual void OnKeyPress()&nbsp;<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //get the keypress<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor *rwi = this-&gt;Interactor;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::string key = rwi-&gt;GetKeySym();<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (key.compare("p") == 0)<br>
&nbsp;&nbsp;&nbsp; &nbsp; {<br>
  </div>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; vtkImplicitPlaneRepresentation* rep =&nbsp;<font color="#ff0000"><b>planeWidget</b></font>-&gt;GetRepresentation();<br>
  <br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; rep-&gt;SetNormal(1,0,0);<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//planeWidget-&gt;SetRepresentation(rep); you don't need
this, it is already set (since you just Got it)
  <div class="im" style="color: rgb(80, 0, 80);"><br>
&nbsp;&nbsp;&nbsp; &nbsp; }<br>
...<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
  </div>
};</span></div>
  <div><font class="Apple-style-span"
 face="'Courier New', Courier, monospace"><span class="Apple-style-span"
 style="border-collapse: collapse;"><br>
  </span></font></div>
  <div><font class="Apple-style-span"
 face="'Courier New', Courier, monospace"><span class="Apple-style-span"
 style="border-collapse: collapse;"><br>
  </span></font>int main(int argc, char *argv[])</div>
  <div>{</div>
  <div><span class="Apple-style-span"
 style="font-family: 'Courier New',Courier,monospace; border-collapse: collapse; color: rgb(80, 0, 80);">vtkSmartPointer&lt;KeyPressInteractorStyle&gt;
style =&nbsp;</span></div>
  <div><span class="Apple-style-span"
 style="font-family: 'Courier New',Courier,monospace; border-collapse: collapse; color: rgb(80, 0, 80);">vtkSmartPointer&lt;KeyPressInteractorStyle&gt;::New();</span></div>
  <div>&nbsp;...</div>
  <div>&nbsp;&nbsp;vtkSmartPointer&lt;vtkImplicitPlaneWidget2&gt; planeWidget =</div>
  <div>&nbsp;&nbsp; &nbsp; &nbsp;vtkSmartPointer&lt;vtkImplicitPlaneWidget2&gt;::New();</div>
  <div>&nbsp;&nbsp;planeWidget-&gt;SetInteractor(renderWindowInteractor);</div>
  <div><br>
  </div>
  <div>style.planeWidget = planeWidget;</div>
  <div>...</div>
  <div><br>
  </div>
  <div><br>
  </div>
  <div>You're definitely right that we need a tutorial on callback and
widgets and interactor subclasses - I'll get to it soon.</div>
  <div><br>
  </div>
Thanks,<br>
  <br>
David</div>
</blockquote>
</body>
</html>