char *phyloNodeNames(struct phyloTree *tree) /* add all the node names to a dy string */ { struct dyString *ds = newDyString(0); nodeNames(tree, ds); ds->string[ds->stringSize-1]=0; return ds->string; }
static void nodeNames(struct phyloTree *tree, struct dyString *ds) /* recursive workhorse to add all the node names to a string */ { int ii; if (tree->ident->name) { dyStringAppendN(ds, tree->ident->name, strlen(tree->ident->name)); dyStringAppendC(ds, ' '); } for (ii=0; ii < tree->numEdges; ii++) nodeNames(tree->edges[ii],ds); }
RobotNodeSetPtr RobotNodeSet::clone(RobotPtr newRobot) { if (!newRobot) { VR_ERROR << "Attempting to clone RobotNodeSet for invalid robot"; return RobotNodeSetPtr(); } std::vector<std::string> nodeNames(robotNodes.size()); for(unsigned int i = 0; i < robotNodes.size(); i++) nodeNames[i] = robotNodes[i]->getName(); std::string kinRootName = ""; if (kinematicRoot) kinRootName = kinematicRoot->getName(); std::string tcpName = ""; if (tcp) tcpName = tcp->getName(); RobotNodeSetPtr nodeSet = RobotNodeSet::createRobotNodeSet(newRobot, name, nodeNames, kinRootName, tcpName, true); return nodeSet; }
core::ConfigNode VisionSystem::findVisionSystemConfig(core::ConfigNode cfg, std::string& nodeUsed) { core::ConfigNode config(core::ConfigNode::fromString("{}")); // Attempt to find the section deeper in the file if (cfg.exists("Subsystems")) { cfg = cfg["Subsystems"]; // Attempt to find a VisionSystem subsystem core::NodeNameList nodeNames(cfg.subNodes()); BOOST_FOREACH(std::string nodeName, nodeNames) { core::ConfigNode subsysCfg(cfg[nodeName]); if (("VisionSystem" == subsysCfg["type"].asString("NONE"))|| ("SimVision" == subsysCfg["type"].asString("NONE"))) { config = subsysCfg; std::stringstream ss; ss << "Subsystem:" << nodeName << ":" << nodeUsed; nodeUsed = ss.str(); } }