MeshLib C Docs
Loading...
Searching...
No Matches
MRGcodeProcessor.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMisc/common.h>
4#include <MRCMisc/exports.h>
5
6#include <stdbool.h>
7#include <stddef.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef struct MR_CNCMachineSettings MR_CNCMachineSettings; // Defined in `#include <MRCMesh/MRCNCMachineSettings.h>`.
14typedef struct MR_std_string MR_std_string; // Defined in `#include <MRCMisc/std_string.h>`.
15typedef struct MR_std_vector_MR_GcodeProcessor_Command MR_std_vector_MR_GcodeProcessor_Command; // Defined in `#include <MRCMisc/std_vector_MR_GcodeProcessor_Command.h>`.
16typedef struct MR_std_vector_MR_GcodeProcessor_MoveAction MR_std_vector_MR_GcodeProcessor_MoveAction; // Defined in `#include <MRCMisc/std_vector_MR_GcodeProcessor_MoveAction.h>`.
17typedef struct MR_std_vector_MR_Vector2f MR_std_vector_MR_Vector2f; // Defined in `#include <MRCMisc/std_vector_MR_Vector2f.h>`.
18typedef struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f; // Defined in `#include <MRCMisc/std_vector_MR_Vector3f.h>`.
19typedef struct MR_std_vector_std_string MR_std_vector_std_string; // Defined in `#include <MRCMisc/std_vector_std_string.h>`.
20
21
25
29
30// structure that stores information about the movement of the tool, specified by some string of commands
34
38
39// class to process g-code source and generate toolpath
43
47
52
55
58
62
65
68
73
74// reset internal states
78
79// set g-code source
84
85// process all lines g-code source and generate corresponding move actions
90
91// process all commands from one line g-code source and generate corresponding move action;
92// \param externalStorage to avoid memory allocation on each line
100
101// settings
106
111
112// tool movement parsed from gcode
117
118// tool movement parsed from gcode
122
123// tool movement parsed from gcode
128
129// parser warning
134
135// parser warning
141
142// parser warning
147
151
156
162
165
168
172
175
178
183
184// tool movement parsed from gcode
189
190// tool movement parsed from gcode
194
195// tool movement parsed from gcode
200
201// parser warning
206
207// parser warning
213
214// parser warning
219
223
228
234
237
240
244
247
250
255
260
264
269
270// tool direction for each point from action.path
275
276// tool direction for each point from action.path
280
281// tool direction for each point from action.path
286
291
295
300
305
309
314
318
323
327
330
333
337
340
343
347
352
353// return true if operation was parsed without warnings
357
358// in lowercase
363
364// in lowercase
368
369// in lowercase
374
379
383
388
392
397
401
404
407
412
415
418
424
425#ifdef __cplusplus
426} // extern "C"
427#endif
struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
Definition MRBestFit.h:25
struct MR_CNCMachineSettings MR_CNCMachineSettings
Definition MRCNCMachineSettings.h:30
struct MR_std_vector_MR_Vector2f MR_std_vector_MR_Vector2f
Definition MRContour.h:11
struct MR_std_string MR_std_string
Definition MRCtm.h:32
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_AssignFromAnother(MR_GcodeProcessor_BaseAction_MR_Vector3f *_this, MR_PassBy _other_pass_by, MR_GcodeProcessor_BaseAction_MR_Vector3f *_other)
MRC_API MR_GcodeProcessor * MR_GcodeProcessor_ConstructFromAnother(MR_PassBy _other_pass_by, MR_GcodeProcessor *_other)
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_OffsetMutablePtr(MR_GcodeProcessor_BaseAction_MR_Vector3f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
struct MR_GcodeProcessor_BaseAction_MR_Vector3f MR_GcodeProcessor_BaseAction_MR_Vector3f
Definition MRGcodeProcessor.h:28
MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector3f_Set_path(MR_GcodeProcessor_BaseAction_MR_Vector3f *_this, MR_PassBy value_pass_by, MR_std_vector_MR_Vector3f *value)
struct MR_GcodeProcessor_BaseAction_MR_Vector2f MR_GcodeProcessor_BaseAction_MR_Vector2f
Definition MRGcodeProcessor.h:24
MRC_API MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_MoveAction_DefaultConstructArray(size_t num_elems)
MRC_API MR_GcodeProcessor_Command * MR_GcodeProcessor_Command_AssignFromAnother(MR_GcodeProcessor_Command *_this, const MR_GcodeProcessor_Command *_other)
struct MR_GcodeProcessor_MoveAction MR_GcodeProcessor_MoveAction
Definition MRGcodeProcessor.h:33
MRC_API const MR_std_vector_MR_Vector3f * MR_GcodeProcessor_MoveAction_Get_toolDirection(const MR_GcodeProcessor_MoveAction *_this)
MRC_API const MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_OffsetPtr(const MR_GcodeProcessor_BaseAction_MR_Vector3f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_MoveAction_GetMutable_action(MR_GcodeProcessor_MoveAction *_this)
MRC_API MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_MoveAction_DefaultConstruct(void)
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_DefaultConstructArray(size_t num_elems)
MRC_API const float * MR_GcodeProcessor_Command_Get_value(const MR_GcodeProcessor_Command *_this)
MRC_API MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_MoveAction_AssignFromAnother(MR_GcodeProcessor_MoveAction *_this, MR_PassBy _other_pass_by, MR_GcodeProcessor_MoveAction *_other)
MRC_API MR_std_vector_MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_processSource(MR_GcodeProcessor *_this)
struct MR_GcodeProcessor_Command MR_GcodeProcessor_Command
Definition MRGcodeProcessor.h:37
MRC_API void MR_GcodeProcessor_MoveAction_Destroy(const MR_GcodeProcessor_MoveAction *_this)
Destroys a heap-allocated instance of MR_GcodeProcessor_MoveAction. Does nothing if the pointer is nu...
MRC_API MR_GcodeProcessor_Command * MR_GcodeProcessor_Command_DefaultConstruct(void)
MRC_API void MR_GcodeProcessor_Command_Set_value(MR_GcodeProcessor_Command *_this, float value)
MRC_API const bool * MR_GcodeProcessor_MoveAction_Get_idle(const MR_GcodeProcessor_MoveAction *_this)
MRC_API MR_GcodeProcessor * MR_GcodeProcessor_DefaultConstructArray(size_t num_elems)
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_DefaultConstruct(void)
MRC_API bool MR_GcodeProcessor_MoveAction_ConvertTo_bool(const MR_GcodeProcessor_MoveAction *_this)
MRC_API float * MR_GcodeProcessor_Command_GetMutable_value(MR_GcodeProcessor_Command *_this)
MRC_API MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_MoveAction_ConstructFrom(MR_PassBy action_pass_by, MR_GcodeProcessor_BaseAction_MR_Vector3f *action, MR_PassBy toolDirection_pass_by, MR_std_vector_MR_Vector3f *toolDirection, bool idle, float feedrate)
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_ConstructFromAnother(MR_PassBy _other_pass_by, MR_GcodeProcessor_BaseAction_MR_Vector2f *_other)
MRC_API MR_GcodeProcessor * MR_GcodeProcessor_DefaultConstruct(void)
MRC_API const MR_std_string * MR_GcodeProcessor_BaseAction_MR_Vector2f_Get_warning(const MR_GcodeProcessor_BaseAction_MR_Vector2f *_this)
struct MR_std_vector_MR_GcodeProcessor_Command MR_std_vector_MR_GcodeProcessor_Command
Definition MRGcodeProcessor.h:15
MRC_API void MR_GcodeProcessor_MoveAction_Set_action(MR_GcodeProcessor_MoveAction *_this, MR_PassBy value_pass_by, MR_GcodeProcessor_BaseAction_MR_Vector3f *value)
MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector3f_Destroy(const MR_GcodeProcessor_BaseAction_MR_Vector3f *_this)
Destroys a heap-allocated instance of MR_GcodeProcessor_BaseAction_MR_Vector3f. Does nothing if the p...
MRC_API const MR_std_vector_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_Get_path(const MR_GcodeProcessor_BaseAction_MR_Vector2f *_this)
MRC_API bool * MR_GcodeProcessor_MoveAction_GetMutable_idle(MR_GcodeProcessor_MoveAction *_this)
MRC_API MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_MoveAction_ConstructFromAnother(MR_PassBy _other_pass_by, MR_GcodeProcessor_MoveAction *_other)
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_ConstructFromAnother(MR_PassBy _other_pass_by, MR_GcodeProcessor_BaseAction_MR_Vector3f *_other)
MRC_API void MR_GcodeProcessor_Command_Destroy(const MR_GcodeProcessor_Command *_this)
Destroys a heap-allocated instance of MR_GcodeProcessor_Command. Does nothing if the pointer is null.
MRC_API const MR_GcodeProcessor_Command * MR_GcodeProcessor_Command_OffsetPtr(const MR_GcodeProcessor_Command *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_std_vector_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_GetMutable_path(MR_GcodeProcessor_BaseAction_MR_Vector2f *_this)
MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector3f_DestroyArray(const MR_GcodeProcessor_BaseAction_MR_Vector3f *_this)
Destroys a heap-allocated array of MR_GcodeProcessor_BaseAction_MR_Vector3f. Does nothing if the poin...
MRC_API void MR_GcodeProcessor_MoveAction_Set_toolDirection(MR_GcodeProcessor_MoveAction *_this, MR_PassBy value_pass_by, MR_std_vector_MR_Vector3f *value)
MRC_API const MR_std_vector_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_Get_path(const MR_GcodeProcessor_BaseAction_MR_Vector3f *_this)
MRC_API void MR_GcodeProcessor_setCNCMachineSettings(MR_GcodeProcessor *_this, const MR_CNCMachineSettings *settings)
MRC_API MR_GcodeProcessor * MR_GcodeProcessor_AssignFromAnother(MR_GcodeProcessor *_this, MR_PassBy _other_pass_by, MR_GcodeProcessor *_other)
MRC_API const MR_GcodeProcessor_BaseAction_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_OffsetPtr(const MR_GcodeProcessor_BaseAction_MR_Vector2f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_GcodeProcessor_Command * MR_GcodeProcessor_Command_ConstructFromAnother(const MR_GcodeProcessor_Command *_other)
struct MR_GcodeProcessor MR_GcodeProcessor
Definition MRGcodeProcessor.h:42
MRC_API MR_std_string * MR_GcodeProcessor_BaseAction_MR_Vector3f_GetMutable_warning(MR_GcodeProcessor_BaseAction_MR_Vector3f *_this)
MRC_API const MR_GcodeProcessor * MR_GcodeProcessor_OffsetPtr(const MR_GcodeProcessor *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_ConstructFrom(MR_PassBy path_pass_by, MR_std_vector_MR_Vector2f *path, const char *warning, const char *warning_end)
MRC_API const char * MR_GcodeProcessor_Command_Get_key(const MR_GcodeProcessor_Command *_this)
MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector2f_Set_path(MR_GcodeProcessor_BaseAction_MR_Vector2f *_this, MR_PassBy value_pass_by, MR_std_vector_MR_Vector2f *value)
MRC_API MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_MoveAction_OffsetMutablePtr(MR_GcodeProcessor_MoveAction *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API char * MR_GcodeProcessor_Command_GetMutable_key(MR_GcodeProcessor_Command *_this)
MRC_API MR_std_string * MR_GcodeProcessor_BaseAction_MR_Vector2f_GetMutable_warning(MR_GcodeProcessor_BaseAction_MR_Vector2f *_this)
MRC_API MR_GcodeProcessor_Command * MR_GcodeProcessor_Command_OffsetMutablePtr(MR_GcodeProcessor_Command *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_GcodeProcessor_Command_Set_key(MR_GcodeProcessor_Command *_this, char value)
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_AssignFromAnother(MR_GcodeProcessor_BaseAction_MR_Vector2f *_this, MR_PassBy _other_pass_by, MR_GcodeProcessor_BaseAction_MR_Vector2f *_other)
MRC_API MR_GcodeProcessor_Command * MR_GcodeProcessor_Command_DefaultConstructArray(size_t num_elems)
MRC_API void MR_GcodeProcessor_DestroyArray(const MR_GcodeProcessor *_this)
Destroys a heap-allocated array of MR_GcodeProcessor. Does nothing if the pointer is null.
MRC_API void MR_GcodeProcessor_Destroy(const MR_GcodeProcessor *_this)
Destroys a heap-allocated instance of MR_GcodeProcessor. Does nothing if the pointer is null.
MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector3f_Set_warning(MR_GcodeProcessor_BaseAction_MR_Vector3f *_this, const char *value, const char *value_end)
MRC_API void MR_GcodeProcessor_reset(MR_GcodeProcessor *_this)
MRC_API void MR_GcodeProcessor_MoveAction_Set_feedrate(MR_GcodeProcessor_MoveAction *_this, float value)
struct MR_std_vector_MR_GcodeProcessor_MoveAction MR_std_vector_MR_GcodeProcessor_MoveAction
Definition MRGcodeProcessor.h:16
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_DefaultConstruct(void)
MRC_API MR_GcodeProcessor_Command * MR_GcodeProcessor_Command_ConstructFrom(char key, float value)
MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector2f_Set_warning(MR_GcodeProcessor_BaseAction_MR_Vector2f *_this, const char *value, const char *value_end)
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector2f * MR_GcodeProcessor_BaseAction_MR_Vector2f_OffsetMutablePtr(MR_GcodeProcessor_BaseAction_MR_Vector2f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector2f_Destroy(const MR_GcodeProcessor_BaseAction_MR_Vector2f *_this)
Destroys a heap-allocated instance of MR_GcodeProcessor_BaseAction_MR_Vector2f. Does nothing if the p...
MRC_API void MR_GcodeProcessor_MoveAction_Set_idle(MR_GcodeProcessor_MoveAction *_this, bool value)
MRC_API const MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_MoveAction_Get_action(const MR_GcodeProcessor_MoveAction *_this)
MRC_API const float * MR_GcodeProcessor_MoveAction_Get_feedrate(const MR_GcodeProcessor_MoveAction *_this)
MRC_API MR_std_vector_MR_Vector3f * MR_GcodeProcessor_MoveAction_GetMutable_toolDirection(MR_GcodeProcessor_MoveAction *_this)
MRC_API const MR_CNCMachineSettings * MR_GcodeProcessor_getCNCMachineSettings(MR_GcodeProcessor *_this)
MRC_API MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_processLine(MR_GcodeProcessor *_this, const char *line, const char *line_end, MR_std_vector_MR_GcodeProcessor_Command *externalStorage)
MRC_API void MR_GcodeProcessor_Command_DestroyArray(const MR_GcodeProcessor_Command *_this)
Destroys a heap-allocated array of MR_GcodeProcessor_Command. Does nothing if the pointer is null.
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_ConstructFrom(MR_PassBy path_pass_by, MR_std_vector_MR_Vector3f *path, const char *warning, const char *warning_end)
MRC_API MR_std_vector_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_GetMutable_path(MR_GcodeProcessor_BaseAction_MR_Vector3f *_this)
MRC_API const MR_std_string * MR_GcodeProcessor_BaseAction_MR_Vector3f_Get_warning(const MR_GcodeProcessor_BaseAction_MR_Vector3f *_this)
MRC_API void MR_GcodeProcessor_setGcodeSource(MR_GcodeProcessor *_this, const MR_std_vector_std_string *gcodeSource)
MRC_API const MR_GcodeProcessor_MoveAction * MR_GcodeProcessor_MoveAction_OffsetPtr(const MR_GcodeProcessor_MoveAction *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector2f_DestroyArray(const MR_GcodeProcessor_BaseAction_MR_Vector2f *_this)
Destroys a heap-allocated array of MR_GcodeProcessor_BaseAction_MR_Vector2f. Does nothing if the poin...
MRC_API bool MR_GcodeProcessor_MoveAction_valid(const MR_GcodeProcessor_MoveAction *_this)
MRC_API MR_GcodeProcessor_BaseAction_MR_Vector3f * MR_GcodeProcessor_BaseAction_MR_Vector3f_DefaultConstructArray(size_t num_elems)
MRC_API MR_GcodeProcessor * MR_GcodeProcessor_OffsetMutablePtr(MR_GcodeProcessor *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_GcodeProcessor_MoveAction_DestroyArray(const MR_GcodeProcessor_MoveAction *_this)
Destroys a heap-allocated array of MR_GcodeProcessor_MoveAction. Does nothing if the pointer is null.
MRC_API float * MR_GcodeProcessor_MoveAction_GetMutable_feedrate(MR_GcodeProcessor_MoveAction *_this)
struct MR_std_vector_std_string MR_std_vector_std_string
Definition MRPdf.h:29
MR_PassBy
Definition common.h:23
#define MRC_API
Definition exports.h:11
virtual void action(HistoryAction::Type) override