Go to the documentation of this file.
5 #ifndef CNOID_UTIL_SELECTION_H
6 #define CNOID_UTIL_SELECTION_H
10 #include <initializer_list>
11 #include "exportdecl.h"
18 explicit Selection(
const char* domainname =
nullptr);
19 explicit Selection(
size_t size,
const char* domainname =
nullptr);
20 Selection(std::initializer_list<std::string> symbols,
const char* domainname =
nullptr);
24 return static_cast<int>(symbols_.size());
27 explicit operator bool()
const {
28 return selectedIndex_ >= 0;
31 operator int()
const {
32 return selectedIndex_;
39 void setSymbol(
int index,
const std::string& symbol);
44 return symbols_[index];
47 const std::string&
symbol(
int index)
const {
48 return symbols_[index];
51 int index(
const std::string& symbol)
const;
53 const char* label(
int index)
const;
55 bool select(
int index);
56 bool selectIndex(
int index);
57 bool select(
const std::string& symbol);
60 return selectedIndex_;
64 return selectedIndex_;
67 bool is(
int index)
const {
68 return (index == selectedIndex_);
71 const char* selectedSymbol()
const;
72 const char* selectedLabel()
const;
75 std::vector<std::string> symbols_;
77 const char* domainname_;
Definition: Selection.h:15
bool is(int index) const
Definition: Selection.h:67
const std::string & symbol(int index) const
Definition: Selection.h:47
int selectedIndex() const
Definition: Selection.h:59
CNOID_EXPORT std::ostream & operator<<(std::ostream &os, const BoundingBox &bb)
Definition: BoundingBox.cpp:160
std::string & symbol(int index)
Definition: Selection.h:43
int size() const
Definition: Selection.h:23
Definition: AbstractSceneLoader.h:11
int which() const
Definition: Selection.h:63