ftp.nice.ch/peanuts/GeneralData/Documents/adobe/DPS.Purple.Dial.tar.gz#/NX_Dial/DialView.h

This is DialView.h in view mode; [Download] [Up]

/*
 * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
 *
 * (b)  If this Sample Code is distributed as part of the Display PostScript
 *	System Software Development Kit from Adobe Systems Incorporated,
 *	then this copy is designated as Development Software and its use is
 *	subject to the terms of the License Agreement attached to such Kit.
 *
 * (c)  If this Sample Code is distributed independently, then the following
 *	terms apply:
 *
 * (d)  This file may be freely copied and redistributed as long as:
 *	1) Parts (a), (d), (e) and (f) continue to be included in the file,
 *	2) If the file has been modified in any way, a notice of such
 *      modification is conspicuously indicated.
 *
 * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
 *	Adobe Systems Incorporated.
 * 
 * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
 *	CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
 *	AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
 *	ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
 *	OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
 *	WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
 *	WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
 *	DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
 *	FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
 *	OF THIRD PARTY RIGHTS.
 */

/*
 *	DialView.h
 *
 *	This class, a subclass of view, contains the methods to draw an object in
 *	several ways: using wraps with the PostScript operator rotate, using wraps
 *	but calculating the trig for the lines, using user paths and trig and using user
 *	paths stored in the server.
 *
 *	Times are available for comparison between methods. 
 *
 *
 *	Version:	2.0
 *	Author:	Ken Fromm
 *	History:
 *			03-07-91		Added this comment.
 *			05-10-91		Simplified the drawing from six to four methods
 */

#import <appkit/View.h>

#define RADIANS			((2 * 3.1415)/360)
#define CLRVIEW			NX_LTGRAY
#define CLRCIRC			NX_DKGRAY
#define WIDCIRCBRD		5.0	
#define CLRCIRCBRD		NX_BLACK	
#define CIRCFF			5

#define WID1				0.5	
#define CLR1				NX_LTGRAY	
#define LEN1				(10.0/11.0)	
#define DEG1				1.0	

#define WID10			1.5	
#define CLR10			NX_LTGRAY	
#define LEN10			(6.0/7.0)	
#define DEG10			10.0	

#define WID45			2.5	
#define CLR45			NX_BLACK	
#define LEN45			(0.75)	
#define DEG45			45.0	

#define WID90			3.5	
#define CLR90			NX_BLACK	
#define LEN90			(0.7)	
#define DEG90			90.0	

#define MAX_PTS			1500
#define MAX_OPS			750

#define DRAWALL			0xff				/* Draw with all methods */ 

/*
*	The id's are for the buttons and text fields. The pts and ops variables are for
*	the arrays to hold the user path points and operators.
*/

@interface DialView:View
{	
	id		matrixDegreeTypes,
			matrixDisplayTimes;

	BOOL	trace;
	
	float		maxdim;
	
	float		*pts;
	
	char		*ops;
	
	NXPoint	viewcenter;

	union {
		struct {
			unsigned char wrapsrotate:1;
			unsigned char wrapstrig:1;
			unsigned char upathstrig:1;
			unsigned char upathsserver:1;
			unsigned char PADDING:4;
		} 	flags;
		unsigned char		field;
	} drawFlags;
}

+ newFrame:(NXRect *) frm;
- free;

- setMatrixDegreeTypes:anObject;
- setMatrixDisplayTimes:anObject;

- setupUpaths;

- trace:sender;
- eraseTimes:sender;
- drawViewOne:sender;
- drawViewAll:sender;

- drawWrapsRotate:(int) cell;
- drawWrapsTrig:(int) cell;
- drawUpathsTrig:(int) cell;
- drawUpathsServer:(int) cell;

- drawSelf:(NXRect *)r :(int) count;

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.