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
55MRC_API const MR_GcodeProcessor *MR_GcodeProcessor_OffsetPtr(const MR_GcodeProcessor *ptr, ptrdiff_t i);
56
60
65
68
71
78
79// reset internal states
83
84// set g-code source
89
90// process all lines g-code source and generate corresponding move actions
95
96// process all commands from one line g-code source and generate corresponding move action;
97// \param externalStorage to avoid memory allocation on each line
104MRC_API MR_GcodeProcessor_MoveAction *MR_GcodeProcessor_processLine(MR_GcodeProcessor *_this, const char *line, const char *line_end, MR_std_vector_MR_GcodeProcessor_Command *externalStorage);
105
106// settings
111
116
117// tool movement parsed from gcode
123
124// tool movement parsed from gcode
130
131// tool movement parsed from gcode
137
138// parser warning
144
145// parser warning
152MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector2f_Set_warning(MR_GcodeProcessor_BaseAction_MR_Vector2f *_this, const char *value, const char *value_end);
153
154// parser warning
160
164
169
177MRC_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);
178
182
186
191
194
197
204
205// tool movement parsed from gcode
211
212// tool movement parsed from gcode
218
219// tool movement parsed from gcode
225
226// parser warning
232
233// parser warning
240MRC_API void MR_GcodeProcessor_BaseAction_MR_Vector3f_Set_warning(MR_GcodeProcessor_BaseAction_MR_Vector3f *_this, const char *value, const char *value_end);
241
242// parser warning
248
252
257
265MRC_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);
266
270
274
279
282
285
292
298
304
310
311// tool direction for each point from action.path
317
318// tool direction for each point from action.path
324
325// tool direction for each point from action.path
331
337
342
348
354
359
365
369
374
380MRC_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);
381
385
389
394
397
400
404
411
412// return true if operation was parsed without warnings
416
417// in lowercase
423
424// in lowercase
429
430// in lowercase
436
442
447
453
457
462
467
471
475
481
484
487
495
496#ifdef __cplusplus
497} // extern "C"
498#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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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