<!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->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>->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"><<a moz-do-not-send="true"
href="mailto:sebastian.gatzka@stud.tu-darmstadt.de">sebastian.gatzka@stud.tu-darmstadt.de</a>></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>
public:<br>
static KeyPressInteractorStyle* New();<br>
<br>
</div>
<font color="#ff0000">vtkImplicitPlaneWidget2 *planeWidget;</font>
<div class="im"><br>
<br>
virtual void OnKeyPress() <br>
{<br>
//get the keypress<br>
vtkRenderWindowInteractor *rwi = this->Interactor;<br>
std::string key = rwi->GetKeySym();<br>
<br>
if (key.compare("p") == 0)<br>
{<br>
</div>
vtkImplicitPlaneRepresentation* rep = <font color="#ff0000"><b>planeWidget</b></font>->GetRepresentation();<br>
<br>
<br>
rep->SetNormal(1,0,0);<br>
planeWidget->SetRepresentation(rep);
<div class="im"><br>
}<br>
<br>
//handle an arrow key<br>
if(key.compare("Up") == 0)<br>
{<br>
cout << "The up arrow was pressed." << endl;<br>
}<br>
<br>
// forward events<br>
vtkInteractorStyleTrackballCamera::OnKeyPress();<br>
}<br>
<br>
<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>
...<br>
</div>
<font color="#ff0000">vtkImplicitPlaneWidget2 *planeWidget;</font>
<div class="im" style="color: rgb(80, 0, 80);"><br>
<br>
virtual void OnKeyPress() <br>
{<br>
//get the keypress<br>
vtkRenderWindowInteractor *rwi = this->Interactor;<br>
std::string key = rwi->GetKeySym();<br>
<br>
if (key.compare("p") == 0)<br>
{<br>
</div>
vtkImplicitPlaneRepresentation* rep = <font color="#ff0000"><b>planeWidget</b></font>->GetRepresentation();<br>
<br>
<br>
rep->SetNormal(1,0,0);<br>
//planeWidget->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>
}<br>
...<br>
<br>
<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<KeyPressInteractorStyle>
style = </span></div>
<div><span class="Apple-style-span"
style="font-family: 'Courier New',Courier,monospace; border-collapse: collapse; color: rgb(80, 0, 80);">vtkSmartPointer<KeyPressInteractorStyle>::New();</span></div>
<div> ...</div>
<div> vtkSmartPointer<vtkImplicitPlaneWidget2> planeWidget =</div>
<div> vtkSmartPointer<vtkImplicitPlaneWidget2>::New();</div>
<div> planeWidget->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>