<!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 face="Helvetica, Arial, sans-serif" size="-1">Ok, and WHERE do I
have to set this<small> </small></font><font
face="Helvetica, Arial, sans-serif"><small>planeRepresentation member
variabel like you suggested?</small></font><br>
<br>
Am 12.03.2010 16:04, schrieb David Doria:
<blockquote
cite="mid:c19fcadc1003120704l1b42fc48sdc86a3336547795c@mail.gmail.com"
type="cite">
<pre wrap="">On Fri, Mar 12, 2010 at 6:58 AM, Sebastian Gatzka
<a class="moz-txt-link-rfc2396E" href="mailto:sebastian.gatzka@stud.tu-darmstadt.de"><sebastian.gatzka@stud.tu-darmstadt.de></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
Ok some updates: This is what I tried to change the widgets normal:
// Define interaction style
class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera
{
public:
static KeyPressInteractorStyle* New();
virtual void OnKeyPress()
{
//get the keypress
vtkRenderWindowInteractor *rwi = this->Interactor;
std::string key = rwi->GetKeySym();
if (key.compare("p") == 0)
{
planeRepresentation->SetNormal(1,0,0);
planeWidget->SetRepresentation(planeRepresentation);
}
//handle an arrow key
if(key.compare("Up") == 0)
{
cout << "The up arrow was pressed." << endl;
}
// forward events
vtkInteractorStyleTrackballCamera::OnKeyPress();
}
vtkImplicitPlaneWidget2 *planeWidget;
vtkImplicitPlaneRepresentation *planeRepresentation;
};
Results in a crash when setting the normal.
</pre>
</blockquote>
<pre wrap="">
You didn't show how you set the planeRepresentation member variable. I
wouldn't do it like this, I would simply set the planeWidget member
variable and then use:
vtkImplicitPlaneRepresentation* rep = planeWidget->GetRepresentation();
to do things to the representation.
Thanks,
David
</pre>
</blockquote>
</body>
</html>