<div dir="ltr">I just tried replacing my vtkAnnotatedCube with vtkAxesActor. It works fine as expected!<br><br>So the vtkAxesActor is not to be blamed.<br><br>There seem to be some problem with your code.<br><br>Do you have all the headers included?<br>
<br>Can you create a compilable example of your problem?<br><br>Jothy<br><br><div class="gmail_quote">On Fri, Apr 13, 2012 at 9:32 PM, bnsteel <span dir="ltr"><<a href="mailto:bnsteel@gmail.com">bnsteel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hello,<br>
<br>
I have been unsuccessful in using a vtkAxesActor in my application. And<br>
wonder if there is some limitation that is not documented.<br>
<br>
I have followed the tutorials to use both the Testing_Data_Bunny.vtp<br>
iconActor in the orientation widget and the sphere<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes</a><br>
<br>
My bunny showed up and worked fine, but when I swapped the bunny for the<br>
vtkAxesActor as the orientation marker, I get a crash. I have created a C++<br>
dll that I am calling from a c# application. I pass the handle of my render<br>
window to the C++ class that handles the 3D data and vtk setup. Everything<br>
is working just fine except the axes actor!<br>
<br>
// axesWidget declared as<br>
vtkSmartPointer<vtkOrientationMarkerWidget> in .h<br>
axesWidget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();<br>
vtkSmartPointer<vtkAxesActor> axes = vtkSmartPointer<vtkAxesActor>::New();<br>
// tried with and without label and text property setup here<br>
as in tutorials<br>
axesWidget->SetOrientationMarker(axes); // works fine if<br>
this is iconActor<br>
axesWidget->SetOutlineColor( 0.93, 0.57, 0.13 );<br>
axesWidget->SetInteractor(renWin->GetInteractor());<br>
axesWidget->SetViewport(0.0, 0.0, 0.25, 0.25);<br>
axesWidget->EnabledOn();<br>
axesWidget->InteractiveOff();<br>
renWin->Render();<br>
<br>
Everything is fine until I try to render. Then I get the standard error<br>
message about reading or writing restricted memory.<br>
<br>
To simplify things, I try to just add a vtkAxesActor actor to my test<br>
window:<br>
<br>
// added cone actor as in examples<br>
vtkSmartPointer<vtkAxesActor> axes = vtkSmartPointer<vtkAxesActor>::New();<br>
renderer->AddActor(axes); // comment out this line == no crash<br>
renWin->Render();<br>
<br>
Again, it crashes when I try to render. If I just don't add the<br>
vtkAxesActor to the orientation marker or the renderer, everything is fine.<br>
<br>
The flow of my code is as follows:<br>
<br>
Using a panel, m_panel, create a RenderWindowCotnrol Object as in Activiz<br>
// C#<br>
m_RenderWindow = Kitware.VTK.vtkRenderWindow.New();<br>
m_RenderWindowInteractor = Kitware.VTK.vtkRenderWindowInteractor.New();<br>
<br>
Kitware.VTK.vtkInteractorStyleSwitch style =<br>
this.m_RenderWindowInteractor.GetInteractorStyle()<br>
as Kitware.VTK.vtkInteractorStyleSwitch;<br>
<br>
if (null != style) style.SetCurrentStyleToTrackballCamera();<br>
<br>
m_RenderWindow.SetInteractor(this.m_RenderWindowInteractor);<br>
m_RenderWindow.SetParentId(m_panel.Handle);<br>
<br>
// then send handle of render window to C++ object using SWIG object test3d<br>
test3d.setRenderWindow(RenderWindow.GetCppThis());<br>
<br>
// in C++<br>
<br>
void setRenderWindow(vtkRenderWindow *theWin){<br>
renWin = theWin;<br>
renderer = vtkSmartPointer<vtkRenderer>::New();<br>
renWin->AddRenderer(renderer);<br>
initWidgets(); // set up vtkOrientationMarkerWidge<br>
testAddActors(); // create cone actor, add to renderer, and then try to<br>
render.<br>
}<br>
<br>
Is there anything that I am doing wrong? Everything compiles fine. I have<br>
included vtkAxesActor.h and linked to vtkHybrid.lib and vtkWidget.lib. It<br>
did work just fine when I was using ActiviZ in C#, but it was too expensive<br>
to move my 3D data from C++ where it is processed into C# for display. I<br>
thought it would be better to handle the data in C++ and just use C# for the<br>
GUI. The 3D is only a small portion of the main Application<br>
<br>
Please let me know what additional information would help understand why the<br>
renderer doesn't like vtkAxesActor .<br>
<br>
Brooke<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/limitations-using-vtkAxesActor-tp5639488p5639488.html" target="_blank">http://vtk.1045678.n5.nabble.com/limitations-using-vtkAxesActor-tp5639488p5639488.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<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>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>