usata-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Usata-commits] Changes to usata2/src/scene-manager.cpp


From: David Lau
Subject: [Usata-commits] Changes to usata2/src/scene-manager.cpp
Date: Mon, 03 Jan 2005 03:06:14 -0500

Index: usata2/src/scene-manager.cpp
diff -u usata2/src/scene-manager.cpp:1.5 usata2/src/scene-manager.cpp:1.6
--- usata2/src/scene-manager.cpp:1.5    Sun Jan  2 06:01:19 2005
+++ usata2/src/scene-manager.cpp        Mon Jan  3 07:43:49 2005
@@ -10,11 +10,12 @@
 // included in the software distribution, or visit
 // http://www.fsf.org/licenses/gpl.html.
 //
-// $Id: scene-manager.cpp,v 1.5 2005/01/02 06:01:19 skunix Exp $
+// $Id: scene-manager.cpp,v 1.6 2005/01/03 07:43:49 skunix Exp $
 
 #include "scene-manager.hpp"
 #include <boost/bind.hpp>
 #include <map>
+#include <iostream>
 namespace
 usata
 {
@@ -111,20 +112,30 @@
 {
 
 }
+
+
+
+void 
+SceneManager::add_child(const Object_sp& x)
+{
+       std::cout << "added " << x->name() << std::endl;
+       impl->add(x);
+       x->parent(this);
+       return;
+}
 void 
 SceneManager::add_child(const Object_sp& pObj, std::string& path)
 {
+       if (path.empty())
+       {
+               impl->add(pObj);
+               return;
+       }
+
        std::string cpy(path);
        std::string     
        name=NodeInterface::NodePathPop(cpy);
        
-       if (cpy.empty()) // if cpy is empty, this is the end of the path
-       {
-               int result = impl->add(pObj);
-               //! \todo check result, throw if invalid name, warn if dup
-               result=result;
-               return;
-       }
        Object *child = impl->lookup_ptr(name);
        if (child == 0)
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]