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);
26 return static_cast<int>(symbols_.size());
29 explicit operator bool()
const {
30 return selectedIndex_ >= 0;
33 operator int()
const {
34 return selectedIndex_;
41 void setSymbol(
int index,
const std::string& symbol);
46 return symbols_[index];
49 const std::string&
symbol(
int index)
const {
50 return symbols_[index];
53 int index(
const std::string& symbol)
const;
55 const char* label(
int index)
const;
57 bool select(
int index);
58 bool selectIndex(
int index);
59 bool select(
const std::string& symbol);
62 return selectedIndex_;
66 return selectedIndex_;
69 bool is(
int index)
const {
70 return (index == selectedIndex_);
73 const char* selectedSymbol()
const;
74 const char* selectedLabel()
const;
77 std::vector<std::string> symbols_;
79 const char* domainname_;
Definition: Selection.h:15
bool is(int index) const
Definition: Selection.h:69
const std::string & symbol(int index) const
Definition: Selection.h:49
int selectedIndex() const
Definition: Selection.h:61
CNOID_EXPORT std::ostream & operator<<(std::ostream &os, const BoundingBox &bb)
Definition: BoundingBox.cpp:160
std::string & symbol(int index)
Definition: Selection.h:45
int size() const
Definition: Selection.h:25
Definition: AbstractSceneLoader.h:11
int which() const
Definition: Selection.h:65