OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::ConfigOptionBool Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Config.hpp>

Inheritance diagram for Slic3r::ConfigOptionBool:
Collaboration diagram for Slic3r::ConfigOptionBool:

Public Member Functions

 ConfigOptionBool ()
 ConfigOptionBool (bool _value)
ConfigOptionType type () const override
bool getBool () const override
ConfigOption * clone () const override
ConfigOptionBool & operator= (const ConfigOption *opt)
bool operator== (const ConfigOptionBool &rhs) const throw ()
bool operator< (const ConfigOptionBool &rhs) const throw ()
std::string serialize () const override
bool deserialize (const std::string &str, bool append=false) override
 operator bool () const
void set (const ConfigOption *rhs) override
bool operator== (const ConfigOption &rhs) const override
bool operator!= (const bool &rhs) const throw ()
bool operator!= (const ConfigOption &rhs) const
bool operator< (const bool &rhs) const throw ()
size_t hash () const override throw ()
virtual int getInt () const
virtual double getFloat () const
virtual void setInt (int)
bool is_scalar () const
bool is_vector () const
virtual bool nullable () const
virtual bool is_nil () const
virtual bool overriden_by (const ConfigOption *rhs) const
virtual bool apply_override (const ConfigOption *rhs, std::vector< int > &default_index)

Static Public Member Functions

static ConfigOptionType static_type ()

Public Attributes

bool value

Private Member Functions

template<class Archive>
void serialize (Archive &ar)

Friends

class cereal::access

Detailed Description

Constructor & Destructor Documentation

◆ ConfigOptionBool() [1/2]

Slic3r::ConfigOptionBool::ConfigOptionBool ( )
inline
1910: ConfigOptionSingle<bool>(false) {}
ConfigOptionSingle(bool value)
Definition Config.hpp:330

References Slic3r::ConfigOptionSingle< bool >::ConfigOptionSingle().

Referenced by clone(), operator<(), operator=(), and operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigOptionBool() [2/2]

Slic3r::ConfigOptionBool::ConfigOptionBool ( bool _value)
inlineexplicit
1911: ConfigOptionSingle<bool>(_value) {}

References Slic3r::ConfigOptionSingle< bool >::ConfigOptionSingle().

Here is the call graph for this function:

Member Function Documentation

◆ apply_override()

virtual bool Slic3r::ConfigOption::apply_override ( const ConfigOption * rhs,
std::vector< int > & default_index )
inlinevirtualinherited

Reimplemented in Slic3r::ConfigOptionVector< T >, Slic3r::ConfigOptionVector< double >, Slic3r::ConfigOptionVector< FloatOrPercent >, Slic3r::ConfigOptionVector< int >, Slic3r::ConfigOptionVector< std::string >, Slic3r::ConfigOptionVector< std::vector< int > >, Slic3r::ConfigOptionVector< unsigned char >, Slic3r::ConfigOptionVector< Vec2d >, and Slic3r::ConfigOptionVector< Vec2ds >.

314 {
315 if (*this == *rhs)
316 return false;
317 *this = *rhs;
318 return true;
319 }

Referenced by Slic3r::compute_filament_override_value().

Here is the caller graph for this function:

◆ clone()

ConfigOption * Slic3r::ConfigOptionBool::clone ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1916{ return new ConfigOptionBool(*this); }
ConfigOptionBool()
Definition Config.hpp:1910

References ConfigOptionBool().

Here is the call graph for this function:

◆ deserialize()

bool Slic3r::ConfigOptionBool::deserialize ( const std::string & str,
bool append = false )
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1928 {
1929 UNUSED(append);
1930
1931 // Orca: take the first value if input is an array
1932 std::istringstream is(str);
1933 std::string item_str;
1934 if (std::getline(is, item_str, ',')) {
1935 boost::trim(item_str);
1936
1937 if (item_str == "1") {
1938 this->value = true;
1939 return true;
1940 }
1941 if (item_str == "0") {
1942 this->value = false;
1943 return true;
1944 }
1945 }
1946
1947 return false;
1948 }
bool value
Definition Config.hpp:329
#define UNUSED(x)
Definition libslic3r.h:112
void append(std::vector< T, Alloc > &dest, const std::vector< T, Alloc2 > &src)
Definition libslic3r.h:157

References Slic3r::append(), and UNUSED.

Here is the call graph for this function:

◆ getBool()

bool Slic3r::ConfigOptionBool::getBool ( ) const
inlineoverridevirtual

Reimplemented from Slic3r::ConfigOption.

1915{ return this->value; }

Referenced by Slic3r::ModelInstance::get_arrange_polygon(), and Slic3r::GUI::ObjectGridTable::GetValueAsBool().

Here is the caller graph for this function:

◆ getFloat()

virtual double Slic3r::ConfigOption::getFloat ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::ConfigOptionFloat.

295{ throw BadOptionTypeException("Calling ConfigOption::getFloat on a non-float ConfigOption"); }

Referenced by Slic3r::estimate_wipe_tower_first_layer_outline(), Slic3r::GUI::PartPlate::estimate_wipe_tower_footprint(), Slic3r::GUI::PartPlate::get_object_filament_extruders(), Slic3r::GUI::get_string_value(), Slic3r::CLI::run(), Slic3r::client::MyContext::scalar_variable_to_expr(), Slic3r::client::MyContext::vector_element_to_expr(), and Slic3r::GUI::PartPlate::wipe_tower_obstacles().

Here is the caller graph for this function:

◆ getInt()

virtual int Slic3r::ConfigOption::getInt ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::ConfigOptionEnum< T >, Slic3r::ConfigOptionEnum< BrimType >, and Slic3r::ConfigOptionInt.

294{ throw BadOptionTypeException("Calling ConfigOption::getInt on a non-int ConfigOption"); }

Referenced by Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::estimate_wipe_tower_first_layer_outline(), Slic3r::GUI::PartPlate::estimate_wipe_tower_footprint(), Slic3r::GUI::ConfigOptionsGroup::get_config_value(), Slic3r::GUI::ConfigOptionsGroup::get_config_value2(), Slic3r::GUI::PartPlate::get_extruders(), Slic3r::GUI::PartPlate::get_extruders_under_cli(), Slic3r::get_instance_arrange_poly(), Slic3r::GUI::PartPlate::get_object_filament_extruders(), Slic3r::GUI::get_string_from_enum(), Slic3r::PrintConfigDef::handle_legacy_composite(), Slic3r::client::MyContext::legacy_variable_expansion2(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::DynamicPrintConfig::normalize_fdm(), Slic3r::DynamicPrintConfig::normalize_fdm_1(), Slic3r::ConfigOptionEnum< T >::operator==(), Slic3r::ConfigOptionEnumGeneric::operator==(), Slic3r::DynamicConfig::opt_enum(), Slic3r::prime_tower_is_printed(), Slic3r::GUI::GLGizmoMmuSegmentation::remap_filament_assignments(), Slic3r::resolve_wipe_tower_type(), Slic3r::ConfigOptionEnum< T >::set(), Slic3r::ConfigOptionEnumGeneric::set(), Slic3r::GUI::GCodeViewer::update_layers_slider_mode(), and Slic3r::GUI::PartPlate::wipe_tower_obstacles().

Here is the caller graph for this function:

◆ hash()

size_t Slic3r::ConfigOptionSingle< bool >::hash ( ) const
throw ( )
inlineoverridevirtualinherited

Implements Slic3r::ConfigOption.

353{ return std::hash<T>{}(this->value); }
Definition Config.hpp:327

◆ is_nil()

◆ is_scalar()

bool Slic3r::ConfigOption::is_scalar ( ) const
inlineinherited

◆ is_vector()

bool Slic3r::ConfigOption::is_vector ( ) const
inlineinherited
302{ return ! this->is_scalar(); }
bool is_scalar() const
Definition Config.hpp:301

References is_scalar().

Referenced by Slic3r::client::MyContext::copy_vector_variable_to_vector_variable(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::GUI::Tab::options_list_storage_key(), Slic3r::DynamicConfig::read_cli(), Slic3r::client::MyContext::scalar_variable_new_from_scalar_expression(), Slic3r::client::MyContext::vector_variable_element_assign_scalar(), and Slic3r::client::MyContext::vector_variable_new_from_copy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nullable()

◆ operator bool()

Slic3r::ConfigOptionSingle< bool >::operator bool ( ) const
inlineinherited
331{ return this->value; }

◆ operator!=() [1/2]

bool Slic3r::ConfigOption::operator!= ( const ConfigOption & rhs) const
inlineinherited
299{ return ! (*this == rhs); }

◆ operator!=() [2/2]

bool Slic3r::ConfigOptionSingle< bool >::operator!= ( const bool & rhs) const
throw ( )
inlineinherited
350{ return this->value != rhs; }

◆ operator<() [1/2]

bool Slic3r::ConfigOptionBool::operator< ( const ConfigOptionBool & rhs) const
throw ( )
inline
1920{ return int(this->value) < int(rhs.value); }

References ConfigOptionBool().

Here is the call graph for this function:

◆ operator<() [2/2]

bool Slic3r::ConfigOptionSingle< bool >::operator< ( const bool & rhs) const
throw ( )
inlineinherited
351{ return this->value < rhs; }

◆ operator=()

ConfigOptionBool & Slic3r::ConfigOptionBool::operator= ( const ConfigOption * opt)
inline
1917{ this->set(opt); return *this; }
void set(const ConfigOption *rhs) override
Definition Config.hpp:333

References ConfigOptionBool(), and Slic3r::ConfigOptionSingle< bool >::set().

Here is the call graph for this function:

◆ operator==() [1/2]

bool Slic3r::ConfigOptionBool::operator== ( const ConfigOptionBool & rhs) const
throw ( )
inline
1919{ return this->value == rhs.value; }

References ConfigOptionBool().

Here is the call graph for this function:

◆ operator==() [2/2]

bool Slic3r::ConfigOptionSingle< bool >::operator== ( const ConfigOption & rhs) const
inlineoverridevirtualinherited

Implements Slic3r::ConfigOption.

342 {
343 if (rhs.type() != this->type())
344 throw ConfigurationError("ConfigOptionSingle: Comparing incompatible types");
345 assert(dynamic_cast<const ConfigOptionSingle<T>*>(&rhs));
346 return this->value == static_cast<const ConfigOptionSingle<T>*>(&rhs)->value;
347 }

◆ overriden_by()

virtual bool Slic3r::ConfigOption::overriden_by ( const ConfigOption * rhs) const
inlinevirtualinherited

Reimplemented in Slic3r::ConfigOptionVector< T >, Slic3r::ConfigOptionVector< double >, Slic3r::ConfigOptionVector< FloatOrPercent >, Slic3r::ConfigOptionVector< int >, Slic3r::ConfigOptionVector< std::string >, Slic3r::ConfigOptionVector< std::vector< int > >, Slic3r::ConfigOptionVector< unsigned char >, Slic3r::ConfigOptionVector< Vec2d >, and Slic3r::ConfigOptionVector< Vec2ds >.

309 {
310 assert(! this->nullable() && ! rhs->nullable());
311 return *this != *rhs;
312 }
virtual bool nullable() const
Definition Config.hpp:304

References nullable().

Here is the call graph for this function:

◆ serialize() [1/2]

std::string Slic3r::ConfigOptionBool::serialize ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1923 {
1924 return std::string(this->value ? "1" : "0");
1925 }

◆ serialize() [2/2]

template<class Archive>
void Slic3r::ConfigOptionBool::serialize ( Archive & ar)
inlineprivate
1952{ ar(cereal::base_class<ConfigOptionSingle<bool>>(this)); }

References Slic3r::ConfigOptionSingle< bool >::ConfigOptionSingle().

Here is the call graph for this function:

◆ set()

void Slic3r::ConfigOptionSingle< bool >::set ( const ConfigOption * rhs)
inlineoverridevirtualinherited

Implements Slic3r::ConfigOption.

334 {
335 if (rhs->type() != this->type())
336 throw ConfigurationError("ConfigOptionSingle: Assigning an incompatible type");
337 assert(dynamic_cast<const ConfigOptionSingle<T>*>(rhs));
338 this->value = static_cast<const ConfigOptionSingle<T>*>(rhs)->value;
339 }

Referenced by Slic3r::ConfigOptionBool::operator=().

Here is the caller graph for this function:

◆ setInt()

virtual void Slic3r::ConfigOption::setInt ( int )
inlinevirtualinherited

Reimplemented in Slic3r::ConfigOptionEnum< T >, Slic3r::ConfigOptionEnum< BrimType >, and Slic3r::ConfigOptionInt.

297{ throw BadOptionTypeException("Calling ConfigOption::setInt on a non-int ConfigOption"); }

Referenced by Slic3r::DynamicPrintConfig::normalize_fdm(), and Slic3r::DynamicPrintConfig::normalize_fdm_1().

Here is the caller graph for this function:

◆ static_type()

ConfigOptionType Slic3r::ConfigOptionBool::static_type ( )
inlinestatic
1913{ return coBool; }
@ coBool
Definition Config.hpp:210

References Slic3r::coBool.

Referenced by Slic3r::imex_cfg_bool(), and type().

Here is the caller graph for this function:

◆ type()

ConfigOptionType Slic3r::ConfigOptionBool::type ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1914{ return static_type(); }
static ConfigOptionType static_type()
Definition Config.hpp:1913

References static_type().

Here is the call graph for this function:

◆ cereal::access

friend class cereal::access
friend

References cereal::access.

Referenced by cereal::access.

Member Data Documentation

◆ value

bool Slic3r::ConfigOptionSingle< bool >::value
inherited

The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Config.hpp