ftp.nice.ch/pub/next/developer/resources/palettesfor2.xx/Cube.1.0.N.bs.tar.gz#/Cube/CubeCell.rtf

This is CubeCell.rtf in view mode; [Download] [Up]

Release 1.0  No Copyright 1992 by David Stes, No Rights Reserved
You Can Contact Me At : david stes, hoge meerheuvel 5, 2960 brecht BELGIUM  (stes@cage.rug.ac.be)
Please Do Not Make Serious Use Of This Object









CubeCell

INHERITS FROM	ActionCell:Cell:Object

DECLARED IN	"CubeCell.h"



CLASS DESCRIPTION

CubeCells do the necessary drawing and mouse-tracking to implement Cube Controls.



INSTANCE VARIABLES

Inherited from Object	Class	isa;

Inherited from Cell	char	*contents;
id	support;
struct _cFlags1	cFlags1;
struct _cFlags2	cFlags2;

Inherited from ActionCell	int	tag;
id	target;
SEL	action;

Declared in CubeCell	float	mat[3][3];

mat 	The current transformation matrix for the cube
	(this is a matrix with determinant +1)



METHOD TYPES

Initializing a new CubeCell	- init

Setting CubeCell Value	- reset
- setmatrix:
- getmatrix:
- rotate::

Displaying	± calcCellSize:inRect:
	± drawcube
- drawInside:inView: 

Tracking the Mouse	- continueTracking:at:inView:
- startTrackingAt:inView: 

Archiving	- read: 
- write:



CLASS METHODS


(none)


INSTANCE METHODS

calcCellSize:inRect:
- calcCellSize:(NXSize *)theSize
inRect:(const NXRect *)aRect

Returns aRect->size by reference.

continueTracking:at:inView:
- (BOOL)continueTracking:(const NXPoint *)lastPoint
at:(const NXPoint *)currentPoint
inView:controlView

Continues tracking by moving the cube to currentPoint.

drawcube
- drawcube

Actual drawing method.


drawInside:inView:
- drawInside:(const NXRect *)cellframe inView:controlView

This method overrides the inherited drawInside method.  It simply invokes drawcube.

init
- init

Initalize and reset.


getmatrix:
- getmatrix:(float *)get

Copy the transformation matrix of the cube into the get matrix.

read:
- read:(NXTypedStream *)stream

Reads the CubeCell from the typed stream stream.  Returns self.

reset
- reset

Set the transformation matrix to the identity matrix.

rotate
- rotate:(float)ph : (float)th

Multiply the transformation matrix to the left with the matrix

	{cos(th)*cos(ph),-sin(th)*cos(ph),-sin(ph)}
	{sin(th)                  , cos(th)                 ,            0}
	{cos(th)*sin(ph) ,-sin(th)*sin(ph)  ,cos(ph)}
	
,ie. rotate by these amounts.  ph and th should be in ]-p,+p[ and [0,2p[ respectively.

setmatrix:
- setmatrix:(float *)set

Copy the set matrix into the transformation matrix of the cube.

startTrackingAt:inView:
- (BOOL)startTrackingAt:(const NXPoint *)startPoint inView:controlView

Begins a tracking session.  Always returns YES.

write:
- write:(NXTypedStream *)stream

Writes the receiving CubeCell to the typed stream stream and returns self.

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