Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::ConfigOptionSingle< T > Class Template Referenceabstract

#include <src/libslic3r/Config.hpp>

+ Inheritance diagram for Slic3r::ConfigOptionSingle< T >:
+ Collaboration diagram for Slic3r::ConfigOptionSingle< T >:

Public Member Functions

 ConfigOptionSingle (T value)
 
 operator T () const
 
void set (const ConfigOption *rhs) override
 
bool operator== (const ConfigOption &rhs) const override
 
bool operator== (const T &rhs) const throw ()
 
bool operator!= (const T &rhs) const throw ()
 
bool operator< (const T &rhs) const throw ()
 
size_t hash () const override throw ()
 
virtual ConfigOptionType type () const =0
 
virtual std::string serialize () const =0
 
virtual bool deserialize (const std::string &str, bool append=false)=0
 
virtual ConfigOptionclone () const =0
 
virtual int getInt () const
 
virtual double getFloat () const
 
virtual bool getBool () const
 
virtual void setInt (int)
 
bool operator!= (const ConfigOption &rhs) const
 
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)
 

Public Attributes

value
 

Private Member Functions

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

Friends

class cereal::access
 

Detailed Description

template<class T>
class Slic3r::ConfigOptionSingle< T >

Constructor & Destructor Documentation

◆ ConfigOptionSingle()

template<class T >
Slic3r::ConfigOptionSingle< T >::ConfigOptionSingle ( value)
inlineexplicit
306: value(std::move(value)) {}
T value
Definition Config.hpp:305

Member Function Documentation

◆ apply_override()

virtual bool Slic3r::ConfigOption::apply_override ( const ConfigOption rhs)
inlinevirtualinherited

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

290 {
291 if (*this == *rhs)
292 return false;
293 *this = *rhs;
294 return true;
295 }

Referenced by Slic3r::print_config_diffs().

+ Here is the caller graph for this function:

◆ clone()

◆ deserialize()

◆ getBool()

virtual bool Slic3r::ConfigOption::getBool ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::ConfigOptionBool.

272{ throw BadOptionTypeException("Calling ConfigOption::getBool on a non-boolean ConfigOption"); }

Referenced by Slic3r::client::MyContext::scalar_variable_to_expr().

+ Here is the caller graph for this function:

◆ getFloat()

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

Reimplemented in Slic3r::ConfigOptionFloat.

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

Referenced by Slic3r::GUI::TabSLAMaterial::build(), Slic3r::GUI::get_string_value(), Slic3r::client::MyContext::scalar_variable_to_expr(), and Slic3r::GUI::Sidebar::update_sliced_info_sizer().

+ Here is the caller graph for this function:

◆ getInt()

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

◆ hash()

template<class T >
size_t Slic3r::ConfigOptionSingle< T >::hash ( ) const
throw (
)
inlineoverridevirtual

Implements Slic3r::ConfigOption.

329{ return std::hash<T>{}(this->value); }

References Slic3r::ConfigOptionSingle< T >::value.

◆ is_nil()

◆ is_scalar()

bool Slic3r::ConfigOption::is_scalar ( ) const
inlineinherited
277{ return (int(this->type()) & int(coVectorType)) == 0; }
virtual ConfigOptionType type() const =0
@ coVectorType
Definition Config.hpp:161

References Slic3r::coVectorType, and Slic3r::ConfigOption::type().

Referenced by Slic3r::PresetBundle::full_fff_config(), Slic3r::client::MyContext::is_nil_test(), Slic3r::ConfigOption::is_vector(), Slic3r::client::MyContext::legacy_variable_expansion(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::client::MyContext::scalar_variable_assign_scalar(), Slic3r::client::MyContext::scalar_variable_to_expr(), Slic3r::client::MyContext::vector_variable_assign_array(), Slic3r::client::MyContext::vector_variable_assign_initializer_list(), and Slic3r::client::MyContext::vector_variable_new_from_array().

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

◆ is_vector()

◆ nullable()

virtual bool Slic3r::ConfigOption::nullable ( ) const
inlinevirtualinherited

◆ operator T()

template<class T >
Slic3r::ConfigOptionSingle< T >::operator T ( ) const
inline
307{ return this->value; }

◆ operator!=() [1/2]

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

◆ operator!=() [2/2]

template<class T >
bool Slic3r::ConfigOptionSingle< T >::operator!= ( const T &  rhs) const
throw (
)
inline
326{ return this->value != rhs; }

◆ operator<()

template<class T >
bool Slic3r::ConfigOptionSingle< T >::operator< ( const T &  rhs) const
throw (
)
inline
327{ return this->value < rhs; }

◆ operator==() [1/2]

template<class T >
bool Slic3r::ConfigOptionSingle< T >::operator== ( const ConfigOption rhs) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

318 {
319 if (rhs.type() != this->type())
320 throw ConfigurationError("ConfigOptionSingle: Comparing incompatible types");
321 assert(dynamic_cast<const ConfigOptionSingle<T>*>(&rhs));
322 return this->value == static_cast<const ConfigOptionSingle<T>*>(&rhs)->value;
323 }

References Slic3r::ConfigOption::type(), and Slic3r::ConfigOptionSingle< T >::value.

+ Here is the call graph for this function:

◆ operator==() [2/2]

template<class T >
bool Slic3r::ConfigOptionSingle< T >::operator== ( const T &  rhs) const
throw (
)
inline
325{ return this->value == rhs; }

◆ 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< unsigned char >, and Slic3r::ConfigOptionVector< Vec2d >.

285 {
286 assert(! this->nullable() && ! rhs->nullable());
287 return *this != *rhs;
288 }
virtual bool nullable() const
Definition Config.hpp:280

References Slic3r::ConfigOption::nullable().

Referenced by Slic3r::print_config_diffs().

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

◆ serialize() [1/2]

◆ serialize() [2/2]

template<class T >
template<class Archive >
void Slic3r::ConfigOptionSingle< T >::serialize ( Archive &  ar)
inlineprivate
333{ ar(this->value); }

◆ set()

template<class T >
void Slic3r::ConfigOptionSingle< T >::set ( const ConfigOption rhs)
inlineoverridevirtual

Implements Slic3r::ConfigOption.

310 {
311 if (rhs->type() != this->type())
312 throw ConfigurationError("ConfigOptionSingle: Assigning an incompatible type");
313 assert(dynamic_cast<const ConfigOptionSingle<T>*>(rhs));
314 this->value = static_cast<const ConfigOptionSingle<T>*>(rhs)->value;
315 }

References Slic3r::ConfigOption::type(), and Slic3r::ConfigOptionSingle< T >::value.

+ Here is the call graph for this function:

◆ setInt()

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

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

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

◆ type()

virtual ConfigOptionType Slic3r::ConfigOption::type ( ) const
pure virtualinherited

Implemented in Slic3r::ConfigOptionFloat, Slic3r::ConfigOptionFloatsTempl< NULLABLE >, Slic3r::ConfigOptionInt, Slic3r::ConfigOptionIntsTempl< NULLABLE >, Slic3r::ConfigOptionString, Slic3r::ConfigOptionStrings, Slic3r::ConfigOptionPercent, Slic3r::ConfigOptionPercentsTempl< NULLABLE >, Slic3r::ConfigOptionFloatOrPercent, Slic3r::ConfigOptionFloatsOrPercentsTempl< NULLABLE >, Slic3r::ConfigOptionPoint, Slic3r::ConfigOptionPoints, Slic3r::ConfigOptionPoint3, Slic3r::ConfigOptionBool, Slic3r::ConfigOptionBoolsTempl< NULLABLE >, Slic3r::ConfigOptionEnum< T >, and Slic3r::ConfigOptionEnumGeneric.

Referenced by Slic3r::Search::OptionsSearcher::append_options(), Slic3r::ConfigOptionVector< T >::apply_override(), Slic3r::client::MyContext::copy_vector_variable_to_vector_variable(), Slic3r::deep_diff(), Slic3r::ConfigBase::get_abs_value(), Slic3r::ConfigBase::get_abs_value(), Slic3r::ConfigOption::is_scalar(), Slic3r::client::MyContext::legacy_variable_expansion2(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::PresetBundle::load_config_file_config_bundle(), Slic3r::ConfigOptionSingle< T >::operator==(), Slic3r::ConfigOptionVector< T >::operator==(), Slic3r::ConfigOptionFloatsTempl< NULLABLE >::operator==(), Slic3r::ConfigOptionFloatOrPercent::operator==(), Slic3r::ConfigOptionFloatsOrPercentsTempl< NULLABLE >::operator==(), Slic3r::ConfigOptionEnum< T >::operator==(), Slic3r::ConfigOptionEnumGeneric::operator==(), Slic3r::ConfigOptionResolver::option(), Slic3r::ConfigBase::option(), Slic3r::ConfigOptionResolver::option_throw(), Slic3r::ConfigBase::option_throw(), Slic3r::ConfigOptionVector< T >::overriden_by(), Slic3r::DynamicConfig::read_cli(), Slic3r::ConfigOptionVectorBase::scalar_type(), Slic3r::client::MyContext::scalar_variable_assign_scalar(), Slic3r::client::MyContext::scalar_variable_to_expr(), Slic3r::ConfigOptionSingle< T >::set(), Slic3r::ConfigOptionVector< T >::set(), Slic3r::ConfigOptionFloatOrPercent::set(), Slic3r::ConfigOptionEnum< T >::set(), Slic3r::ConfigOptionEnumGeneric::set(), Slic3r::ConfigBase::set(), Slic3r::ConfigBase::set(), Slic3r::ConfigOptionVector< T >::set(), Slic3r::ConfigOptionVector< T >::set_at(), Slic3r::validate(), Slic3r::client::MyContext::vector_element_to_expr(), Slic3r::client::MyContext::vector_variable_assign_expr_with_count(), Slic3r::client::MyContext::vector_variable_assign_initializer_list(), Slic3r::client::MyContext::vector_variable_element_assign_scalar(), and Slic3r::client::MyContext::vector_variable_new_from_copy().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ cereal::access

template<class T >
friend class cereal::access
friend

Member Data Documentation

◆ value

template<class T >
T Slic3r::ConfigOptionSingle< T >::value

Referenced by Slic3r::GUI::GLCanvas3D::_render_overlays(), Slic3r::GCodeProcessor::apply_config(), Slic3r::GCodeProcessor::apply_config(), Slic3r::apply_to_print_region_config(), Slic3r::GUI::ColourPicker::BUILD(), Slic3r::GUI::StaticText::BUILD(), Slic3r::GUI::BedShapePanel::build_panel(), Slic3r::clamp_exturder_to_default(), Slic3r::PrinterPresetCollection::default_preset_for(), Slic3r::Flow::extrusion_width(), Slic3r::first_positive(), Slic3r::PrintRegion::flow(), Slic3r::ConfigOptionEnum< T >::from_string(), Slic3r::GUI::Materials::get_filament_vendor(), Slic3r::GUI::Materials::get_material_type(), Slic3r::GUI::Materials::get_material_vendor(), Slic3r::PrintHost::get_print_host(), get_printer_technology(), Slic3r::get_raster_params(), Slic3r::GUI::get_string_value(), Slic3r::ConfigOptionEnum< T >::getInt(), Slic3r::PrintConfigDef::handle_legacy(), Slic3r::handle_legacy_project_loaded(), Slic3r::handle_legacy_sla(), Slic3r::ConfigOptionEnum< T >::has(), Slic3r::ConfigOptionSingle< T >::hash(), Slic3r::PrintObject::invalidate_state_by_config_options(), Slic3r::PresetHints::maximum_volumetric_flow_description(), Slic3r::min_object_distance(), Slic3r::GUI::GLGizmoHollow::on_render_input_window(), Slic3r::ConfigOptionSingle< bool >::operator bool(), Slic3r::ConfigOptionSingle< T >::operator==(), Slic3r::DynamicConfig::read_cli(), Slic3r::CLI::run(), Slic3r::client::MyContext::scalar_variable_to_expr(), Slic3r::ConfigOptionEnum< T >::serialize(), Slic3r::ConfigOptionSingle< T >::set(), Slic3r::ConfigOptionVector< T >::set(), Slic3r::ConfigOptionVector< T >::set_at(), Slic3r::GUI::Plater::set_bed_shape(), Slic3r::CLI::setup(), Slic3r::AvoidCrossingPerimeters::travel_to(), Slic3r::GUI::ConfigManipulation::update_print_fff_config(), and Slic3r::validate().


The documentation for this class was generated from the following file: