summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2026-07-24 20:19:48 +0200
committerJesper Jensen <jesper@jnsn.dev>2026-07-24 20:19:48 +0200
commit2667aa2806877d6fdd31b6ad34b0440197c14e1f (patch)
tree2c7fc9ded8170e3794c505c3ff50f610dd538c3e /inc
parent1af2dfbde432af9f13e8fba09b7ca29f5de71863 (diff)
Fix some layout issuesHEADmaster
Diffstat (limited to 'inc')
-rw-r--r--inc/cad/construction.h3
-rw-r--r--inc/cad/debug.h11
-rw-r--r--inc/cad/solve.h1
-rw-r--r--inc/cad/svg.h3
4 files changed, 18 insertions, 0 deletions
diff --git a/inc/cad/construction.h b/inc/cad/construction.h
index ea784cf..cb6b2bc 100644
--- a/inc/cad/construction.h
+++ b/inc/cad/construction.h
@@ -64,6 +64,7 @@ struct command {
enum operation op;
uint8_t root;
bool hidden;
+ bool placed;
// Only used for input commands
size_t index;
@@ -90,6 +91,8 @@ struct drawing {
struct command *error;
};
+void normalize_line(struct line *line);
+
struct element* insert_cmd(struct drawing *drawing, struct command cmd);
void place_points(struct drawing *drawing, double inputs[]);
void dump_program(struct drawing *drawing, double inputs[]);
diff --git a/inc/cad/debug.h b/inc/cad/debug.h
index b08463f..cad9b3c 100644
--- a/inc/cad/debug.h
+++ b/inc/cad/debug.h
@@ -2,4 +2,15 @@
#include <stdint.h>
+#include <SDL2/SDL.h>
+
+#define igGetIO igGetIO_Nil
+
void print_subassemblies(struct constraints *c, struct subassembly *assemblies, size_t assemblies_num);
+
+struct gui {
+ SDL_Window *window;
+ SDL_GLContext gl_context;
+};
+
+void show_debug_ui(struct constraints *c, struct subassembly *assemblies, size_t assemblies_num, struct drawing* draw);
diff --git a/inc/cad/solve.h b/inc/cad/solve.h
index 9a0c56d..dad3edb 100644
--- a/inc/cad/solve.h
+++ b/inc/cad/solve.h
@@ -12,6 +12,7 @@ enum component_type {
struct subassembly;
struct component {
+ uint16_t id;
enum component_type type;
struct element *e;
diff --git a/inc/cad/svg.h b/inc/cad/svg.h
index 5bfce83..c282c0e 100644
--- a/inc/cad/svg.h
+++ b/inc/cad/svg.h
@@ -14,10 +14,12 @@ enum LineStyle {
enum CanvasState {
CANVAS_INIT,
CANVAS_DRAWING,
+ CANVAS_COORDINATE,
};
struct canvas {
enum CanvasState state;
+ vec2 next_offset;
FILE *f;
};
@@ -30,5 +32,6 @@ void plot_text(struct canvas *canvas, struct point p, double angle, char* str);
void begin_drawing(struct canvas *canvas);
void draw_constraints(struct canvas *canvas, struct constraints *constraints);
+void draw_elements(struct canvas *canvas, struct drawing *drawing);
void draw_topology(struct canvas *canvas, struct topology *topo);
void end_drawing(struct canvas *canvas);