How can I call Slicer.util.getNode function in cpp code?

Hello,everyone:
We can get node using Slicer.util.getNode in python console and scripted extensions.But how can I call this function in cpp code?
I want to call the qMRMLThreeDView.resetFocalPoint when I click the Display 3D button to make the 3D model be in the center of the 3D view.


In other words,how can I get the threeDView node in cpp code?
Any help will be appreciated.

The python api is mostly just a layer on top f the C++ code so you can do the same things. Have a look at the python implementation and you can map it to the corresponding C++.

1 Like