-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDXFReader.h
101 lines (60 loc) · 1.46 KB
/
DXFReader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//
// DXFReader.h
// Worker
//
// Created by Matt Andrews on 4/08/2015.
// Copyright (c) 2015 Massey. All rights reserved.
//
#ifndef __Worker__DXFReader__
#define __Worker__DXFReader__
#define DXF_MAX_LINE_LENGTH 258
#define DXF_DEFAULT_LAYER "0"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif /* defined(__Worker__DXFReader__) */
typedef struct DXFVertex {
double x;
double y;
double bulge;
} DXFVertex;
typedef struct DXFPolyline{
char *handle;
int closed;
char *layer;
int vertexCount;
DXFVertex *vertices;
} DXFPolyline;
typedef struct DXFCircle {
DXFVertex centre;
char *handle;
char *layer;
double radius;
} DXFCircle;
typedef union DXFGeometry {
DXFCircle circle;
DXFPolyline polyline;
} DXFGeometry;
typedef enum DXFType {
DXFTypeCircle,
DXFTypePolyline
} DXFType;
typedef struct DXFEntity {
union DXFGeometry geometry;
int entityCount;
struct DXFEntity *entities;
struct DXFEntity *next; // Enables use as a linked list node
DXFType type;
} DXFEntity;
typedef struct DXFParts {
int nParts;
DXFEntity *parts;
} DXFParts;
typedef struct DXFBounds {
double xMin;
double yMin;
double xMax;
double yMax;
} DXFBounds;
DXFParts *DXFRead(const char *file);
//void DXFFree(DXFNode *head);