-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtables.h
72 lines (54 loc) · 1.63 KB
/
tables.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
/* Code for the conversion of DXF information in the TABLES section
Matt Squires
SoC
2005*/
#ifndef DXF_TABLES_H
#define DXF_TABLES_H
#include <vector>
#include <string>
#include "read_dxf.h"
class table{
public:
int ret_maxN() const;
private:
int max_number;
};
class layer : public table{
public:
layer(const std::vector<dxfpair> &info);
void display() const;
const char* name() const;
private:
std::string layer_name;
std::string ltype_name; // The layer may also hold the ltype infomation
int color_number;
int plotting_flag;
};
class ltype : public table{
public:
ltype(const std::vector<dxfpair> &info);
const char* name() const;
const std::vector<double> &ret_pattern() const;
private:
std::string ltype_name;
std::string descriptive_txt;
int num_elements;
double pattern_length;
std::vector<double> pattern;
};
class tables{
// Well I said that I would only use STL containers internally, but I would have to use a dynamically linked list, and I haven't done for a long time soo STL is my crutch.
public:
tables(const std::vector<std::vector<dxfpair> > §ions); // Put the various entities into their respective vectors
void display_all() const;
ltype ret_ltype(const char *ltype_name, const char *layer_name) const;
layer ret_layer(const char *layer_name) const;
const std::vector<layer > &ret_layers() const;
private:
//void add_dimstyle(polyline pline);
void add_layer(layer layr);
void add_ltype(ltype line_type);
std::vector<layer > tables_layer;
std::vector<ltype > tables_ltype;
};
#endif