Also reduce the number of global variables as much as possible. Other nodes must be declared as instance variables in the header file and instantiated in the constructor. The constructor should take the global scene graph as argument, store a pointer to it, and add the object's local scene graph to the global one. The destructor should remove the object's local scene graph. Upon first construction of an object of this type, instantiate the geometry nodes.
Global variables become static data members of classes.
For example, the Combat game maintains a global list of all the ships in the game. Here it is a private data member, and the accessor function returns a copy of the list. The GameRegion class in Combat dictates the size of the playable region and where the ground plane is, and provides convenience routines for placing a ship in a random position. It contains all of its information in static member variables, and is never instantiated. It's probably better to strive for generality in large applications.