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

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

Inheritance diagram for Slic3r::ConfigOptionFloat:
Collaboration diagram for Slic3r::ConfigOptionFloat:

Public Member Functions

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

double value

Private Member Functions

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

Friends

class cereal::access

Detailed Description

Constructor & Destructor Documentation

◆ ConfigOptionFloat() [1/2]

Slic3r::ConfigOptionFloat::ConfigOptionFloat ( )
inline
ConfigOptionSingle(double value)
Definition Config.hpp:330

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

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

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

◆ ConfigOptionFloat() [2/2]

Slic3r::ConfigOptionFloat::ConfigOptionFloat ( double _value)
inlineexplicit

References Slic3r::ConfigOptionSingle< double >::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::ConfigOptionFloat::clone ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

Reimplemented in Slic3r::ConfigOptionFloatOrPercent, and Slic3r::ConfigOptionPercent.

833{ return new ConfigOptionFloat(*this); }
ConfigOptionFloat()
Definition Config.hpp:827

References ConfigOptionFloat().

Here is the call graph for this function:

◆ deserialize()

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

Implements Slic3r::ConfigOption.

Reimplemented in Slic3r::ConfigOptionFloatOrPercent, and Slic3r::ConfigOptionPercent.

845 {
846 UNUSED(append);
847 std::istringstream iss(str);
848 double value;
849 iss >> value;
850 if (iss.fail())
851 return false;
852 this->value = value;
853 return true;
854 }
double 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(), UNUSED, and Slic3r::ConfigOptionSingle< double >::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()

double Slic3r::ConfigOptionFloat::getFloat ( ) const
inlineoverridevirtual

Reimplemented from Slic3r::ConfigOption.

832{ return this->value; }

Referenced by Slic3r::anonymous_namespace{SL1.cpp}::get_slice_params(), and Slic3r::GUI::ObjectGridTable::GetValueAsDouble().

Here is the caller graph for this function:

◆ getInt()

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

◆ hash()

size_t Slic3r::ConfigOptionSingle< double >::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 double()

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

◆ operator<() [1/2]

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

References ConfigOptionFloat().

Here is the call graph for this function:

◆ operator<() [2/2]

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

◆ operator=()

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

References ConfigOptionFloat(), and Slic3r::ConfigOptionSingle< double >::set().

Here is the call graph for this function:

◆ operator==() [1/2]

bool Slic3r::ConfigOptionFloat::operator== ( const ConfigOption & rhs) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

Reimplemented in Slic3r::ConfigOptionFloatOrPercent, and Slic3r::ConfigOptionPercent.

857 {
858 if (rhs.type() != this->type())
859 throw ConfigurationError("ConfigOptionFloat: Comparing incompatible types");
860 assert(dynamic_cast<const ConfigOptionFloat*>(&rhs));
861 return *this == *static_cast<const ConfigOptionFloat*>(&rhs);
862 }

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

Here is the call graph for this function:

◆ operator==() [2/2]

bool Slic3r::ConfigOptionFloat::operator== ( const ConfigOptionFloat & rhs) const
throw ( )
inline
834{ return is_approx(this->value, rhs.value); }
constexpr bool is_approx(Number value, Number test_value, Number precision=EPSILON)
Definition libslic3r.h:320

References ConfigOptionFloat(), and Slic3r::is_approx().

Here is the call graph for this function:

◆ 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::ConfigOptionFloat::serialize ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

Reimplemented in Slic3r::ConfigOptionFloatOrPercent, and Slic3r::ConfigOptionPercent.

838 {
839 std::ostringstream ss;
840 ss << this->value;
841 return ss.str();
842 }

◆ serialize() [2/2]

template<class Archive>
void Slic3r::ConfigOptionFloat::serialize ( Archive & ar)
inlineprivate
872{ ar(cereal::base_class<ConfigOptionSingle<double>>(this)); }

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

Here is the call graph for this function:

◆ set()

void Slic3r::ConfigOptionSingle< double >::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::ConfigOptionFloat::operator=(), and Slic3r::ConfigOptionPercent::operator=().

Here is the caller graph for this function:

◆ setInt()

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

◆ static_type()

ConfigOptionType Slic3r::ConfigOptionFloat::static_type ( )
inlinestatic
830{ return coFloat; }
@ coFloat
Definition Config.hpp:184

References Slic3r::coFloat.

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

Here is the caller graph for this function:

◆ type()

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

Implements Slic3r::ConfigOption.

Reimplemented in Slic3r::ConfigOptionFloatOrPercent, and Slic3r::ConfigOptionPercent.

831{ return static_type(); }
static ConfigOptionType static_type()
Definition Config.hpp:830

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