<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
DIV.FoxDiv20120424162653249114 {
        COLOR: #000000
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 微软雅黑; COLOR: #000080; FONT-SIZE: 10.5pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 9.00.8112.16443"></HEAD>
<BODY style="MARGIN: 10px">
<DIV>For testing, i move the operation to right button menu, and just
use [actor->RotateX(30.0)]. But the result was the same, after i clicked the
rightButton menu , the render window show nothing. Besides, i tried another
test, i changed my data source to vtkConeSource , it runs Ok. My
former data source was :</DIV>
<DIV>
<DIV> vtkPolyData *linesPolyData = vtkPolyData::New();</DIV>
<DIV> linesPolyData->SetPoints(Points);</DIV>
<DIV> linesPolyData->SetLines(lines);</DIV></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>qlizhi</SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<DIV
style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND: #efefef; COLOR: #000000; FONT-SIZE: 12px; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:darshanpai@gmail.com">Darshan
Pai</A></DIV>
<DIV><B>Date:</B> 2012-04-24 00:14</DIV>
<DIV><B>To:</B> <A href="mailto:qlizhi@gmail.com">qlizhi</A></DIV>
<DIV><B>CC:</B> <A href="mailto:vtkusers@vtk.org">vtkusers</A></DIV>
<DIV><B>Subject:</B> Re: Re: [vtkusers] question about
vtkCommand</DIV></DIV></DIV>
<DIV>
<DIV class=FoxDiv20120424162653249114>
<DIV class=gmail_extra>One more question . Are you calling Render() in the
thread or the main program ?<BR><BR>
<DIV class=gmail_quote>On Mon, Apr 23, 2012 at 12:12 PM, Darshan Pai <SPAN
dir=ltr><<A href="mailto:darshanpai@gmail.com"
target=_blank>darshanpai@gmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV class=gmail_extra>I meant to not use SetOrientation at all and instead
use the Transform or the matrix <BR>
<DIV>
<DIV class=h5><BR>
<DIV class=gmail_quote>On Mon, Apr 23, 2012 at 3:50 AM, qlizhi <SPAN
dir=ltr><<A href="mailto:qlizhi@gmail.com"
target=_blank>qlizhi@gmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><U></U>
<DIV style="MARGIN: 10px">
<DIV>i have tried SetUserMatrix() , the result is the same. it seems
that after [actor->SetOrientation(ori)] the actor lost its data
source, so it render nothing.</DIV>
<DIV> </DIV>
<HR style="MIN-HEIGHT: 1px; WIDTH: 210px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>qlizhi</SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<DIV
style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND: #efefef; FONT-SIZE: 12px; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:darshanpai@gmail.com"
target=_blank>Darshan Pai</A></DIV>
<DIV><B>Date:</B> <A href="tel:2012-04-23%C2%A012" target=_blank
value="+12012042312">2012-04-23 12</A>:42</DIV>
<DIV><B>To:</B> <A href="mailto:qlizhi@gmail.com"
target=_blank>qlizhi</A></DIV>
<DIV><B>CC:</B> <A href="mailto:daviddoria@gmail.com"
target=_blank>David Doria</A>; <A href="mailto:vtkusers@vtk.org"
target=_blank>vtkusers</A></DIV>
<DIV>
<DIV>
<DIV><B>Subject:</B> Re: [vtkusers] question about
vtkCommand</DIV></DIV></DIV></DIV></DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV class=gmail_extra>Why not try using SetUserTransform() or
SetUserMatrix()<BR><BR>
<DIV class=gmail_quote>On Mon, Apr 23, 2012 at 12:32 AM, qlizhi <SPAN
dir=ltr><<A href="mailto:qlizhi@gmail.com"
target=_blank>qlizhi@gmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><U></U>
<DIV style="MARGIN: 10px">
<DIV>
<DIV>Thanks for <SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 14px/18px Arial; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">reply:</SPAN></DIV>
<DIV style="TEXT-INDENT: 2em"><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 14px/18px Arial; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px"> here
is my main code, and if i use [<FONT color=#000080
face=微软雅黑>window->Render()], there will be an
error:</FONT></SPAN></DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 14px/18px Arial; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">
<DIV
style="TEXT-INDENT: 2em">ERROR: In D:\Program Files (x86)\VTK 5.8.0\VTK\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 247</DIV>
<DIV
style="TEXT-INDENT: 2em">vtkWin32OpenGLRenderWindow (06DFC0B0): wglMakeCurrent failed in MakeCurrent(), error: <SPAN
style="TEXT-ALIGN: justify; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: small/19px palatino,georgia,verdana,arial,sans-serif; WHITE-SPACE: normal; FLOAT: none; COLOR: rgb(34,34,34); WORD-SPACING: 0px">The
requested resource is in use.</SPAN></DIV>
<DIV style="TEXT-INDENT: 2em"> </DIV></SPAN></DIV>
<DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 14px/18px Arial; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px"></SPAN>
<DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 14px/18px Arial; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">
<DIV>void CupGeologyView::addInternetEvent( vtkActor *actor, vtkRenderWindow *window)</DIV>
<DIV>{</DIV>
<DIV>/*actor->SetOrientation(27.0, 27.0, 27.0);*/</DIV>
<DIV>internetEvent = new cupVtkUserInternetEvent;</DIV>
<DIV>QThread * thread = new QThread(this);</DIV>
<DIV>internetEvent->moveToThread(thread);</DIV>
<DIV>connect(ui.allowInternetEvent, SIGNAL(triggered()), internetEvent, SLOT(init()));</DIV>
<DIV>thread->start();</DIV>
<DIV> </DIV>
<DIV>CupRemoteModelCallback *mo1 = CupRemoteModelCallback::New();</DIV>
<DIV>mo1->actor = actor;</DIV>
<DIV>mo1->window = window;</DIV>
<DIV>internetEvent->AddObserver(vtkCommand::UserEvent,mo1);</DIV>
<DIV>mo1->Delete();</DIV>
<DIV>}</DIV>
<DIV> </DIV></SPAN></DIV>
<DIV>void CupRemoteModelCallback::Execute( vtkObject *caller, unsigned long eventId, void *callData )</DIV>
<DIV>{</DIV>
<DIV>cupVtkUserInternetEvent *internetEvent = reinterpret_cast<cupVtkUserInternetEvent *>(caller);</DIV>
<DIV>if (eventId = vtkCommand::UserEvent)</DIV>
<DIV>{</DIV>
<DIV>if (actor!= NULL && window != NULL)</DIV>
<DIV>{</DIV>
<DIV>//to-do</DIV>
<DIV>int* xyz = (int*)callData;</DIV>
<DIV>double ori[3];</DIV>
<DIV>ori[0] = xyz[0];</DIV>
<DIV>ori[1] = xyz[1];</DIV>
<DIV>ori[2] = xyz[2];</DIV>
<DIV>actor->SetOrientation(ori);</DIV>
<DIV>/*window->Render();*/</DIV>
<DIV>} </DIV>
<DIV>}</DIV>
<DIV>}</DIV></DIV>
<DIV> </DIV>
<HR style="MIN-HEIGHT: 1px; WIDTH: 210px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>qlizhi</SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<DIV
style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND: #efefef; FONT-SIZE: 12px; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:daviddoria@gmail.com"
target=_blank>David Doria</A></DIV>
<DIV><B>Date:</B> <A href="tel:2012-04-22%C2%A021" target=_blank
value="+12012042221">2012-04-22 21</A>:53</DIV>
<DIV><B>To:</B> <A href="mailto:qlizhi@gmail.com"
target=_blank>qlizhi</A></DIV>
<DIV><B>CC:</B> <A href="mailto:vtkusers@vtk.org"
target=_blank>vtkusers</A></DIV>
<DIV><B>Subject:</B> Re: [vtkusers] question about
vtkCommand</DIV></DIV></DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV class=gmail_extra>
<DIV class=gmail_quote>2012/4/22 qlizhi <SPAN dir=ltr><<A
href="mailto:qlizhi@gmail.com"
target=_blank>qlizhi@gmail.com</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><U></U>
<DIV style="MARGIN: 10px">
<DIV> </DIV>
<DIV>hi, all!</DIV>
<DIV style="TEXT-INDENT: 2em">i write a subclass of vtkCommand, and in
its function Execute(), i try to change an actor's Orientation by
code [actor->SetOrientation(ori)].</DIV>
<DIV>I made breakPoint on that line, it runs. But
the renderWindow show nothing. Can anybody tell me
why?</DIV>
<DIV style="TEXT-INDENT: 2em">Sorry for my poor english!</DIV>
<HR style="MIN-HEIGHT: 1px; WIDTH: 210px" align=left color=#b5c4df
SIZE=1>
<SPAN><FONT color=#888888>
<DIV><SPAN>qlizhi</SPAN></DIV></FONT></SPAN></DIV></BLOCKQUOTE>
<DIV>Did you call renderWindow->Render()? You'll probably have to make
us an as-small-as-possible code sample so we can see exactly what you're
doing.</DIV><BR>David<BR></DIV></DIV></DIV></DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>Powered
by <A href="http://www.kitware.com"
target=_blank>www.kitware.com</A><BR><BR>Visit other Kitware open-source
projects at <A 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
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
href="http://www.vtk.org/mailman/listinfo/vtkusers"
target=_blank>http://www.vtk.org/mailman/listinfo/vtkusers</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BODY></HTML>