Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::ConfigOptionPoint3 Class Reference

#include <src/libslic3r/Config.hpp>

+ Inheritance diagram for Slic3r::ConfigOptionPoint3:
+ Collaboration diagram for Slic3r::ConfigOptionPoint3:

Public Member Functions

 ConfigOptionPoint3 ()
 
 ConfigOptionPoint3 (const Vec3d &value)
 
ConfigOptionType type () const override
 
ConfigOptionclone () const override
 
ConfigOptionPoint3operator= (const ConfigOption *opt)
 
bool operator== (const ConfigOptionPoint3 &rhs) const throw ()
 
bool operator< (const ConfigOptionPoint3 &rhs) const throw ()
 
std::string serialize () const override
 
bool deserialize (const std::string &str, bool append=false) override
 
 operator Vec3d () const
 
void set (const ConfigOption *rhs) override
 
bool operator== (const ConfigOption &rhs) const override
 
bool operator== (const Vec3d &rhs) const throw ()
 
bool operator!= (const Vec3d &rhs) const throw ()
 
bool operator!= (const ConfigOption &rhs) const
 
bool operator< (const Vec3d &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)
 

Static Public Member Functions

static ConfigOptionType static_type ()
 

Public Attributes

Vec3d value
 

Private Member Functions

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

Friends

class cereal::access
 

Detailed Description

Constructor & Destructor Documentation

◆ ConfigOptionPoint3() [1/2]

Slic3r::ConfigOptionPoint3::ConfigOptionPoint3 ( )
inline
1313: ConfigOptionSingle<Vec3d>(Vec3d(0,0,0)) {}
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:52

Referenced by clone().

+ Here is the caller graph for this function:

◆ ConfigOptionPoint3() [2/2]

Slic3r::ConfigOptionPoint3::ConfigOptionPoint3 ( const Vec3d value)
inlineexplicit
1314: ConfigOptionSingle<Vec3d>(value) {}
Vec3d 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()

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

Implements Slic3r::ConfigOption.

1318{ return new ConfigOptionPoint3(*this); }
ConfigOptionPoint3()
Definition Config.hpp:1313

References ConfigOptionPoint3().

+ Here is the call graph for this function:

◆ deserialize()

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

Implements Slic3r::ConfigOption.

1336 {
1337 UNUSED(append);
1338 char dummy;
1339 return sscanf(str.data(), " %lf , %lf , %lf %c", &this->value(0), &this->value(1), &this->value(2), &dummy) == 3 ||
1340 sscanf(str.data(), " %lf x %lf x %lf %c", &this->value(0), &this->value(1), &this->value(2), &dummy) == 3;
1341 }
#define UNUSED(x)
Definition libslic3r.h:74
void append(std::vector< T, Alloc > &dest, const std::vector< T, Alloc2 > &src)
Definition libslic3r.h:110

References Slic3r::append(), and UNUSED.

+ Here is the call graph for this function:

◆ 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()

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

Implements Slic3r::ConfigOption.

329{ return std::hash<T>{}(this->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 Vec3d()

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

◆ operator!=() [1/2]

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

◆ operator!=() [2/2]

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

◆ operator<() [1/2]

bool Slic3r::ConfigOptionPoint3::operator< ( const ConfigOptionPoint3 rhs) const
throw (
)
inline
1322 { return this->value.x() < rhs.value.x() || (this->value.x() == rhs.value.x() && (this->value.y() < rhs.value.y() || (this->value.y() == rhs.value.y() && this->value.z() < rhs.value.z()))); }

◆ operator<() [2/2]

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

◆ operator=()

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

References Slic3r::ConfigOptionSingle< Vec3d >::set().

+ Here is the call graph for this function:

◆ operator==() [1/3]

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

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 }

◆ operator==() [2/3]

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

◆ operator==() [3/3]

bool Slic3r::ConfigOptionSingle< Vec3d >::operator== ( const Vec3d rhs) const
throw (
)
inlineinherited
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]

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

Implements Slic3r::ConfigOption.

1325 {
1326 std::ostringstream ss;
1327 ss << this->value(0);
1328 ss << ",";
1329 ss << this->value(1);
1330 ss << ",";
1331 ss << this->value(2);
1332 return ss.str();
1333 }

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

◆ serialize() [2/2]

template<class Archive >
void Slic3r::ConfigOptionPoint3::serialize ( Archive &  ar)
inlineprivate
1345{ ar(cereal::base_class<ConfigOptionSingle<Vec3d>>(this)); }

◆ set()

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

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 }

◆ 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"); }

◆ static_type()

static ConfigOptionType Slic3r::ConfigOptionPoint3::static_type ( )
inlinestatic
1316{ return coPoint3; }
@ coPoint3
Definition Config.hpp:187

References Slic3r::coPoint3.

Referenced by type().

+ Here is the caller graph for this function:

◆ type()

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

Implements Slic3r::ConfigOption.

1317{ return static_type(); }
static ConfigOptionType static_type()
Definition Config.hpp:1316

References static_type().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ cereal::access

friend class cereal::access
friend

Member Data Documentation

◆ value

Vec3d Slic3r::ConfigOptionSingle< Vec3d >::value
inherited

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