Next: Acknowledgements
Up: C Implementation of SmartForest
Previous: viewResize in datamap.c
Go to:
SmartForest Home Printer-friendly:
sf-impl.pdf
- The original authors' reliance on global variables is very troubling.
While the overall architecture of the system is sound, the use of global
variables allows for unforseen, subtle and potentially problematic interactions
to occur. It would be nice to move the use of global variables to a more
object-orientedish encapsulation. It's understandable that callbacks will
need to use variables that are not parameters or local to the callback.
However, that is not enough of a reason to violate/ignore encapsulation.
We have started to slowly add more encapsulation to the program.
- In menu.c, X Windows determines its response to
a menu choice by the physical
position of the choice in the menu. The translation
from menu position to action is rather ugly because it is
context sensitive: If the position of a menu item moves or if an addition
is made, several places need to maintain that ordering information. This
problem has been addressed for the stand features menu.
The change needs to occur for the other menus as well
so that items can be moved around in the menu independently of their
callback handlers' order.
- Some of the type names do not correspond to their actual duties.
TreeList is an example since it's really the stand data where the
stand contains a linked list of trees whose type is called Node. Some
names could use an overhaul.
- Several of the fields in the TREE_TYPE struct aren't used.
Of course, this relates to dead code/dead variable problems noted earlier
in the document.
- There is dead code throughout the source files. It would
be useful to trim the dead code from the source files. One tool
that would be extremely helpful in identifying dead code is built
by Rational. Alas it is quite expensive.
- The width of viewing area a slightly lower than it should be. The
problem that this introduces is that, periodically, sections of the very
edges of the Forest View will not paint. There will be ``jagged edges'' and
areas that are not drawn on the screen. These areas are very small but this
problem still occurs.
- Collision detection with the ground is not implemented. Thus you can
end up under the ground.
- The num lock, caps lock and scroll lock keys
must be off. If any are on, the mouse clicks
will not register since X cares about things like shift key, ctrl key,
num lock, etc. when reading input. It would be nice if the application
made sure that these three are off.
Subsections
Next: Acknowledgements
Up: C Implementation of SmartForest
Previous: viewResize in datamap.c
Matthew S. Davis
2002-08-07