#include "X3D_X3DComponentCreator.h" #include using namespace std; namespace X3DTK { namespace X3D { X3DComponentCreator::X3DComponentCreator() { } X3DComponentCreator::~X3DComponentCreator() { //delete the creation functions for (CreationDict::iterator it = _creationDict.begin(); it != _creationDict.end(); ++it) delete (*it).second; } CreationFunction *X3DComponentCreator::getCreationFunctionOf(const SFString &name) const { CreationDict::const_iterator it = _creationDict.find(name); if (it != _creationDict.end()) return (*it).second; return 0; } bool X3DComponentCreator::contains(const SFString &name) const { return (_creationDict.find(name) != _creationDict.end()); } void X3DComponentCreator::define(const std::pair &entry) { StringType st = entry.first; if (st.component != component->getName() || st.sceneGraph != component->getSceneGraphName()) { SFString sg; if (component->getSceneGraphName() != "") sg = " of the " + component->getSceneGraphName() + " scene graph"; cx3d << "warning: defineNode for " << st.type << " which doesn't belong to the " << component->getName() << " component" << sg << "," << std::endl; cx3d << " but to the " << st.component << " component" << std::endl; } _creationDict[st.type] = entry.second; } } }