在VTK中,默认交互模式允许通过单击r(重置)键将3D对象缩放到原始设置(例如1 )。我想知道有什么方法可以用编码来实现这个功能吗?我使用的是C# + ActiViz,但是C++代码也应该有帮助。
发布于 2013-12-05 20:56:01
在vtkInteractorStyle.cxx中,这是OnChar()函数中的相关代码:
case 'r' :
case 'R' :
this->FindPokedRenderer(rwi->GetEventPosition()[0],
rwi->GetEventPosition()[1]);
if(this->CurrentRenderer!=0)
{
this->CurrentRenderer->ResetCamera();
}
else
{
vtkWarningMacro(<<"no current renderer on the interactor style.");
}
rwi->Render();
break;来源:http://vtk.1045678.n5.nabble.com/Reset-Window-Level-Pressing-r-key-td5653790.html
https://stackoverflow.com/questions/20409835
复制相似问题