home *** CD-ROM | disk | FTP | other *** search
/ Nebula / nebula.bin / SourceCode / AdobeExamples / NX_Dial / DialView.h < prev    next >
Text File  |  1993-01-19  |  3KB  |  138 lines

  1.  
  2. /*
  3.  * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
  4.  *
  5.  * (b)  If this Sample Code is distributed as part of the Display PostScript
  6.  *    System Software Development Kit from Adobe Systems Incorporated,
  7.  *    then this copy is designated as Development Software and its use is
  8.  *    subject to the terms of the License Agreement attached to such Kit.
  9.  *
  10.  * (c)  If this Sample Code is distributed independently, then the following
  11.  *    terms apply:
  12.  *
  13.  * (d)  This file may be freely copied and redistributed as long as:
  14.  *    1) Parts (a), (d), (e) and (f) continue to be included in the file,
  15.  *    2) If the file has been modified in any way, a notice of such
  16.  *      modification is conspicuously indicated.
  17.  *
  18.  * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
  19.  *    Adobe Systems Incorporated.
  20.  * 
  21.  * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
  22.  *    CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
  23.  *    AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
  24.  *    ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
  25.  *    OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
  26.  *    WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
  27.  *    WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
  28.  *    DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
  29.  *    FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
  30.  *    OF THIRD PARTY RIGHTS.
  31.  */
  32.  
  33. /*
  34.  *    DialView.h
  35.  *
  36.  *    This class, a subclass of view, contains the methods to draw an object in
  37.  *    several ways: using wraps with the PostScript operator rotate, using wraps
  38.  *    but calculating the trig for the lines, using user paths and trig and using user
  39.  *    paths stored in the server.
  40.  *
  41.  *    Times are available for comparison between methods. 
  42.  *
  43.  *
  44.  *    Version:    2.0
  45.  *    Author:    Ken Fromm
  46.  *    History:
  47.  *            03-07-91        Added this comment.
  48.  *            05-10-91        Simplified the drawing from six to four methods
  49.  */
  50.  
  51. #import <appkit/View.h>
  52.  
  53. #define RADIANS            ((2 * 3.1415)/360)
  54. #define CLRVIEW            NX_LTGRAY
  55. #define CLRCIRC            NX_DKGRAY
  56. #define WIDCIRCBRD        5.0    
  57. #define CLRCIRCBRD        NX_BLACK    
  58. #define CIRCFF            5
  59.  
  60. #define WID1                0.5    
  61. #define CLR1                NX_LTGRAY    
  62. #define LEN1                (10.0/11.0)    
  63. #define DEG1                1.0    
  64.  
  65. #define WID10            1.5    
  66. #define CLR10            NX_LTGRAY    
  67. #define LEN10            (6.0/7.0)    
  68. #define DEG10            10.0    
  69.  
  70. #define WID45            2.5    
  71. #define CLR45            NX_BLACK    
  72. #define LEN45            (0.75)    
  73. #define DEG45            45.0    
  74.  
  75. #define WID90            3.5    
  76. #define CLR90            NX_BLACK    
  77. #define LEN90            (0.7)    
  78. #define DEG90            90.0    
  79.  
  80. #define MAX_PTS            1500
  81. #define MAX_OPS            750
  82.  
  83. #define DRAWALL            0xff                /* Draw with all methods */ 
  84.  
  85. /*
  86. *    The id's are for the buttons and text fields. The pts and ops variables are for
  87. *    the arrays to hold the user path points and operators.
  88. */
  89.  
  90. @interface DialView:View
  91. {    
  92.     id        matrixDegreeTypes,
  93.             matrixDisplayTimes;
  94.  
  95.     BOOL    trace;
  96.     
  97.     float        maxdim;
  98.     
  99.     float        *pts;
  100.     
  101.     char        *ops;
  102.     
  103.     NXPoint    viewcenter;
  104.  
  105.     union {
  106.         struct {
  107.             unsigned char wrapsrotate:1;
  108.             unsigned char wrapstrig:1;
  109.             unsigned char upathstrig:1;
  110.             unsigned char upathsserver:1;
  111.             unsigned char PADDING:4;
  112.         }     flags;
  113.         unsigned char        field;
  114.     } drawFlags;
  115. }
  116.  
  117. + newFrame:(NXRect *) frm;
  118. - free;
  119.  
  120. - setMatrixDegreeTypes:anObject;
  121. - setMatrixDisplayTimes:anObject;
  122.  
  123. - setupUpaths;
  124.  
  125. - trace:sender;
  126. - eraseTimes:sender;
  127. - drawViewOne:sender;
  128. - drawViewAll:sender;
  129.  
  130. - drawWrapsRotate:(int) cell;
  131. - drawWrapsTrig:(int) cell;
  132. - drawUpathsTrig:(int) cell;
  133. - drawUpathsServer:(int) cell;
  134.  
  135. - drawSelf:(NXRect *)r :(int) count;
  136.  
  137. @end
  138.