문제

In VTK, the default interaction mode allows the use to scale the 3D object to the original settings, say 1, by clicking the r (reset) key. I am wondering is there any way to implement this functionality using coding? I am using C# + ActiViz, but C++ code should also help.

도움이 되었습니까?

해결책

In vtkInteractorStyle.cxx this is the relevant code in the OnChar() function:

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;

Source: http://vtk.1045678.n5.nabble.com/Reset-Window-Level-Pressing-r-key-td5653790.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top