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

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

Inheritance diagram for Slic3r::ConfigOptionInt:
Collaboration diagram for Slic3r::ConfigOptionInt:

Public Member Functions

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

Static Public Member Functions

static ConfigOptionType static_type ()

Public Attributes

int value

Private Member Functions

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

Friends

class cereal::access

Detailed Description

Constructor & Destructor Documentation

◆ ConfigOptionInt() [1/3]

Slic3r::ConfigOptionInt::ConfigOptionInt ( )
inline
ConfigOptionSingle(int value)
Definition Config.hpp:330

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

Referenced by Slic3r::ConfigOptionEnumGeneric::ConfigOptionEnumGeneric(), clone(), operator=(), and operator==().

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

◆ ConfigOptionInt() [2/3]

Slic3r::ConfigOptionInt::ConfigOptionInt ( int value)
inlineexplicit
int value
Definition Config.hpp:329

References Slic3r::ConfigOptionSingle< int >::ConfigOptionSingle(), and Slic3r::ConfigOptionSingle< int >::value.

Here is the call graph for this function:

◆ ConfigOptionInt() [3/3]

Slic3r::ConfigOptionInt::ConfigOptionInt ( double _value)
inlineexplicit
1023: ConfigOptionSingle<int>(int(floor(_value + 0.5))) {}

References Slic3r::ConfigOptionSingle< int >::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
314 {
315 if (*this == *rhs)
316 return false;
317 *this = *rhs;
318 return true;
319 }
Definition Config.hpp:327

◆ clone()

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

Implements Slic3r::ConfigOption.

1029{ return new ConfigOptionInt(*this); }
ConfigOptionInt()
Definition Config.hpp:1021

References ConfigOptionInt().

Referenced by Slic3r::GUI::ObjectGridTable::construct_object_configs().

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

◆ deserialize()

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

Implements Slic3r::ConfigOption.

1041 {
1042 UNUSED(append);
1043 std::istringstream iss(str);
1044 int value;
1045 iss >> value;
1046 if (iss.fail())
1047 return false;
1048 this->value = value;
1049 return true;
1050 }
#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(), UNUSED, and Slic3r::ConfigOptionSingle< int >::value.

Here is the call graph for this function:

◆ getBool()

virtual bool Slic3r::ConfigOption::getBool ( ) const
inlinevirtualinherited
296{ throw BadOptionTypeException("Calling ConfigOption::getBool on a non-boolean ConfigOption"); }

◆ getFloat()

virtual double Slic3r::ConfigOption::getFloat ( ) const
inlinevirtualinherited
295{ throw BadOptionTypeException("Calling ConfigOption::getFloat on a non-float ConfigOption"); }

◆ getInt()

int Slic3r::ConfigOptionInt::getInt ( ) const
inlineoverridevirtual

Reimplemented from Slic3r::ConfigOption.

1027{ return this->value; }

Referenced by Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::ModelInstance::get_arrange_polygon(), and Slic3r::GUI::ObjectGridTable::GetValueAsLong().

Here is the caller graph for this function:

◆ hash()

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

Implements Slic3r::ConfigOption.

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

◆ is_nil()

virtual bool Slic3r::ConfigOption::is_nil ( ) const
inlinevirtualinherited
306{ return false; }

◆ is_scalar()

bool Slic3r::ConfigOption::is_scalar ( ) const
inlineinherited
301{ return (int(this->type()) & int(coVectorType)) == 0; }
virtual ConfigOptionType type() const=0

◆ is_vector()

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

◆ nullable()

virtual bool Slic3r::ConfigOption::nullable ( ) const
inlinevirtualinherited
304{ return false; }

◆ operator int()

Slic3r::ConfigOptionSingle< int >::operator int ( ) 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< int >::operator!= ( const int & rhs) const
throw ( )
inlineinherited
350{ return this->value != rhs; }

◆ operator<()

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

◆ operator=()

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

References ConfigOptionInt(), and Slic3r::ConfigOptionSingle< int >::set().

Here is the call graph for this function:

◆ operator==() [1/2]

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

References ConfigOptionInt().

Here is the call graph for this function:

◆ operator==() [2/2]

bool Slic3r::ConfigOptionSingle< int >::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
309 {
310 assert(! this->nullable() && ! rhs->nullable());
311 return *this != *rhs;
312 }
virtual bool nullable() const
Definition Config.hpp:304

◆ serialize() [1/2]

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

Implements Slic3r::ConfigOption.

1034 {
1035 std::ostringstream ss;
1036 ss << this->value;
1037 return ss.str();
1038 }

◆ serialize() [2/2]

template<class Archive>
void Slic3r::ConfigOptionInt::serialize ( Archive & ar)
inlineprivate
1060{ ar(cereal::base_class<ConfigOptionSingle<int>>(this)); }

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

Here is the call graph for this function:

◆ set()

void Slic3r::ConfigOptionSingle< int >::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::ConfigOptionInt::operator=().

Here is the caller graph for this function:

◆ setInt()

void Slic3r::ConfigOptionInt::setInt ( int val)
inlineoverridevirtual

Reimplemented from Slic3r::ConfigOption.

1028{ this->value = val; }

◆ static_type()

ConfigOptionType Slic3r::ConfigOptionInt::static_type ( )
inlinestatic
1025{ return coInt; }
@ coInt
Definition Config.hpp:188

References Slic3r::coInt.

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

Here is the caller graph for this function:

◆ type()

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

Implements Slic3r::ConfigOption.

1026{ return static_type(); }
static ConfigOptionType static_type()
Definition Config.hpp:1025

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


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