1 |
|
|
// Copyright 2011, 2012, Florent Lamiraux, LAAS-CNRS. |
2 |
|
|
|
3 |
|
|
#include <dynamic-graph/entity.h> |
4 |
|
|
#include <dynamic-graph/pool.h> |
5 |
|
|
|
6 |
|
|
#include <vector> |
7 |
|
|
|
8 |
|
|
#include "dynamic-graph/python/dynamic-graph-py.hh" |
9 |
|
|
|
10 |
|
|
namespace dynamicgraph { |
11 |
|
|
namespace python { |
12 |
|
|
|
13 |
|
|
namespace pool { |
14 |
|
|
|
15 |
|
|
void writeGraph(const char* filename) { |
16 |
|
|
PoolStorage::getInstance()->writeGraph(filename); |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
const std::map<std::string, Entity*>* getEntityMap() { |
20 |
|
|
return &PoolStorage::getInstance()->getEntityMap(); |
21 |
|
|
} |
22 |
|
|
|
23 |
|
|
/** |
24 |
|
|
\brief Get list of entities |
25 |
|
|
*/ |
26 |
|
|
bp::list getEntityList() { |
27 |
|
|
std::vector<std::string> entityNames; |
28 |
|
|
bp::list res; |
29 |
|
|
const PoolStorage::Entities& listOfEntities = |
30 |
|
|
PoolStorage::getInstance()->getEntityMap(); |
31 |
|
|
|
32 |
|
|
for (const auto& el : listOfEntities) res.append(el.second->getName()); |
33 |
|
|
return res; |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
} // namespace pool |
37 |
|
|
} // namespace python |
38 |
|
|
} // namespace dynamicgraph |