-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnotes.txt
104 lines (75 loc) · 4.07 KB
/
notes.txt
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
101
102
--------------------------------------------
General
--------------------------------------------
can we make a C++ base class for glut programs? And/or CAVE programs?
How about a camera zoom class based on transvecpos.hpp?
don't forget curve inside penrose tilings
Use this projects parser, context, etc. as master versions
--------------------------------------------
Efficiency
--------------------------------------------
Rulerunner's map of strings (Rulenames) to Cmdconts should be replaced by
a bunch of pointers, but then the RuleCmds in that container need to contain
these pointers, not strings. This is a new thing the Lsystem should hold,
it can be created at syntax check time.
Would it help to make the "top" turtle a member directly? (ie, is stack.top()
inefficient?)
--------------------------------------------
Graphics
--------------------------------------------
handling point streams (which could create other point streams)
(ie, midpoints of all segments, cutting corners, ...)
within turtle class, rulerunner class, or seperately
similarly, will the points list ever have more than one point in it?
rulerunner needs to return draw primitives (ie, segment, etc.) but then
we need some way to combine them for efficiency. Or do we?
Midpoint graphic class isn't stable w/ respect to haveapt being reset. Actually, I don't
think this class works generally at all.
--------------------------------------------
Header file correctness
--------------------------------------------
check const correctness everywhere
typdef all containers
.h files should include only needed header files, forward declaring when necessary
--------------------------------------------
Things to do
--------------------------------------------
when and how to set things like maxdepth or threshold cutoff. I guess in the rulerunner
constructor?
Check a system after reading it to be sure all rules it refers to exist. Similarly
with variables.
rectgraphic
lexer needs a getdatatoken() routine
Add ways to interactivly
make systems inactive or active
Set drawmethod to or from midpoint
rule option list should just put stuff in a map, and cache for efficiency some values.
Could a Context go back to being just var->double map? I think so. So do syntax
checking (warnings for rule names that are otherwise reserved (midpoint, drawmethod, etc.))
and this as you read the L-system (or just after, I guess).
Things that don't pass syntax check or otherwise throw while reading should just not
be put in the list...
See Efficiency above.
invis and forward standard rule? Not sure how to handle scaling
How should a context be passed to a rulerunner. By value seems to be inefficient
(copying the whole thing) but by const reference is dangerous unless the user is
careful to not invalidate the context... (Or is it the Context itself that should
be careful to take it's Consttype and Exprtype parts by value?) Given the fact that
we're cacheing values, we can probably pass by const reference, since we never use
it after constructor time!
:: or % to implement rule that doesn't increment depth count
--------------------------------------------
Notes from main.cpp
//!!!!"class"ify this (wrt a tx, ty translation pair and a sc scale
//!!!glBegin->glEnd a C++ class constructor destructor resource acquisition?
} catch (std::exception &error) {
//!!! Some errors (like can't read config file) are terminal, others we can proceed
std::cerr << error.what() << std::endl;
}
--------------------------------------------
Consider parser type any<T> instead of double?
--------------------------------------------
We cache things because they can't be evaluated until parameter value is known, but this seems prone to error. Maybe no cache at all? But then we're parsing every time. Hmmmmm.
"reverse" is really "reflect", yes? At least for users.
Thoughts:
Turtle belongs to the draw strategy. Or even is part of the draw strategy. Command base class should be friend of the draw strategy, and RuleCommand still must be friend of RuleRunner. All commands should tell the draw strategy what to do, instead of the turtle.