Skip to content
CAD-like Layout Design for Model Railroaders
Pascal Shell
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
.gitignore.orig
About1.lfm
About1.pas
Drawing1.pas
MagicTracks.ico
MagicTracks.lpi
MagicTracks.lpr
MagicTracks.res
Main1.lfm
Main1.pas
Notes.txt
Persistent1.pas
Preferences1.pas
README
Ruler1.pas
breshenham1.pas
common1.pas
drawingcommon1.pas
drawingframe1.lfm
drawingframe1.pas
drawingobject1.pas
drawingsetframe1.lfm
drawingsetframe1.pas
internals1.lfm
internals1.pas
layerform1.lfm
layerform1.pas
layers1.pas
link.res
ppas.bat
preferencesform1.lfm
preferencesform1.pas
rectangularsolid1.pas
sphere1.pas
straightline1.pas
threepoint1.pas
unit1.lfm
unit1.pas
unitconversion1.pas

README

MagicTracks is a CAD-like program for use by Model Railroaders.

It is being developed using FreePascal and Lazarus.  Currently, the implementation
is limited to Windows due to the lack of certain primitives (specifically those
that allow rotation of text) in the Lazarus Component Library.  I intend to
remove that limitation, but not in the immediate future.

The top-level data object is a Drawing, many of which may be opened simultaneously.

Each Drawing consists of several layers, many of which may be viewed
simultaneously, one of which may be edited at any given time.

Each Layer consists of no or more drawing objects.

A drawing object may be a drawing primitive or a group of drawing objects.

Drawing primitives are 3-dimensional objects.  As of April 11, 2012 the
following Drawing Primitives are being developed:

          Rectangular Solid (generalization of a cube) - works without rotations
          Ellipsoid (generalization of a sphere) - under development
          Straight Line (from x0, y0, z0 to x1, y1, z1) - thinking about it
          Bezier Curves (in 3 dimensions) - in the headache stage.

I am taking an unusual path to developing the drawing primitives.  The active
layer has two "Canvases".  One canvas is the normal Lazarus (Delphi) drawing
canvas.  The second canvas has the same dimensions as the first, but the "pixels"
are pointers to the Drawing Object (last drawn) that occupies that position.
This makes the process of editing drawing objects much easier than if each
drawing object needed to be interrogated for each mouse movement.

As each drawing object (on the active layer) is drawn, the pixel value (color,
etc) is written to the drawing canvas and the object pointer is written to the
object pointer.  This means that the algorithm for identifying the pixels
must be separated from the internal canvas operations.  Consequently, I am
implementing Bresham's Line Drawing Algorithm and other similar algorithms
for spheres and Bezier curves.


Something went wrong with that request. Please try again.