5 #ifndef CNOID_BODY_LINK_GROUP_H 6 #define CNOID_BODY_LINK_GROUP_H 8 #include <boost/variant.hpp> 9 #include <boost/shared_ptr.hpp> 23 typedef boost::variant<LinkGroupPtr, int>
Element;
27 struct private_tag { };
30 static LinkGroupPtr create(
const Body& body);
35 inline void setName(
const std::string& name) { name_ = name; }
36 inline const std::string&
name() {
return name_; }
39 bool isSubGroup(
int index)
const {
return elements[index].which() == 0; }
40 bool isLinkIndex(
int index)
const {
return elements[index].which() == 1; }
41 const LinkGroupPtr&
subGroup(
int index)
const {
return boost::get<LinkGroupPtr>(elements[index]); }
42 int linkIndex(
int index)
const {
return boost::get<int>(elements[index]); }
44 std::vector<int> collectLinkIndices()
const;
45 std::vector<LinkGroupPtr> collectGroups()
const;
49 std::vector<Element> elements;
51 bool load(
const Body& body,
const Listing& linkGroupList);
52 void setFlatLinkList(
const Body& body);
Definition: LinkGroup.h:21
Element
Definition: PointSetUtil.cpp:18
bool isLinkIndex(int index) const
Definition: LinkGroup.h:40
void setName(const std::string &name)
Definition: LinkGroup.h:35
const std::string & name()
Definition: LinkGroup.h:36
const LinkGroupPtr & subGroup(int index) const
Definition: LinkGroup.h:41
Definition: ValueTree.h:424
int numElements() const
Definition: LinkGroup.h:38
int linkIndex(int index) const
Definition: LinkGroup.h:42
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
bool isSubGroup(int index) const
Definition: LinkGroup.h:39
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
boost::shared_ptr< LinkGroup > LinkGroupPtr
Definition: LinkGroup.h:18