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
22// class to process g-code source and generate toolpath
25
28
31
32// structure that stores information about the movement of the tool, specified by some string of commands
35
38
42
47
50
53
57
60
63
68
69// reset internal states
73
74// set g-code source
79
80// process all lines g-code source and generate corresponding move actions
85
86// process all commands from one line g-code source and generate corresponding move action;
87// \param externalStorage to avoid memory allocation on each line
95
96// settings
101
106
107// tool movement parsed from gcode
112
113// tool movement parsed from gcode
117
118// tool movement parsed from gcode
123
124// parser warning
129
130// parser warning
136
137// parser warning
142
146
151
157
160
163
167
170
173
178
179// tool movement parsed from gcode
184
185// tool movement parsed from gcode
189
190// tool movement parsed from gcode
195
196// parser warning
201
202// parser warning
208
209// parser warning
214
218
223
229
232
235
239
242
245
250
255
259
264
265// tool direction for each point from action.path
270
271// tool direction for each point from action.path
275
276// tool direction for each point from action.path
281
286
290
295
300
304
309
313
318
322
325
328
332
335
338
342
347
348// return true if operation was parsed without warnings
352
353// in lowercase
358
359// in lowercase
363
364// in lowercase
369
374
378
383
387
392
396
399
402
407
410
413
419
420#ifdef __cplusplus
421} // extern "C"
422#endif
struct MR_std_vector_std_string MR_std_vector_std_string
Definition MRAngleMeasurementObject.h:20
struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
Definition MRBestFit.h:26
struct MR_CNCMachineSettings MR_CNCMachineSettings
Definition MRCNCMachineSettings.h:22
struct MR_std_vector_MR_Vector2f MR_std_vector_MR_Vector2f
Definition MRContour.h:11
struct MR_std_string MR_std_string
Definition MRE57.h:22
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
Generated from class MR::GcodeProcessor::BaseAction<MR::Vector3f>.
Definition MRGcodeProcessor.h:30
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
Generated from class MR::GcodeProcessor::BaseAction<MR::Vector2f>.
Definition MRGcodeProcessor.h:27
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
Generated from class MR::GcodeProcessor::MoveAction.
Definition MRGcodeProcessor.h:34
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
Generated from class 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
Generated from class MR::GcodeProcessor.
Definition MRGcodeProcessor.h:24
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)
MR_PassBy
Definition common.h:19
#define MRC_API
Definition exports.h:11
virtual void action(HistoryAction::Type) override