Annotation of pmsdk/samples/linefrac/readme, revision 1.1.1.2

1.1       root        1: Comments about LINEFRAC
                      2: 
1.1.1.2 ! root        3: 
        !             4: Notes:
        !             5: ------
        !             6: 
        !             7: You must run "make opendlg" and include the ..\dll directory in your
        !             8: libpath before attempting to make or execute this application.
        !             9: 
        !            10: Two of the modules generate the following warning when they compile:
        !            11:     warning C4058: address of frame variable taken, DS != SS
        !            12: This is the result of a fairly obscure compiler warning message bug,
        !            13: which will be fixed in a future release.  The emitted code is correct.
        !            14: 
        !            15: 
        !            16: 
        !            17: General Description:
        !            18: --------------------
        !            19: 
        !            20: This program draws self-similar fractals defined by transformations
        !            21: of the unit interval.  By recursively applying the transformation,
        !            22: neat drawings result.
        !            23: 
        !            24: Currently you can only choose the built-in transforms. Click on one
        !            25: to get that fractal at the current level of recursion. Choose level
        !            26: one (from the miscellaneous attributes dialog box), and one side to the
        !            27: frame polygon (same dialog box), to see the transformation itself.
        !            28: Some fractals are shown graphically in the menu.
        !            29: 
        !            30: Clicking on the left mouse button causes the fractal to go deeper
        !            31: into recursion, while clicking on the right causes it to come back
        !            32: out.
        !            33: 
        !            34: In the misc. attributes dialog box you can specify "# sides of polygon",
        !            35: which is the number of initial segments to which your transform
        !            36: will be applied.  You always get a regular polygon of the number
        !            37: of sides you choose.
        !            38: 
        !            39: With the current limited set of transforms, you can still get some
        !            40: interesting effects by drawing a new fractal on top of old ones
        !            41: with varying attributes.  You can also draw several independent
        !            42: fractals and automatically switch between them, simulating animation.
        !            43: 
        !            44: Note that at recursion level n, an m-segment transform will be
        !            45:              n
        !            46: composed of  m  line segments.  Keep this in mind when playing with
        !            47: the 5-segment transforms, namely StovePipe and SquareWave.
        !            48: 
        !            49: The names are, except for Koch (mathematician who proved, I think,
        !            50: that the Koch curve has infinite arc length when the level of recursion
        !            51: goes to infinity), weak attempts to describe the basic shape.  The
        !            52: Fractal menu uses pictures, anyway.
        !            53: 
        !            54: 
        !            55: Description of commands:
        !            56: ------------------------
        !            57: 
        !            58: File
        !            59: 
        !            60:     Load ...
        !            61:        Load a bitmap from a BMP file. The top thread must have a
        !            62:        memory DC.
        !            63:        (Currently requires AutoResize option to be enabled).
        !            64:     Save ...
        !            65:        Save bitmap to a BMP file.  The top thread must have a memory DC.
        !            66:     About ...
        !            67:        Show the credits.
        !            68: 
        !            69: 
        !            70: Edit
        !            71: 
        !            72:     Select
        !            73:        Drag a rectangle (from lower left to upper right) to highlight
        !            74:        it for cutting or copying.  If you don't like what you selected,
        !            75:        then do it again.  Nothing's permanent until you choose cut or
        !            76:        copy.  Hitting the space bar will throw away the selection
        !            77:        rectangle.
        !            78: 
        !            79:     Cut
        !            80:        Copy the selected rectangle of bits into the "clipboard", and
        !            81:        fill with the current background color.
        !            82: 
        !            83:     Copy
        !            84:        Copy the selected rectangle of bits into the "clipboard".
        !            85: 
        !            86:     Paste
        !            87:        Copy the cut or copied bits back into the bitmap with the current
        !            88:        rop.  The selected rectangle is highlighted in its original
        !            89:        location.  Grab somewhere in the window (in the highlighted
        !            90:        rectangle is suggested) and move it to the desired location.
        !            91: 
        !            92:     Use Clipboard
        !            93:        Not implemented yet.  This will instruct linefrac to use the
        !            94:        shell's clipboard feature for saving bits, rather than an
        !            95:        internal second bitmap.
        !            96: 
        !            97:     ----------------------------------------------------------------
        !            98: 
        !            99:     Paste w/ S
        !           100:             DSa
        !           101:             DSo
        !           102:             DSx
        !           103:             Sn
        !           104:             DSan
        !           105:             DSon
        !           106:             DSxn
        !           107: 
        !           108:        Various rops for use when pasting bits back into the bitmap.
        !           109: 
        !           110: 
        !           111: Thread
        !           112: 
        !           113:     New
        !           114:        Direct
        !           115:            Creates a new thread which draws directly to the screen.
        !           116:            The WM_PAINT message does nothing for this thread.  To
        !           117:            see the image after the bits have been destroyed, you
        !           118:            have to cause a redraw (try Control Redraw).  Only one
        !           119:            thread may have a direct DC (temporary restriction).
        !           120:        Memory ...
        !           121:            Creates a new thread which draws into a bitmap.  If
        !           122:            thread inheritance is enabled (see below) the bitmap
        !           123:            parameters are taken from the top thread.  Otherwise a
        !           124:            dialog box appears with the bitmap parameters set to the
        !           125:            window dimensions with 0 planes and 0 bits per pixel (the
        !           126:            latter two cause the device to select its favored format).
        !           127:            The user can alter any of these values as desired.  When the
        !           128:            dialog box is closed, a bitmap is created and a thread
        !           129:            is created to draw into it.
        !           130:        PostScript
        !           131:            not implemented yet
        !           132:        ProPrinter
        !           133:            not implemented yet
        !           134: 
        !           135:     Bring to top
        !           136:        Select the number of the thread to bring to the foreground.
        !           137:        To switch between threads quickly via the keyboard, type a
        !           138:        digit between 0 and 9.  The thread started at that position
        !           139:        in the overall order will be brought to the front, e.g. its
        !           140:        bitmap will be visible, in the case of a memory DC thread.
        !           141:        For a direct DC thread, nothing will happen to the image
        !           142:        until a redraw is caused.
        !           143: 
        !           144:     Edit DC Parameters ...
        !           145:        View or edit the bitmap extents and color format.
        !           146: 
        !           147:     Kill top thread
        !           148:        Kills the top thread.  Brings the next lower (lesser id)
        !           149:        thread to the top.  If there's only one thread,  a new
        !           150:        thread is created with the program defaults.
        !           151: 
        !           152:     Kill all threads
        !           153:        Kills all the threads and leaves the program with one thread
        !           154:        with the program defaults.
        !           155: 
        !           156:     ----------------------------------------------------------------
        !           157: 
        !           158:     Automatic cyclic switch
        !           159:        "Animates" by automatically switching between each thread in
        !           160:        turn.  The delay between switches is set by the next command.
        !           161: 
        !           162:     Switch delay ...
        !           163:        Set the delay in microseconds between switches between threads.
        !           164: 
        !           165:     Update menus on thread switch
        !           166:        This controls the checking or unchecking of the various menu
        !           167:        items that vary per thread.  If disabled, there is less overhead
        !           168:        in a thread-switch, therefore a faster possible switch time.
        !           169: 
        !           170:     ----------------------------------------------------------------
        !           171: 
        !           172:     New thread inherits from top
        !           173:        If enabled, new threads will be copies of the thread which
        !           174:        was on top when the new thread was started.  If disabled,
        !           175:        the program will select default values for all thread variables.
        !           176: 
        !           177: 
        !           178: Control
        !           179: 
        !           180:     Redraw
        !           181:        Forces the fractal to be redrawn.
        !           182: 
        !           183:     Abort drawing
        !           184:        Causes drawing of current fractal, if any, to cease.
        !           185: 
        !           186:     Clear surface
        !           187:        Clear the drawing surface to the background color.
        !           188: 
        !           189:     Copy bitmap to screen.
        !           190:        Copies the entire bitmap to the screen.  Does nothing for
        !           191:        a direct DC.
        !           192: 
        !           193:     Square up window
        !           194:        Force the window to be nearly square for aspect ratio-corrected
        !           195:        drawing.
        !           196: 
        !           197:     Resize surface to window
        !           198:        Resizes the drawing surface to the window dimensions.
        !           199: 
        !           200:     ----------------------------------------------------------------
        !           201: 
        !           202:     Mouse click changes recursion
        !           203:        If enabled, clicking in the client area changes the level of
        !           204:        recursion:  left button --> go deeper (higher level);
        !           205:                   right button --> go shallower (lower level)
        !           206: 
        !           207:     Animate mouse pointer
        !           208:        This causes the mouse pointer to change shape as it is moved.
        !           209:        It represents the koch curve going from recursive level 0 to 3
        !           210:        and back to 0 again repeatedly.
        !           211: 
        !           212:     Mouse pointer preferences ...
        !           213:        Let's you select the pointer shape to use when the pointer is
        !           214:        not animated.  Let's you determine the speed of animation by
        !           215:        setting the number of WM_MOUSEMOVE messages tallied before
        !           216:        switching pointer shapes.
        !           217: 
        !           218:     Cyclic redraw timer delay ...
        !           219:        Sets the delay in microseconds between automatic redraws.  Note
        !           220:        that the timer proceeds independently of the drawing.  A long
        !           221:        fractal will probably end up redrawing immediately, since its
        !           222:        semaphore will have been cleared before the current drawing is
        !           223:        finished, that is unless the delay is corresponding long.
        !           224: 
        !           225: 
        !           226: Fractal
        !           227: 
        !           228:     SharkTooth         (2 segments)
        !           229:     SawTooth           (3 segments)
        !           230:     Koch               (4 segments)
        !           231:     StovePipe          (5 segments)
        !           232:     SquareWave         (5 segments)
        !           233: 
        !           234:     Space filling curve (4 segments) (reflections on first and fourth segs)
        !           235:        (Note: the space filling curve was originally intended to be drawn
        !           236:               with the custom primitive "Peano curvelet").
        !           237: 
        !           238:     Hourglass          (3 segments, crosses itself)
        !           239: 
        !           240:        Click on one of these to select a similarity transform for your
        !           241:        fractal.
        !           242: 
        !           243:     ----------------------------------------------------------------
        !           244: 
        !           245:     Redraw after change
        !           246:        If enabled, causes an automatic redraw to occur after any
        !           247:        selection on this menu.
        !           248: 
        !           249: 
        !           250: Primitive
        !           251: 
        !           252:     PolyLine
        !           253:     PolyFillet
        !           254:     PolySpline
        !           255:     PolyMarker
        !           256:     Peano curvelet
        !           257: 
        !           258:        These determine the primitive used to display the points
        !           259:        accumulated during recursion on the fractal.
        !           260: 
        !           261:        The Peano curvelet is a "custom primitive".  It draws two lines
        !           262:        between each point instead of one.  The lines meet at a right
        !           263:        angle.  If the straight line between the two points is x major
        !           264:        (the difference in x is greater than the difference in y),
        !           265:        then the new middle point is on the left side, otherwise it's
        !           266:        on the right side.  In other words,
        !           267: 
        !           268: 
        !           269:                  *       *   *
        !           270:                 * *       * *      ^  *      |    *
        !           271:                *   *       *       |   *     |   *
        !           272:                                    |    *    |  *
        !           273:                ---->     <----     |   *     |   *
        !           274:                                    |  *      V    *
        !           275: 
        !           276:        With this primitive, the existing algorithm and data structures
        !           277:        can be used to draw the Peano space-filling curve.  Note that
        !           278:        the directions of these arrows are relative to the canonical
        !           279:        unit line segment in world coordinate space on which the
        !           280:        fractal is really drawn.  If the fractal is rotated (to put
        !           281:        it on the side of a polygon, for instance), the arrows all
        !           282:        rotate accordingly.
        !           283: 
        !           284:     ----------------------------------------------------------------
        !           285: 
        !           286:     Redraw after change
        !           287:        If enabled, causes an automatic redraw to occur after any
        !           288:        selection on this menu.
        !           289: 
        !           290: 
        !           291: Attributes
        !           292: 
        !           293:     Line attributes ...
        !           294:     Marker attributes ...
        !           295:     Area attributes ...
        !           296:     Image attributes ...
        !           297:        Set the various attributes.
        !           298: 
        !           299:     Miscellaneous attributes ...
        !           300:        Calls up a dialog box in which you can select the following
        !           301:        values:
        !           302: 
        !           303:            # sides to initial polygon
        !           304: 
        !           305:            number of points sent to GpiPolyLine at a time
        !           306: 
        !           307:            level of recursion at which to draw
        !           308: 
        !           309:            angle of rotation (radians, CCW positive) applied to initial
        !           310:                segments of fractal
        !           311: 
        !           312:     Fractal dimensions ...
        !           313:        x offset and scale, as a percentage of the width of the window
        !           314:        same for y, too;  the offsets determine where in the window
        !           315:        the fractal occurs, whereas the scale factors determine
        !           316:        roughly how big the image is
        !           317: 
        !           318: 
        !           319:     Drag fractal dimensions
        !           320:        Lets user drag a rectangle in the client window to determine
        !           321:        the approximate bounding box of the next fractal.  "Approximate"
        !           322:        because fractals might flow out of the box given enough depth
        !           323:        of recursion.  This call alters the values of the scale factors
        !           324:        and offsets.  The fractal attributes dialog box will show the
        !           325:        new values the next time it is called up.
        !           326: 
        !           327:     ----------------------------------------------------------------
        !           328: 
        !           329:     Redraw after change
        !           330:        If enabled, causes an automatic redraw to occur after any
        !           331:        selection on this menu.
        !           332: 
        !           333: 
        !           334: Environment
        !           335: 
        !           336:     AutoResize bitmap
        !           337:        If checked, the bitmap will be resized every time you change
        !           338:        the window size (even if you iconize).
        !           339: 
        !           340:        If not checked, the bitmap will stay the same size and won't
        !           341:        be redrawn when the window size changes.
        !           342: 
        !           343:        When the window is resized, each thread will react according to
        !           344:        this flag.
        !           345: 
        !           346:     AutoSelect fractal dimensions
        !           347:        If this is checked, the default x,y offsets and scale factors
        !           348:        will be used as soon as the transform is selected.  This positions
        !           349:        the fractal so as to center it in the window, with room to grow
        !           350:        so that it won't be clipped as the level of recursion increases.
        !           351:        Note that the space filling curve grows up, not sideways, so it
        !           352:        is not centered like the others.
        !           353: 
        !           354:     Clear surface on redraw
        !           355:        If enabled, the surface will be filled with the current area
        !           356:        attributes on the next redraw.
        !           357: 
        !           358:     Automatic cyclic redraw
        !           359:        Sets a timer which after a random delay causes a redraw.
        !           360:        The upper and lower limits on the random delay are set with
        !           361:        the "Control Timer delay ..." command.
        !           362: 
        !           363:     Collect bounds on fractals
        !           364:        When this is checked, the minimal rectangle of bits will be
        !           365:        copied to the screen after a fractal is drawn into the bitmap.
        !           366:        This speeds up the drawing slightly, and the mouse pointer won't
        !           367:        flash unless it's right on top of where the drawing is happening.
        !           368: 
        !           369: 
        !           370: 
        !           371: 
        !           372: Bugs to fix:
        !           373: ------------
        !           374:     sometimes the animation timer seems to stop -- moving the mouse over
        !           375:        the window is enough to get it started again
        !           376:     occasionally the redraw seems to not work -- selecting it again
        !           377:        works though
        !           378:     occasionally a fractal is not drawn to completion
        !           379:     parts of the window sometimes get erased with the WM_ERASEBACKGROUND
        !           380:        message, but don't get updated by WM_PAINT. Why?  Should
        !           381:        LfEraseBackground invalidate what it paints for the benefit
        !           382:        of LfPaint?
        !           383:     sometimes the upper left of a fractal is displayed in the window
        !           384:        instead of the lower left, depending on the window dimensions
        !           385:        (I saw this with a bitmap much larger than the screen) --
        !           386:        slowly resizing the window reveals a point at which the switch
        !           387:        occurs
        !           388:     the "cancel" buttons don't work as expected on various dialog
        !           389:        boxes -- looking at attributes can cause the fractal to redraw
        !           390:        even though nothing changes;  cancelling the new thread dialog
        !           391:        box doesn't stop it from being created

unix.superglobalmegacorp.com

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