<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Nachricht</TITLE>
<META content="MSHTML 6.00.2716.2200" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=612383618-06092002>Be aware that some
of these solutions (including <FONT face="Times New Roman">VTK_QT solution by
</FONT><A href="http://wwwipr.ira.uka.de/~kuebler"><FONT face="Times New Roman"
color=#000000>Carsten Kübler</FONT></A><FONT face="Times New Roman">) have
issues with (will not display) 2D actors such as scalar bars and 2D
text.</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2>I created a render
widget by subclassing QWidget, then in the constructor doing something like what
is shown below. This has no problem with 2D stuff.
</FONT></SPAN></DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial
size=2>vtkRenderWidget::vtkRenderWidget( QWidget * parent, const char *
name,WFlags f )<BR>: QWidget(parent, name,f)
{<BR> this->setFocusPolicy(QWidget::StrongFocus);<BR> this->setMouseTracking(TRUE);<BR> this->setUpdatesEnabled(
FALSE
);<BR> this->setMinimumSize(QSize(300,300));<BR> this->InitRenderWindow();<BR>}</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2>void
vtkRenderWidget::InitRenderWindow() {<BR></FONT></SPAN></DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial
size=2> this->renderWindow = vtkRenderWindow::New();</FONT></SPAN></DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial
size=2> this->interactor =
vtkRenderWindowInteractor::New();<BR> this->interactor->SetRenderWindow(this->renderWindow);<BR></FONT></SPAN></DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial
size=2>}</FONT></SPAN></DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2>void
vtkRenderWidget::resizeEvent(QResizeEvent *event) {<BR> <BR> if
(!this->initNeeded)
<BR> this->renderWindow->Render();<BR> <BR>}</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2>void
vtkRenderWidget::paintEvent(QPaintEvent *event )<BR>{<BR> // Get the native
window ID and pass it<BR> // to the VTK render window<BR> // before we
render for the first time...<BR> if (this->initNeeded)
{<BR> WId nId =
winId();<BR> this->renderWindow->SetWindowId( (void*) nId
);<BR> this->interactor->Initialize();<BR> this->initNeeded
=
false;<BR> this->renderWindow->Render();<BR> <BR> }<BR> else
{<BR> this->renderWindow->Render();<BR> }<BR>}<BR>void
vtkRenderWidget::TimerFunc() {<BR> if( !
this->interactor->GetEnabled() ) {<BR> return
;<BR> }<BR> <BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::TimerEvent,NULL);<BR> }<BR> else<BR> {<BR> this->interactor->GetInteractorStyle()->OnTimer()
;<BR> }<BR> <BR> <BR>}</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2>void
vtkRenderWidget::mouseMoveEvent( QMouseEvent *event )
{<BR> <BR> // mTimer->start(10, TRUE) ;<BR> mX =
event->x() ;<BR> mY = event->y() ;<BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>= 1)<BR> {<BR>#if VTK_MAJOR_VERSION >=
4<BR>#if VTK_MINOR_VERSION >=
1<BR> this->interactor->SetEventInformationFlipY(<BR> event->x(),
<BR> event->y(), <BR> (event->state()
& ControlButton), <BR> (event->state() &
ShiftButton));<BR>#endif<BR>#endif<BR> if (!this->mouseInWindow
&& <BR> (event->x() >= 0 && event->x()
< this->geometry().width() && <BR> event->y()
>= 0 && event->y() <
this->geometry().height()))<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::EnterEvent,
NULL);<BR> this->mouseInWindow =
1;<BR> }<BR> <BR> if (this->mouseInWindow
&& <BR> (event->x() < 0 || event->x() >=
this->geometry().width() || <BR> event->y() < 0 ||
event->y() >=
this->geometry().height()))<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::LeaveEvent,
NULL);<BR> this->mouseInWindow =
0;<BR> }<BR> <BR> this->interactor->InvokeEvent(vtkCommand::MouseMoveEvent,
NULL);<BR> <BR> }<BR> else<BR> {<BR> if
(!this->mouseInWindow && <BR> (mX >= 0 &&
mX < this->geometry().width() && <BR> mY >= 0
&& mY <
this->geometry().height()))<BR> {<BR> this->interactor->GetInteractorStyle()->OnEnter(0,
0, <BR> mX, this->geometry().height() - mY -
1);<BR> <BR> this->mouseInWindow =
1;<BR> }<BR> <BR> if (this->mouseInWindow
&& <BR> (mX < 0 || mX >=
this->geometry().width() || <BR> mY < 0 || mY >=
this->geometry().height()))<BR> {<BR> this->interactor->GetInteractorStyle()->OnLeave(0,
0, <BR> mX, this->geometry().height() - mY -
1);<BR> <BR> this->mouseInWindow =
0;<BR> }<BR> this->interactor->GetInteractorStyle()->OnMouseMove(0,
0, <BR> mX, this->geometry().height() - mY - 1)
;<BR> <BR> }<BR> <BR> <BR>}</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2><BR>void
vtkRenderWidget::mousePressEvent( QMouseEvent *event )
{<BR> <BR> // mTimer->start(10, TRUE) ;<BR> mX =
event->x() ;<BR> mY = event->y() ;<BR> <BR>#if VTK_MAJOR_VERSION
>= 4<BR>#if VTK_MINOR_VERSION >= 1<BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->SetEventInformationFlipY(event->x(),
<BR> event->y(), <BR> (event->state()
& ControlButton), <BR> (event->state() &
ShiftButton));<BR> }<BR>#endif<BR>#endif
<BR> switch(event->button()) {<BR> case
LeftButton:<BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);<BR> }<BR> else<BR> {<BR> this->interactor->GetInteractorStyle()->OnLeftButtonDown(
(event->state() & ControlButton),
<BR> (event->state() & ShiftButton),
<BR> mX, this->geometry().height() - mY - 1 )
;<BR> }<BR> break ;<BR> case
MidButton:<BR> if (this->vtkVersionNumber->GetVTKMajorVersion()
>= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);<BR> }<BR> else<BR> {<BR> this->interactor->GetInteractorStyle()->OnMiddleButtonDown(
(event->state() & ControlButton),
<BR> (event->state() & ShiftButton),
<BR> mX, this->geometry().height() - mY -
1 ) ;<BR> }<BR> break ;<BR> case
RightButton:<BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);<BR> }<BR> else<BR> {<BR> this->interactor->GetInteractorStyle()->OnRightButtonDown(
(event->state() & ControlButton),
<BR> (event->state() & ShiftButton),
<BR> mX, this->geometry().height() - mY - 1 )
;<BR> }<BR> break;<BR> default:<BR> break
;<BR> }<BR> return ;<BR>}</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2><BR>void
vtkRenderWidget::mouseReleaseEvent( QMouseEvent *event )
{<BR> // mTimer->stop() ; <BR> <BR>#if VTK_MAJOR_VERSION
>= 4<BR>#if VTK_MINOR_VERSION >= 1<BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->SetEventInformationFlipY(event->x(),
<BR> event->y(), <BR> (event->state()
& ControlButton), <BR> (event->state() &
ShiftButton));<BR> }<BR>#endif<BR>#endif
<BR> switch(event->button()) <BR> {<BR> <BR> case
LeftButton:<BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL); <BR> }<BR> else<BR> {<BR> this->interactor->GetInteractorStyle()->OnLeftButtonUp(
(event->state() & ControlButton),
<BR> (event->state() & ShiftButton),
<BR> mX, this->geometry().height() - mY -
1 ) ;<BR> }<BR> break ;<BR> case
MidButton:<BR> if (this->vtkVersionNumber->GetVTKMajorVersion()
>= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::MiddleButtonReleaseEvent,NULL); <BR> }<BR> else<BR> {<BR> this->interactor->GetInteractorStyle()->OnMiddleButtonUp(
(event->state() & ControlButton),
<BR> (event->state() & ShiftButton),
<BR> mX, this->geometry().height() - mY - 1 )
;<BR> }<BR> <BR> break ;<BR> case
RightButton:<BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>=
1)<BR> {<BR> this->interactor->InvokeEvent(vtkCommand::RightButtonReleaseEvent,NULL); <BR> }<BR> else<BR> {<BR> this->interactor->GetInteractorStyle()->OnRightButtonUp(
(event->state() & ControlButton),
<BR> (event->state() & ShiftButton),
<BR> mX, this->geometry().height() - mY -
1 )
;<BR> }<BR> <BR> break;<BR> default:<BR> break
;<BR> }<BR> return ;<BR>}</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2><BR>void
vtkRenderWidget::keyPressEvent (QKeyEvent * event) {<BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>= 1)<BR> {<BR>#if VTK_MAJOR_VERSION >=
4<BR>#if VTK_MINOR_VERSION >=
1<BR> this->interactor->SetKeyEventInformation(event->state()
& ControlButton, <BR> event->state() & ShiftButton,
<BR> *key, <BR> event->count(),
<BR> "None");<BR> this->interactor->InvokeEvent(vtkCommand::KeyPressEvent,
NULL);<BR>#endif<BR>#endif<BR> }<BR> else<BR> {
<BR> this->interactor->GetInteractorStyle()->OnChar(
event->state() & ControlButton, <BR> event->state()
& ShiftButton, <BR> event->key(),
<BR> 1 ) ;<BR> }<BR> <BR>}</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=612383618-06092002><FONT face=Arial size=2><BR>void
vtkRenderWidget::keyReleaseEvent (QKeyEvent * event) {<BR> <BR> if
(this->vtkVersionNumber->GetVTKMajorVersion() >= 4
&&<BR> this->vtkVersionNumber->GetVTKMinorVersion()
>= 1)<BR> {<BR>#if VTK_MAJOR_VERSION >=
4<BR>#if VTK_MINOR_VERSION >=
1<BR> this->interactor->SetKeyEventInformation(event->state()
& ControlButton, <BR> event->state() & ShiftButton,
<BR> event->ascii(),
<BR> event->count(),
<BR> "None");<BR> this->interactor->InvokeEvent(vtkCommand::KeyReleaseEvent,
NULL);<BR>#endif<BR>#endif<BR> }<BR> else<BR> {<BR> this->interactor->GetInteractorStyle()->OnKeyUp(
event->state() & ControlButton, <BR> event->state()
& ShiftButton, <BR> event->key(), 1 )
;<BR> }<BR>}</DIV></FONT></SPAN>
<DIV>Ron Jerome</DIV>
<DIV>Institute for Chemical Process and </DIV>
<DIV>Environmental Technology</DIV>
<DIV>National Research Council Canada</DIV>
<DIV>613-993-5346</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader><FONT size=2>-----Original
Message-----<BR><B>From:</B> Stefan Bruckner
[mailto:stefan.bruckner@chello.at]<BR><B>Sent:</B> Friday, September 06, 2002
10:48 AM<BR><B>To:</B> vtkusers@public.kitware.com<BR><B>Subject:</B> Re:
[vtkusers] Re: Best vtk / QT package?<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=158284514-06092002>That should work.
I actually just saw the GetDataPointer() Method after I sent the last message.
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=158284514-06092002></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=158284514-06092002>I have not tried
stereo rendering yet ... you're having troubles with it,
ríght?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=158284514-06092002></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=158284514-06092002>--</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=158284514-06092002>Stefan
Bruckner</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left><FONT face=Tahoma
size=2>-----Ursprüngliche Nachricht-----<BR><B>Von:</B> Steffen Oeltze
[mailto:Steffen.Oeltze@Student.Uni-Magdeburg.DE] <BR><B>Gesendet:</B>
Freitag, 06. September 2002 16:20<BR><B>An:</B> Stefan
Bruckner<BR><B>Cc:</B> vtkusers@public.kitware.com<BR><B>Betreff:</B> Re:
[vtkusers] Re: Best vtk / QT package?<BR><BR></FONT></DIV>I have found a
convenient way in the meanwhile. When the user changes the rgb-values (the
scalar value keeps the same) of a point I simply use the function
addRGBValue(...). VTK internally replaces the old point by the new one. When
the user changes the scalar value I use the getDataPointer()-function which
returns a pointer to the transfer function and then, I manipulate the
function directly by replacing the scalar value each time the user moves a
slider. This is actually what I'm planing to do. I haven't implemented it
yet. <BR>I expect to be at most 10 points in my functions.<BR><BR>Have you
tried to enable a vtkQtRenderWindow for stereo rendering yet
?<BR><BR>Steffen<BR><BR><BR><BR><BR>Stefan Bruckner wrote:<BR>
<BLOCKQUOTE cite=mid:000901c255ae$6c569800$bc9fbad4@SID type="cite">
<META content="MSHTML 6.00.2713.1100" name=GENERATOR>
<DIV>
<DIV><SPAN class=229565113-06092002><FONT face=Arial size=2><FONT
face=Arial>What I did in the Java-Program is to simple store the function
currently displayed in the edior in an array. When the vtk window has to
be redrawn and the transfer function has been modified, I just create a
new vtkColorTransferFunction from the array. Although this is of course
not optimal, the overhead introduced is negligible, if node
counts don't get to high. How many nodes do you expect to be in your
functions?</FONT></FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT face=Tahoma><FONT size=2><SPAN
class=229565113-06092002> </SPAN>-----Ursprüngliche
Nachricht-----<BR><B>Von:</B> Steffen Oeltze [<A
class=moz-txt-link-freetext
href="mailto:Steffen.Oeltze@Student.Uni-Magdeburg.DE"><FONT
color=#000000>mailto:Steffen.Oeltze@Student.Uni-Magdeburg.DE</FONT></A>]
<BR><B>Gesendet:</B> Freitag, 06. September 2002 09:45<BR><B>An:</B>
Stefan Bruckner; VTK users<BR><B>Betreff:</B> Re: [vtkusers] Re: Best vtk
/ QT package?<BR><BR></FONT></FONT></FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>I have got
a question concerning the package you have mentioned. I'm using vtkqt by
Matthias Koenig which works fine except for the fact that I'm not able
to render stereo in his vtkQtRenderWindow. Calling the method
"StereoCapableOn()" results in an error. Could you please test for me if
this method works with the package you are using ?<BR><BR>A week ago I
downloaded your java-program to graphically edit a transfer function.
I'm trying to<BR>implement something similar using Qt. Unfortunately, I
encountered a problem concerning the<BR>editing of a
vtkColorTransferFunction. You can add a point to this function and
you can remove<BR>one but I couldn't find a method to modify an already
existing point. However, this is necessary<BR>for my application because
I want to enable the user to change the transfer function
interactively.<BR>The problem is that I don't want a new point to be
added each time the user changes the color<BR>but I want to modify the
recently added point. How did you manage this
?<BR><BR>Regards,<BR>Steffen<BR><BR>Stefan Bruckner wrote:<BR></FONT>
<BLOCKQUOTE cite=mid:1031257530.14474.14.camel@NANCY type="cite"><PRE wrap=""><FONT face=Arial size=2>I've examined nearly all of the packages out there, most of them are<BR>pretty outdated. The best and probably most current (VTK 4, QT 3) is<BR>VTK_QT by Carsten Kuebler. <BR><BR>Source is provided in an MS Visual Studio project, but I've managed to<BR>compile it under Linux within minutes without problems.<BR><BR>Download: <A class=moz-txt-link-freetext href="http://wwwipr.ira.uka.de/%7Ekuebler/vtkqt/index.html"><FONT color=#000000>http://wwwipr.ira.uka.de/~kuebler/vtkqt/index.html</FONT></A><BR><BR>--<BR>Stefan Bruckner<BR><BR><BR></FONT></PRE>
<BLOCKQUOTE type="cite"><PRE wrap=""><FONT face=Arial size=2>I am trying to get vtk and qt working properly.<BR><BR>Which is the best vtk/qt package available?<BR>Which has the best chance of being supported in the future?<BR>Which should I avoid altogether? (maybe too old to work with newer<BR>versions?)<BR><BR>I appreciate all help and opinions!<BR><BR>Thanks,<BR>Alex Lear<BR><BR>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at:<BR></FONT></PRE></BLOCKQUOTE><PRE wrap=""><!----><FONT face=Arial size=2><A class=moz-txt-link-rfc2396E href="http://public.kitware.com/cgi-bin/vtkfaq"><FONT color=#000000><http://public.kitware.com/cgi-bin/vtkfaq></FONT></A><BR></FONT></PRE>
<BLOCKQUOTE type="cite"><PRE wrap=""><FONT face=Arial size=2>Follow this link to subscribe/unsubscribe:<BR><A class=moz-txt-link-freetext href="http://public.kitware.com/mailman/listinfo/vtkusers"><FONT color=#000000>http://public.kitware.com/mailman/listinfo/vtkusers</FONT></A><BR></FONT></PRE></BLOCKQUOTE><PRE wrap=""><!----><FONT face=Arial size=2><BR><BR><BR><BR>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: <A class=moz-txt-link-rfc2396E href="http://public.kitware.com/cgi-bin/vtkfaq"><FONT color=#000000><http://public.kitware.com/cgi-bin/vtkfaq></FONT></A><BR>Follow this link to subscribe/unsubscribe:<BR><A class=moz-txt-link-freetext href="http://public.kitware.com/mailman/listinfo/vtkusers"><FONT color=#000000>http://public.kitware.com/mailman/listinfo/vtkusers</FONT></A><BR><BR></FONT></PRE></BLOCKQUOTE><FONT
face=Arial
size=2><BR></FONT></BLOCKQUOTE></DIV></BLOCKQUOTE><BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>