Skip to content

Commit

Permalink
Add method to retrieve all nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-moreno committed Sep 19, 2023
1 parent 4e89cef commit d9e08ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/rogue/interfaces/api/Bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define __ROGUE_INTERFACE_API_BSP_H__
#include <boost/python.hpp>
#include <vector>
#include <iostream>

namespace rogue {
namespace interfaces {
Expand All @@ -26,6 +27,7 @@ namespace api {
//! Bsp Class
class Bsp {
protected:
//boost::python::list _node_list;
boost::python::object _obj;
bool _isRoot;
std::string _name;
Expand Down Expand Up @@ -75,6 +77,9 @@ class Bsp {

//! Read and get
std::string readGet();

//! Get all nodes in tree
boost::python::list nodeList();
};

typedef std::shared_ptr<rogue::interfaces::api::Bsp> BspPtr;
Expand Down
6 changes: 6 additions & 0 deletions src/rogue/interfaces/api/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,9 @@ std::string ria::Bsp::readGet() {
throw(rogue::GeneralError::create("Bsp::set", "Error getting value on node %s", this->_name.c_str()));
}
}


boost::python::list ria::Bsp::nodeList() {
// Retrieve a python list of all nodes in the root tree.
return static_cast<boost::python::list>(this->_obj.attr("nodeList"));
}

0 comments on commit d9e08ea

Please sign in to comment.