get matrix in open inventor?

I want to retrieve the cumulative matrix within the scene graph. Say, after several transformations and before the objects drawing, I want to know what’s the exact position in the world coordniate system.
Use SoGetMatrixAction or other functions?
Some simple code will be greatly appreciated.