[vtkusers] VTK ActiViz to reset object to original view
alethea
alethea at anatomage.com
Wed Dec 4 18:49:12 EST 2013
It looks like you are using a vtkOrientationMarkerWidget. I am not familiar
with this widget, but after a glance at the code, it looks like the
Orientation Prop must be set before enabling the widget. From what you
posted, I assume the widget has already been enabled by the time you call
your "resetview". Perhaps try calling widget.Off(), then
widget.SetOrientationMarker(axes), then widget.On().
nickxtsui wrote
> Seems not working still.
>
> On Tue, Dec 3, 2013 at 3:35 PM, alethea <
> alethea@
> > wrote:
>> Have you tried setting axes.Modified()?
>> I've found you have to call this after setting the user matrix to tell
>> the
>> pipeline to recompute.
>>
>>
>> nickxtsui wrote
>>> I am trying to reset the 3D object to its original view (something
>>> orthogonal, sagital, say) after its interaction.
>>>
>>> Here is my code how I try to reset, unsuccessful though:
>>>
>>> private vtkAxesActor axes;
>>> private vtkOrientationMarkerWidget widget;
>>>
>>> public void ResetView()
>>> {
>>> // axes.InitPathTraversal();
>>> if (axes != null)
>>> {
>>> if (axes.GetUserMatrix() != null)
>>> axes.GetUserMatrix().Identity();
>>> axes.GetMatrix().Identity();
>>> axes.SetOrigin(0,0,0);
>>> axes.SetOrientation(0, 0, 0);
>>> axes.SetScale(1, 1, 1);
>>> axes.SetPosition(0, 0, 0);
>>> }
>>>
>>> if (widget != null)
>>> {
>>> widget.SetOrientationMarker(axes);
>>> }
>>>
>>>
>>> ForceWindowToRender();
>>> }
>>>
>>> How should I do this? Thanks a lot.
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/VTK-ActiViz-to-reset-object-to-original-view-tp5724801p5724805.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-ActiViz-to-reset-object-to-original-view-tp5724801p5724845.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list