OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::CustomGCode::Item Struct Reference

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

Collaboration diagram for Slic3r::CustomGCode::Item:

Public Member Functions

bool operator< (const Item &rhs) const
bool operator== (const Item &rhs) const
bool operator!= (const Item &rhs) const
void from_json (const nlohmann::json &j)

Public Attributes

double print_z
Type type
int extruder
std::string color
std::string extra

Detailed Description

Member Function Documentation

◆ from_json()

void Slic3r::CustomGCode::Item::from_json ( const nlohmann::json & j)
14 {
15 std::string type_str;
16 j.at("type").get_to(type_str);
17 std::map<std::string,Type> str2type = { {"ColorChange", ColorChange },
18 {"PausePrint",PausePrint},
19 {"ToolChange",ToolChange},
20 {"Template",Template},
21 {"Custom",Custom},
22 {"Unknown",Unknown} };
23 type = Unknown;
24 if (str2type.find(type_str) != str2type.end())
25 type = str2type[type_str];
26 j.at("print_z").get_to(print_z);
27 j.at("color").get_to(color);
28 j.at("extruder").get_to(extruder);
29 if(j.contains("extra"))
30 j.at("extra").get_to(extra);
31}
@ PausePrint
Definition CustomGCode.hpp:20
@ ToolChange
Definition CustomGCode.hpp:21
@ Template
Definition CustomGCode.hpp:22
@ Custom
Definition CustomGCode.hpp:23
@ ColorChange
Definition CustomGCode.hpp:19
@ Unknown
Definition CustomGCode.hpp:24
std::string extra
Definition CustomGCode.hpp:47
double print_z
Definition CustomGCode.hpp:40
int extruder
Definition CustomGCode.hpp:42
Type type
Definition CustomGCode.hpp:41
std::string color
Definition CustomGCode.hpp:45

References color, Slic3r::CustomGCode::ColorChange, Slic3r::CustomGCode::Custom, extra, extruder, Slic3r::CustomGCode::PausePrint, print_z, Slic3r::CustomGCode::Template, Slic3r::CustomGCode::ToolChange, type, and Slic3r::CustomGCode::Unknown.

Referenced by Slic3r::CustomGCode::Info::from_json().

Here is the caller graph for this function:

◆ operator!=()

bool Slic3r::CustomGCode::Item::operator!= ( const Item & rhs) const
inline
38{ return ! (*this == rhs); }

◆ operator<()

bool Slic3r::CustomGCode::Item::operator< ( const Item & rhs) const
inline
29{ return this->print_z < rhs.print_z; }

References print_z.

◆ operator==()

bool Slic3r::CustomGCode::Item::operator== ( const Item & rhs) const
inline
31 {
32 return (rhs.print_z == this->print_z ) &&
33 (rhs.type == this->type ) &&
34 (rhs.extruder == this->extruder ) &&
35 (rhs.color == this->color ) &&
36 (rhs.extra == this->extra );
37 }

References color, extra, extruder, print_z, and type.

Member Data Documentation

◆ color

◆ extra

◆ extruder

◆ print_z

◆ type


The documentation for this struct was generated from the following files: