#include "X3D_SimpleNodeCounter.h" #include "X3D_SimpleNodeCounterCoreVisitor.h" #include "X3D_SimpleNodeCounterStateVariables.h" #include using namespace std; namespace X3DTK { namespace X3D { SimpleNodeCounter::SimpleNodeCounter() : X3DOnePassProcessor() { setGraphTraversal(new DFSGraphTraversal()); setComponentVisitor(new SimpleNodeCounterCoreVisitor()); } SimpleNodeCounter::~SimpleNodeCounter() { Singleton::removeInstance(); } void SimpleNodeCounter::count(X3DNode *N) { Singleton::getInstance()->init(); traverse(N); cout << "number of nodes is " << Singleton::getInstance()->getNodeNumber() << endl; } } }