File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / Lines / README.rtf
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:26 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\fmodern Courier;\f2\fmodern Ohlfs;}
\paperw9260
\paperh9680
\margl120
\margr120
{\colortbl;\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\i0\ul0\fs36\fc0\cf0 Lines
\b0\fs24 \
By Ali Ozer\
Updated for 2.0 by Jayson Adams\
Updated for 3.0 by Ali Ozer\
\

\b Overview\

\b0 \

\fc1\cf1 Lines draws a number of connected lines whose endpoints bounce around randomly within a view.  The slider regulates the number of endpoints (you can select from 2 to 20).  Lines uses PostScript user paths to speed its drawing.\
\

\b Theory of Operation\

\b0 \
The LinesView maintains an array of points and their velocities.  When you press the �Go� button, the LinesView starts a timed entry which calls the 
\f1 animate
\f0  method as fast as possible.  The 
\f1 animate
\f0  method repeatedly takes each point and moves it according to its velocity (changing its velocity if it hits a side).  It then uses PostScript user paths (via UserPath.[hm];  see below) to draw lines between the points.\
\

\b UserPaths made Simpler\

\b0 \
The code in UserPath.[hm] makes user paths easier to use.  Instead of having to allocate space for the points and operators, maintain the bounding box, etc., you create a UserPath, add points to it, and send it to the window server.  The UserPath functions construct the userpath, allocate more memory for a UserPath based on how many points you've asked it to contain, adjust the bounding box to encompass all points, etc.  You can use UserPaths in your own code by copying UserPath.[hm] into your project directory and reading the beginning of UserPath.h.\

}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.