/usr/include/choreonoid-1.1/cnoid/src/Body/LinkGroup.h is in libcnoid-dev 1.1.0+dfsg-6.1+b4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | /*
@author Shin'ichiro Nakaoka
*/
#ifndef CNOID_BODY_LINK_GROUP_H_INCLUDED
#define CNOID_BODY_LINK_GROUP_H_INCLUDED
#include <boost/variant.hpp>
#include <cnoid/Referenced>
#include <vector>
#include "exportdecl.h"
namespace cnoid {
class YamlSequence;
class Body;
typedef boost::intrusive_ptr<Body> BodyPtr;
class LinkGroup;
typedef boost::intrusive_ptr<LinkGroup> LinkGroupPtr;
class CNOID_EXPORT LinkGroup : public Referenced
{
typedef boost::variant<LinkGroupPtr, int> Element;
public:
static LinkGroupPtr create(BodyPtr body, const YamlSequence& linkGroupSeq);
LinkGroup();
virtual ~LinkGroup();
inline void setName(const std::string& name) { name_ = name; }
inline const std::string& name() { return name_; }
inline int numElements() { return elements.size(); }
inline bool isSubGroup(int index) { return elements[index].which() == 0; }
inline bool isLinkIndex(int index) { return elements[index].which() == 1; }
inline LinkGroupPtr subGroup(int index) { return boost::get<LinkGroupPtr>(elements[index]); }
inline int linkIndex(int index) { return boost::get<int>(elements[index]); }
std::vector<int> collectLinkIndices() const;
std::vector<LinkGroupPtr> collectGroups() const;
private:
std::string name_;
std::vector<Element> elements;
bool load(BodyPtr& body, const YamlSequence& linkGroupseq);
void setFlatLinkList(BodyPtr& body);
};
}
#endif
|