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

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

Inheritance diagram for Slic3r::ConfigOptionPoint:
Collaboration diagram for Slic3r::ConfigOptionPoint:

Public Member Functions

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

Vec2d value

Private Member Functions

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

Friends

class cereal::access

Detailed Description

Constructor & Destructor Documentation

◆ ConfigOptionPoint() [1/2]

Slic3r::ConfigOptionPoint::ConfigOptionPoint ( )
inline
ConfigOptionSingle(Vec2d value)
Definition Config.hpp:330
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67

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

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

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

◆ ConfigOptionPoint() [2/2]

Slic3r::ConfigOptionPoint::ConfigOptionPoint ( const Vec2d & value)
inlineexplicit
Vec2d value
Definition Config.hpp:329

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

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::ConfigOptionPoint::clone ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1542{ return new ConfigOptionPoint(*this); }
ConfigOptionPoint()
Definition Config.hpp:1537

References ConfigOptionPoint().

Here is the call graph for this function:

◆ deserialize()

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

Implements Slic3r::ConfigOption.

1558 {
1559 UNUSED(append);
1560 char dummy;
1561 Vec2d value;
1562 if (sscanf(str.data(), " %lf , %lf %c", &value(0), &value(1), &dummy) != 2 &&
1563 sscanf(str.data(), " %lf x %lf %c", &value(0), &value(1), &dummy) != 2)
1564 return false;
1565 this->value = value;
1566 return true;
1567 }
#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< Vec2d >::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()

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

◆ hash()

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

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

◆ operator<() [1/2]

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

References ConfigOptionPoint().

Here is the call graph for this function:

◆ operator<() [2/2]

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

◆ operator=()

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

References ConfigOptionPoint(), and Slic3r::ConfigOptionSingle< Vec2d >::set().

Here is the call graph for this function:

◆ operator==() [1/2]

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

References ConfigOptionPoint().

Here is the call graph for this function:

◆ operator==() [2/2]

bool Slic3r::ConfigOptionSingle< Vec2d >::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::ConfigOptionPoint::serialize ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1549 {
1550 std::ostringstream ss;
1551 ss << this->value(0);
1552 ss << ",";
1553 ss << this->value(1);
1554 return ss.str();
1555 }

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

Referenced by Slic3r::GUI::BedShape::get_full_name_with_params().

Here is the caller graph for this function:

◆ serialize() [2/2]

template<class Archive>
void Slic3r::ConfigOptionPoint::serialize ( Archive & ar)
inlineprivate
1571{ ar(cereal::base_class<ConfigOptionSingle<Vec2d>>(this)); }

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

Here is the call graph for this function:

◆ set()

void Slic3r::ConfigOptionSingle< Vec2d >::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::ConfigOptionPoint::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::ConfigOptionPoint::static_type ( )
inlinestatic
1540{ return coPoint; }
@ coPoint
Definition Config.hpp:204

References Slic3r::coPoint.

Referenced by type().

Here is the caller graph for this function:

◆ type()

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

Implements Slic3r::ConfigOption.

1541{ return static_type(); }
static ConfigOptionType static_type()
Definition Config.hpp:1540

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