Go to the documentation of this file.
5 #ifndef CNOID_BODY_LINK_GROUP_H
6 #define CNOID_BODY_LINK_GROUP_H
8 #include <cnoid/stdx/variant>
12 #include "exportdecl.h"
23 typedef stdx::variant<LinkGroupPtr, int> Element;
27 struct private_tag { };
35 void setName(
const std::string& name) { name_ = name; }
36 const std::string&
name() {
return name_; }
39 bool isSubGroup(
int index)
const {
return stdx::get_variant_index(elements[index]) == 0; }
40 bool isLinkIndex(
int index)
const {
return stdx::get_variant_index(elements[index]) == 1; }
42 int linkIndex(
int index)
const {
return stdx::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);
int linkIndex(int index) const
Definition: LinkGroup.h:42
void setName(const std::string &name)
Definition: LinkGroup.h:35
Definition: LinkGroup.h:21
int numElements() const
Definition: LinkGroup.h:38
std::shared_ptr< LinkGroup > LinkGroupPtr
Definition: LinkGroup.h:18
Definition: ValueTree.h:486
Definition: AbstractSceneLoader.h:11
const std::string & name()
Definition: LinkGroup.h:36
const LinkGroupPtr & subGroup(int index) const
Definition: LinkGroup.h:41
bool isSubGroup(int index) const
Definition: LinkGroup.h:39
bool isLinkIndex(int index) const
Definition: LinkGroup.h:40