OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GCodeReader::GCodeLine Class Reference

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

Collaboration diagram for Slic3r::GCodeReader::GCodeLine:

Public Member Functions

 GCodeLine ()
void reset ()
const std::string & raw () const
const std::string_view cmd () const
const std::string_view comment () const
std::string_view axis_pos (char axis) const
void clear ()
bool has (Axis axis) const
float value (Axis axis) const
double precise_value (Axis axis) const
bool has (char axis) const
bool has_value (char axis, float &value) const
float new_X (const GCodeReader &reader) const
float new_Y (const GCodeReader &reader) const
float new_Z (const GCodeReader &reader) const
float new_E (const GCodeReader &reader) const
float new_F (const GCodeReader &reader) const
float dist_X (const GCodeReader &reader) const
float dist_Y (const GCodeReader &reader) const
float dist_Z (const GCodeReader &reader) const
float dist_E (const GCodeReader &reader) const
float dist_XY (const GCodeReader &reader) const
bool cmd_is (const char *cmd_test) const
bool extruding (const GCodeReader &reader) const
bool retracting (const GCodeReader &reader) const
bool travel () const
void set (const Axis axis, const float new_value, const int decimal_digits=3)
bool has_x () const
bool has_y () const
bool has_z () const
bool has_e () const
bool has_f () const
bool has_i () const
bool has_j () const
bool has_p () const
bool has_unknown_axis () const
float x () const
float y () const
float z () const
float e () const
float f () const
float i () const
float j () const
float p () const

Static Public Member Functions

static bool has_value (std::string_view axis_pos, float &value)
static bool cmd_is (const std::string &gcode_line, const char *cmd_test)
static bool cmd_starts_with (const std::string &gcode_line, const char *cmd_test)
static std::string extract_cmd (const std::string &gcode_line)

Private Attributes

std::string m_raw
double m_axis [NUM_AXES]
uint32_t m_mask

Friends

class GCodeReader

Detailed Description

Constructor & Destructor Documentation

◆ GCodeLine()

Slic3r::GCodeReader::GCodeLine::GCodeLine ( )
inline
23{ reset(); }
void reset()
Definition GCodeReader.hpp:24

References reset().

Referenced by extract_cmd().

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

Member Function Documentation

◆ axis_pos()

std::string_view Slic3r::GCodeReader::GCodeLine::axis_pos ( char axis) const
294{
295 const std::string &s = this->raw();
296 const char *c = GCodeReader::axis_pos(this->raw().c_str(), axis);
297 return c ? std::string_view{ c, s.size() - (c - s.data()) } : std::string_view();
298}
const std::string & raw() const
Definition GCodeReader.hpp:26
static const char * axis_pos(const char *raw_str, char axis)
Definition GCodeReader.cpp:249

References Slic3r::GCodeReader::axis_pos(), and raw().

Referenced by has_value(), and Slic3r::GCodeProcessor::process_G2_G3().

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

◆ clear()

void Slic3r::GCodeReader::GCodeLine::clear ( )
inline
36{ m_raw.clear(); }
std::string m_raw
Definition GCodeReader.hpp:103

References m_raw.

Referenced by Slic3r::SpiralVase::process_layer().

Here is the caller graph for this function:

◆ cmd()

const std::string_view Slic3r::GCodeReader::GCodeLine::cmd ( ) const
inline
27 {
28 const char *cmd = GCodeReader::skip_whitespaces(m_raw.c_str());
29 return std::string_view(cmd, GCodeReader::skip_word(cmd) - cmd);
30 }
const std::string_view cmd() const
Definition GCodeReader.hpp:27
static const char * skip_word(const char *c)
Definition GCodeReader.hpp:198
static const char * skip_whitespaces(const char *c)
Definition GCodeReader.hpp:193

References cmd(), m_raw, Slic3r::GCodeReader::skip_whitespaces(), and Slic3r::GCodeReader::skip_word().

Referenced by Slic3r::FanMover::_process_gcode_line(), cmd(), cmd_is(), Slic3r::custom_gcode_motion_state_changes(), extract_cmd(), Slic3r::GCodeProcessor::process_G28(), Slic3r::GCodeProcessor::process_gcode_line(), and Slic3r::GCodeProcessor::process_T().

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

◆ cmd_is() [1/2]

bool Slic3r::GCodeReader::GCodeLine::cmd_is ( const char * cmd_test) const
inline
58{ return cmd_is(m_raw, cmd_test); }
bool cmd_is(const char *cmd_test) const
Definition GCodeReader.hpp:58

References cmd_is(), and m_raw.

Referenced by cmd_is(), Slic3r::anonymous_namespace{GCode.cpp}::emitted_xy_after_gcode(), extruding(), Slic3r::SpiralVase::process_layer(), retracting(), Slic3r::GCodeProcessor::run_post_process(), travel(), and Slic3r::ExportLines::update().

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

◆ cmd_is() [2/2]

bool Slic3r::GCodeReader::GCodeLine::cmd_is ( const std::string & gcode_line,
const char * cmd_test )
inlinestatic
86 {
87 const char *cmd = GCodeReader::skip_whitespaces(gcode_line.c_str());
88 size_t len = strlen(cmd_test);
89 return strncmp(cmd, cmd_test, len) == 0 && GCodeReader::is_end_of_word(cmd[len]);
90 }
static bool is_end_of_word(char c)
Definition GCodeReader.hpp:192

References cmd(), Slic3r::GCodeReader::is_end_of_word(), and Slic3r::GCodeReader::skip_whitespaces().

Here is the call graph for this function:

◆ cmd_starts_with()

bool Slic3r::GCodeReader::GCodeLine::cmd_starts_with ( const std::string & gcode_line,
const char * cmd_test )
inlinestatic
92 {
93 return strncmp(GCodeReader::skip_whitespaces(gcode_line.c_str()), cmd_test, strlen(cmd_test)) == 0;
94 }

References Slic3r::GCodeReader::skip_whitespaces().

Referenced by Slic3r::GCodeProcessor::run_post_process().

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

◆ comment()

const std::string_view Slic3r::GCodeReader::GCodeLine::comment ( ) const
inline
32 { size_t pos = m_raw.find(';'); return (pos == std::string::npos) ? std::string_view() : std::string_view(m_raw).substr(pos + 1); }
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16

References m_raw.

◆ dist_E()

float Slic3r::GCodeReader::GCodeLine::dist_E ( const GCodeReader & reader) const
inline
52{ return this->has(E) ? (this->e() - reader.e()) : 0; }
bool has(Axis axis) const
Definition GCodeReader.hpp:37
float e() const
Definition GCodeReader.hpp:79
@ E
Definition libslic3r.h:144

References Slic3r::E, Slic3r::GCodeReader::e(), e(), GCodeReader, and has().

Referenced by Slic3r::FanMover::_process_gcode_line(), extruding(), and retracting().

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

◆ dist_X()

float Slic3r::GCodeReader::GCodeLine::dist_X ( const GCodeReader & reader) const
inline
49{ return this->has(X) ? (this->x() - reader.x()) : 0; }
float x() const
Definition GCodeReader.hpp:76
@ X
Definition libslic3r.h:141

References GCodeReader, has(), Slic3r::X, x(), and Slic3r::GCodeReader::x().

Referenced by Slic3r::FanMover::_process_gcode_line().

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

◆ dist_XY()

float Slic3r::GCodeReader::GCodeLine::dist_XY ( const GCodeReader & reader) const
inline
53 {
54 float x = this->has(X) ? (this->x() - reader.x()) : 0;
55 float y = this->has(Y) ? (this->y() - reader.y()) : 0;
56 return sqrt(x*x + y*y);
57 }
float y() const
Definition GCodeReader.hpp:77
@ Y
Definition libslic3r.h:142

References GCodeReader, has(), Slic3r::X, x(), Slic3r::GCodeReader::x(), Slic3r::Y, y(), and Slic3r::GCodeReader::y().

Referenced by Slic3r::SpiralVase::process_layer().

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

◆ dist_Y()

float Slic3r::GCodeReader::GCodeLine::dist_Y ( const GCodeReader & reader) const
inline
50{ return this->has(Y) ? (this->y() - reader.y()) : 0; }

References GCodeReader, has(), Slic3r::Y, y(), and Slic3r::GCodeReader::y().

Referenced by Slic3r::FanMover::_process_gcode_line().

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

◆ dist_Z()

float Slic3r::GCodeReader::GCodeLine::dist_Z ( const GCodeReader & reader) const
inline
51{ return this->has(Z) ? (this->z() - reader.z()) : 0; }
float z() const
Definition GCodeReader.hpp:78
@ Z
Definition libslic3r.h:143

References GCodeReader, has(), Slic3r::Z, z(), and Slic3r::GCodeReader::z().

Referenced by Slic3r::FanMover::_process_gcode_line(), and Slic3r::SpiralVase::process_layer().

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

◆ e()

float Slic3r::GCodeReader::GCodeLine::e ( ) const
inline
79{ return float(m_axis[E]); }
double m_axis[NUM_AXES]
Definition GCodeReader.hpp:104

References Slic3r::E, and m_axis.

Referenced by Slic3r::FanMover::_process_gcode_line(), dist_E(), new_E(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G92(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().

Here is the caller graph for this function:

◆ extract_cmd()

std::string Slic3r::GCodeReader::GCodeLine::extract_cmd ( const std::string & gcode_line)
inlinestatic
96 {
97 GCodeLine temp;
98 temp.m_raw = gcode_line;
99 const std::string_view cmd = temp.cmd();
100 return { cmd.begin(), cmd.end() };
101 }
GCodeLine()
Definition GCodeReader.hpp:23

References GCodeLine(), cmd(), and m_raw.

Referenced by Slic3r::ExportLines::insert_lines(), and Slic3r::GCodeProcessor::run_post_process().

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

◆ extruding()

bool Slic3r::GCodeReader::GCodeLine::extruding ( const GCodeReader & reader) const
inline
60{ return (this->cmd_is("G1") || this->cmd_is("G2") || this->cmd_is("G3")) && this->dist_E(reader) > 0; }
float dist_E(const GCodeReader &reader) const
Definition GCodeReader.hpp:52

References cmd_is(), dist_E(), and GCodeReader.

Referenced by Slic3r::SpiralVase::process_layer().

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

◆ f()

float Slic3r::GCodeReader::GCodeLine::f ( ) const
inline
80{ return float(m_axis[F]); }
@ F
Definition libslic3r.h:145

References Slic3r::F, and m_axis.

Referenced by Slic3r::FanMover::_process_gcode_line(), new_F(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G2_G3(), and Slic3r::GCodeProcessor::process_VG1().

Here is the caller graph for this function:

◆ has() [1/2]

◆ has() [2/2]

bool Slic3r::GCodeReader::GCodeLine::has ( char axis) const
272{
273 const char *c = m_raw.c_str();
274 // Skip the whitespaces.
275 c = skip_whitespaces(c);
276 // Skip the command.
277 c = skip_word(c);
278 // Up to the end of line or comment.
279 while (! is_end_of_gcode_line(*c)) {
280 // Skip whitespaces.
281 c = skip_whitespaces(c);
282 if (is_end_of_gcode_line(*c))
283 break;
284 // Check the name of the axis.
285 if (*c == axis)
286 return true;
287 // Skip the rest of the word.
288 c = skip_word(c);
289 }
290 return false;
291}
static bool is_end_of_gcode_line(char c)
Definition GCodeReader.hpp:191

References Slic3r::GCodeReader::is_end_of_gcode_line(), m_raw, Slic3r::GCodeReader::skip_whitespaces(), and Slic3r::GCodeReader::skip_word().

Here is the call graph for this function:

◆ has_e()

bool Slic3r::GCodeReader::GCodeLine::has_e ( ) const
inline
68{ return this->has(E); }

References Slic3r::E, and has().

Referenced by Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G2_G3(), Slic3r::GCodeProcessor::process_G92(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().

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

◆ has_f()

bool Slic3r::GCodeReader::GCodeLine::has_f ( ) const
inline
69{ return this->has(F); }

References Slic3r::F, and has().

Referenced by Slic3r::FanMover::_process_gcode_line(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G2_G3(), and Slic3r::GCodeProcessor::process_VG1().

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

◆ has_i()

bool Slic3r::GCodeReader::GCodeLine::has_i ( ) const
inline
71{ return this->has(I); }
@ I
Definition libslic3r.h:147

References has(), and Slic3r::I.

Here is the call graph for this function:

◆ has_j()

bool Slic3r::GCodeReader::GCodeLine::has_j ( ) const
inline
72{ return this->has(J); }
@ J
Definition libslic3r.h:148

References has(), and Slic3r::J.

Here is the call graph for this function:

◆ has_p()

bool Slic3r::GCodeReader::GCodeLine::has_p ( ) const
inline
73{ return this->has(P); }
@ P
Definition libslic3r.h:149

References has(), and Slic3r::P.

Here is the call graph for this function:

◆ has_unknown_axis()

bool Slic3r::GCodeReader::GCodeLine::has_unknown_axis ( ) const
inline
75{ return this->has(UNKNOWN_AXIS); }
@ UNKNOWN_AXIS
Definition libslic3r.h:152

References has(), and Slic3r::UNKNOWN_AXIS.

Referenced by Slic3r::GCodeProcessor::process_G92().

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

◆ has_value() [1/2]

bool Slic3r::GCodeReader::GCodeLine::has_value ( char axis,
float & value ) const
317{
319 const char *c = m_raw.c_str();
320 // Skip the whitespaces.
321 c = skip_whitespaces(c);
322 // Skip the command.
323 c = skip_word(c);
324 // Up to the end of line or comment.
325 while (! is_end_of_gcode_line(*c)) {
326 // Skip whitespaces.
327 c = skip_whitespaces(c);
328 if (is_end_of_gcode_line(*c))
329 break;
330 // Check the name of the axis.
331 if (*c == axis) {
332 // Try to parse the numeric value.
333 char *pend = nullptr;
334 double v = strtod(++ c, &pend);
335 if (pend != nullptr && is_end_of_word(*pend)) {
336 // The axis value has been parsed correctly.
337 value = float(v);
338 return true;
339 }
340 }
341 // Skip the rest of the word.
342 c = skip_word(c);
343 }
344 return false;
345}
float value(Axis axis) const
Definition GCodeReader.hpp:38
bool is_decimal_separator_point()
Definition LocalesUtils.cpp:78

References Slic3r::is_decimal_separator_point(), Slic3r::GCodeReader::is_end_of_gcode_line(), Slic3r::GCodeReader::is_end_of_word(), m_raw, Slic3r::GCodeReader::skip_whitespaces(), Slic3r::GCodeReader::skip_word(), and value().

Referenced by Slic3r::anonymous_namespace{ElegooGCodeProcessorHelper.cpp}::get_clamped_param(), Slic3r::GCodeProcessor::process_elegoo_M6211(), Slic3r::GCodeProcessor::process_G2_G3(), Slic3r::GCodeProcessor::process_G4(), Slic3r::GCodeProcessor::process_M1020(), Slic3r::GCodeProcessor::process_M104(), Slic3r::GCodeProcessor::process_M106(), Slic3r::GCodeProcessor::process_M109(), Slic3r::GCodeProcessor::process_M140(), Slic3r::GCodeProcessor::process_M190(), Slic3r::GCodeProcessor::process_M191(), Slic3r::GCodeProcessor::process_M204(), Slic3r::GCodeProcessor::process_M205(), Slic3r::GCodeProcessor::process_M221(), Slic3r::GCodeProcessor::process_M400(), Slic3r::GCodeProcessor::process_M402(), Slic3r::GCodeProcessor::process_M572(), Slic3r::GCodeProcessor::process_M622(), Slic3r::GCodeProcessor::process_M900(), Slic3r::GCodeProcessor::process_SYNC(), Slic3r::GCodeProcessor::process_T(), and Slic3r::GCodeProcessor::run_post_process().

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

◆ has_value() [2/2]

bool Slic3r::GCodeReader::GCodeLine::has_value ( std::string_view axis_pos,
float & value )
static
301{
302 if (const char *c = axis_pos.data(); c) {
303 // Try to parse the numeric value.
304 double v = 0.;
305 const char *end = axis_pos.data() + axis_pos.size();
306 auto [pend, ec] = fast_float::from_chars(++ c, end, v);
307 if (pend != c && is_end_of_word(*pend)) {
308 // The axis value has been parsed correctly.
309 value = float(v);
310 return true;
311 }
312 }
313 return false;
314}
std::string_view axis_pos(char axis) const
Definition GCodeReader.cpp:293
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:841

References axis_pos(), Slic3r::GCodeReader::is_end_of_word(), and value().

Here is the call graph for this function:

◆ has_x()

bool Slic3r::GCodeReader::GCodeLine::has_x ( ) const
inline
65{ return this->has(X); }

References has(), and Slic3r::X.

Referenced by Slic3r::anonymous_namespace{GCode.cpp}::emitted_xy_after_gcode(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G92(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().

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

◆ has_y()

bool Slic3r::GCodeReader::GCodeLine::has_y ( ) const
inline
66{ return this->has(Y); }

References has(), and Slic3r::Y.

Referenced by Slic3r::anonymous_namespace{GCode.cpp}::emitted_xy_after_gcode(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G92(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().

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

◆ has_z()

bool Slic3r::GCodeReader::GCodeLine::has_z ( ) const
inline
67{ return this->has(Z); }

References has(), and Slic3r::Z.

Referenced by Slic3r::anonymous_namespace{GCode.cpp}::emitted_xy_after_gcode(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G92(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().

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

◆ i()

float Slic3r::GCodeReader::GCodeLine::i ( ) const
inline
82{ return float(m_axis[I]); }

References Slic3r::I, and m_axis.

◆ j()

float Slic3r::GCodeReader::GCodeLine::j ( ) const
inline
83{ return float(m_axis[J]); }

References Slic3r::J, and m_axis.

◆ new_E()

float Slic3r::GCodeReader::GCodeLine::new_E ( const GCodeReader & reader) const
inline
47{ return this->has(E) ? this->e() : reader.e(); }

References Slic3r::E, Slic3r::GCodeReader::e(), e(), GCodeReader, and has().

Here is the call graph for this function:

◆ new_F()

float Slic3r::GCodeReader::GCodeLine::new_F ( const GCodeReader & reader) const
inline
48{ return this->has(F) ? this->f() : reader.f(); }
float f() const
Definition GCodeReader.hpp:80

References Slic3r::F, Slic3r::GCodeReader::f(), f(), GCodeReader, and has().

Here is the call graph for this function:

◆ new_X()

float Slic3r::GCodeReader::GCodeLine::new_X ( const GCodeReader & reader) const
inline
44{ return this->has(X) ? this->x() : reader.x(); }

References GCodeReader, has(), Slic3r::X, x(), and Slic3r::GCodeReader::x().

Here is the call graph for this function:

◆ new_Y()

float Slic3r::GCodeReader::GCodeLine::new_Y ( const GCodeReader & reader) const
inline
45{ return this->has(Y) ? this->y() : reader.y(); }

References GCodeReader, has(), Slic3r::Y, y(), and Slic3r::GCodeReader::y().

Here is the call graph for this function:

◆ new_Z()

float Slic3r::GCodeReader::GCodeLine::new_Z ( const GCodeReader & reader) const
inline
46{ return this->has(Z) ? this->z() : reader.z(); }

References GCodeReader, has(), Slic3r::Z, z(), and Slic3r::GCodeReader::z().

Referenced by Slic3r::SpiralVase::process_layer().

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

◆ p()

float Slic3r::GCodeReader::GCodeLine::p ( ) const
inline
84{ return float(m_axis[P]); }

References m_axis, and Slic3r::P.

Referenced by Slic3r::GCodeProcessor::process_M106().

Here is the caller graph for this function:

◆ precise_value()

double Slic3r::GCodeReader::GCodeLine::precise_value ( Axis axis) const
inline
39{ return m_axis[axis]; }

References m_axis.

Referenced by Slic3r::GCodeProcessor::extract_absolute_position_on_axis(), and Slic3r::GCodeProcessor::process_G1().

Here is the caller graph for this function:

◆ raw()

◆ reset()

void Slic3r::GCodeReader::GCodeLine::reset ( )
inline
24{ m_mask = 0; memset(m_axis, 0, sizeof(m_axis)); m_raw.clear(); }

References m_axis, m_mask, and m_raw.

Referenced by GCodeLine(), Slic3r::GCodeReader::parse_buffer(), and Slic3r::GCodeReader::parse_file_internal().

Here is the caller graph for this function:

◆ retracting()

bool Slic3r::GCodeReader::GCodeLine::retracting ( const GCodeReader & reader) const
inline
61{ return (this->cmd_is("G1") || this->cmd_is("G2") || this->cmd_is("G3")) && this->dist_E(reader) < 0; }

References cmd_is(), dist_E(), and GCodeReader.

Referenced by Slic3r::SpiralVase::process_layer().

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

◆ set()

void Slic3r::GCodeReader::GCodeLine::set ( const Axis axis,
const float new_value,
const int decimal_digits = 3 )
348{
349 std::ostringstream ss;
350 ss << std::fixed << std::setprecision(decimal_digits) << new_value;
351
352 char match[3] = " X";
353 if (int(axis) < 3)
354 match[1] += int(axis);
355 else if (axis == F)
356 match[1] = 'F';
357 //BBS: handle I and J axis
358 else if (axis == I)
359 match[1] = 'I';
360 else if (axis == J)
361 match[1] = 'J';
362 else {
363 assert(axis == E);
364 match[1] = 'E';
365 }
366
367 if (this->has(axis)) {
368 size_t pos = m_raw.find(match)+2;
369 size_t end = m_raw.find(' ', pos+1);
370 m_raw = m_raw.replace(pos, end-pos, ss.str());
371 } else {
372 size_t pos = m_raw.find(' ');
373 if (pos == std::string::npos)
374 m_raw += std::string(match) + ss.str();
375 else
376 m_raw = m_raw.replace(pos, 0, std::string(match) + ss.str());
377 }
378 m_axis[axis] = new_value;
379 m_mask |= 1 << int(axis);
380}

References Slic3r::E, Slic3r::F, has(), Slic3r::I, Slic3r::J, m_axis, m_mask, and m_raw.

Referenced by Slic3r::GCodeProcessor::process_G10(), Slic3r::GCodeProcessor::process_G11(), and Slic3r::SpiralVase::process_layer().

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

◆ travel()

bool Slic3r::GCodeReader::GCodeLine::travel ( ) const
inline
62{ return (this->cmd_is("G1") || this->cmd_is("G2") || this->cmd_is("G3")) && ! this->has(E); }

References cmd_is(), Slic3r::E, and has().

Here is the call graph for this function:

◆ value()

float Slic3r::GCodeReader::GCodeLine::value ( Axis axis) const
inline
38{ return float(m_axis[axis]); }

References m_axis.

Referenced by has_value(), has_value(), and Slic3r::GCodeReader::update_coordinates().

Here is the caller graph for this function:

◆ x()

float Slic3r::GCodeReader::GCodeLine::x ( ) const
inline

◆ y()

float Slic3r::GCodeReader::GCodeLine::y ( ) const
inline

◆ z()

float Slic3r::GCodeReader::GCodeLine::z ( ) const
inline
78{ return float(m_axis[Z]); }

References m_axis, and Slic3r::Z.

Referenced by dist_Z(), new_Z(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G92(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().

Here is the caller graph for this function:

◆ GCodeReader

friend class GCodeReader
friend

Member Data Documentation

◆ m_axis

double Slic3r::GCodeReader::GCodeLine::m_axis[NUM_AXES]
private

◆ m_mask

uint32_t Slic3r::GCodeReader::GCodeLine::m_mask
private

◆ m_raw

std::string Slic3r::GCodeReader::GCodeLine::m_raw
private

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