<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 class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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="WIDTH:210px;min-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-right:8px;padding-left:8px;padding-top:8px;font-size:12px;background:#efefef;padding-bottom: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" value="+12012042312" target="_blank">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" value="+12012042221" target="_blank">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>