Ejemplo n.º 1
0
            void TreeNodeVisitor::visit(SceneNode *n) {
                if (m_root != NULL) {
                    if (n != NULL) {
                        SceneNodeDescriptor snd = n->getSceneNodeDescriptor();
                        if (snd.getName().size() > 0) {
                            if (!m_renderingConfiguration.hasSceneNodeDescriptor(snd)) {
                                // Enable the node described by this NodeDescriptor for rendering by default.
                                SceneNodeRenderingConfiguration snrc;
                                snrc.setParameter(SceneNodeRenderingConfiguration::ENABLED, true);
                                m_renderingConfiguration.setSceneNodeRenderingConfiguration(snd, snrc);

                                // Add NodeDescriptor to selectable list.
                                TreeNode<SelectableNodeDescriptor> *element = new TreeNode<SelectableNodeDescriptor>();
                                element->setValue(SelectableNodeDescriptor(snd, snrc.hasParameter(SceneNodeRenderingConfiguration::ENABLED)));
                                m_root->addChild(element);
                            }
                        }
                    }
                }
            }
 bool SceneNodeDescriptorComparator::operator()(const SceneNodeDescriptor &snd1, const SceneNodeDescriptor &snd2) const {
     return snd1.getName().compare(snd2.getName()) < 0;
 }