#include <src/libslic3r/Config.hpp>
◆ ConfigOptionEnumDef()
| Slic3r::ConfigOptionEnumDef::ConfigOptionEnumDef |
( |
| ) |
|
|
privatedefault |
◆ clear()
| void Slic3r::ConfigOptionEnumDef::clear |
( |
| ) |
|
|
inline |
1715 {
1721 }
bool m_values_ordinary
Definition Config.hpp:1778
std::vector< std::string > m_values
Definition Config.hpp:1774
const t_config_enum_values * m_enum_keys_map
Definition Config.hpp:1792
const t_config_enum_names * m_enum_names
Definition Config.hpp:1789
std::vector< std::string > m_labels
Definition Config.hpp:1775
References m_enum_keys_map, m_enum_names, m_labels, m_values, and m_values_ordinary.
◆ clone()
ConfigOptionEnumDef()=default
◆ enum_to_index()
| std::optional< int > Slic3r::ConfigOptionEnumDef::enum_to_index |
( |
int |
enum_val | ) |
const |
|
inline |
◆ enum_to_label()
| std::optional< std::reference_wrapper< const std::string > > Slic3r::ConfigOptionEnumDef::enum_to_label |
( |
int |
enum_val | ) |
const |
|
inline |
1696 {
1699 return opt.has_value() ?
1700 std::optional<std::reference_wrapper<const std::string>>{ this->
label(*opt) } :
1701 std::optional<std::reference_wrapper<const std::string>>{};
1702 }
const std::string & label(int idx) const
Definition Config.hpp:1641
std::optional< int > enum_to_index(int enum_val) const
Definition Config.hpp:1660
References enum_to_index(), is_valid_closed_enum(), and label().
◆ enum_to_value()
| std::optional< std::reference_wrapper< const std::string > > Slic3r::ConfigOptionEnumDef::enum_to_value |
( |
int |
enum_val | ) |
const |
|
inline |
1688 {
1691 return opt.has_value() ?
1692 std::optional<std::reference_wrapper<const std::string>>{ this->
value(*opt) } :
1693 std::optional<std::reference_wrapper<const std::string>>{};
1694 }
const std::string & value(int idx) const
Definition Config.hpp:1632
References enum_to_index(), is_valid_closed_enum(), and value().
◆ enums()
| const std::vector< std::string > & Slic3r::ConfigOptionEnumDef::enums |
( |
| ) |
const |
|
inline |
◆ finalize_closed_enum()
| void Slic3r::ConfigOptionEnumDef::finalize_closed_enum |
( |
| ) |
|
|
inlineprivate |
◆ has_labels()
| bool Slic3r::ConfigOptionEnumDef::has_labels |
( |
| ) |
const |
|
inline |
◆ has_values()
| bool Slic3r::ConfigOptionEnumDef::has_values |
( |
| ) |
const |
|
inline |
◆ index_to_enum()
| int Slic3r::ConfigOptionEnumDef::index_to_enum |
( |
int |
index | ) |
const |
|
inline |
◆ is_valid_closed_enum()
| bool Slic3r::ConfigOptionEnumDef::is_valid_closed_enum |
( |
| ) |
const |
|
inline |
◆ is_valid_open_enum()
| bool Slic3r::ConfigOptionEnumDef::is_valid_open_enum |
( |
| ) |
const |
|
inline |
◆ label()
| const std::string & Slic3r::ConfigOptionEnumDef::label |
( |
int |
idx | ) |
const |
|
inline |
1641{
return this->
labels()[idx]; }
const std::vector< std::string > & labels() const
Definition Config.hpp:1640
References labels().
Referenced by enum_to_label().
◆ label_to_index()
| std::optional< int > Slic3r::ConfigOptionEnumDef::label_to_index |
( |
const std::string & |
value | ) |
const |
|
inline |
1680 {
1682 const auto &ls = this->
labels();
1683 auto it = std::find(ls.begin(), ls.end(),
value);
1684 return it == ls.end() ?
1685 std::optional<int>{} : std::optional<int>{ it - ls.begin() };
1686 }
References is_valid_open_enum(), labels(), and value().
◆ labels()
| const std::vector< std::string > & Slic3r::ConfigOptionEnumDef::labels |
( |
| ) |
const |
|
inline |
◆ set_enum_map()
template<typename EnumType >
| void Slic3r::ConfigOptionEnumDef::set_enum_map |
( |
| ) |
|
|
inlineprivate |
◆ set_labels()
| void Slic3r::ConfigOptionEnumDef::set_labels |
( |
const std::initializer_list< std::string_view > |
il | ) |
|
|
inlineprivate |
1753 {
1756 for (const std::string_view& p : il)
1759 }
References m_labels, and m_values.
◆ set_values() [1/3]
| void Slic3r::ConfigOptionEnumDef::set_values |
( |
const std::initializer_list< std::pair< std::string_view, std::string_view > > |
il | ) |
|
|
inlineprivate |
1743 {
1748 for (const std::pair<std::string_view, std::string_view>& p : il) {
1751 }
1752 }
References m_labels, and m_values.
◆ set_values() [2/3]
| void Slic3r::ConfigOptionEnumDef::set_values |
( |
const std::initializer_list< std::string_view > |
il | ) |
|
|
inlineprivate |
1736 {
1739 for (const std::string_view& p : il)
1742 }
References m_labels, and m_values.
◆ set_values() [3/3]
| void Slic3r::ConfigOptionEnumDef::set_values |
( |
const std::vector< std::string > & |
v | ) |
|
|
inlineprivate |
◆ value()
| const std::string & Slic3r::ConfigOptionEnumDef::value |
( |
int |
idx | ) |
const |
|
inline |
◆ value_to_index()
| std::optional< int > Slic3r::ConfigOptionEnumDef::value_to_index |
( |
const std::string & |
value | ) |
const |
|
inline |
◆ values()
| const std::vector< std::string > & Slic3r::ConfigOptionEnumDef::values |
( |
| ) |
const |
|
inline |
◆ ConfigDef
| friend Slic3r::ConfigOptionEnumDef::ConfigDef |
|
private |
◆ ConfigOptionDef
| friend Slic3r::ConfigOptionEnumDef::ConfigOptionDef |
|
private |
◆ m_enum_keys_map
◆ m_enum_names
◆ m_labels
| std::vector<std::string> Slic3r::ConfigOptionEnumDef::m_labels |
|
private |
◆ m_values
| std::vector<std::string> Slic3r::ConfigOptionEnumDef::m_values |
|
private |
Referenced by clear(), enum_to_index(), enums(), has_values(), index_to_enum(), is_valid_closed_enum(), is_valid_open_enum(), labels(), set_labels(), set_values(), set_values(), set_values(), value(), value_to_index(), and values().
◆ m_values_ordinary
| bool Slic3r::ConfigOptionEnumDef::m_values_ordinary { false } |
|
private |
The documentation for this class was generated from the following file: