This is BBBasicShapeBallsSticks.m in view mode; [Download] [Up]
/* BBBasicShapeBallsSticks.h * * This region shape draws a balls&sticks region. * * For more interface-info see the header file. More in depth information * can be found in the source-code. * * Written by: Thomas Engel * Created: 23.05.1994 (Copyleft) * Last modified: 23.05.1994 */ #import "BBBasicShapeBallsSticks.h" #import "BBAtomShape.h" #import "BBBondShape.h" #import "BBMolecule.h" #import "BBAtom.h" @implementation BBBasicShapeBallsSticks - addSubshapesTo:aList { // Balls & Sticks... says it all. We will add atoms and bonds. id tempList; id newShape; int i; [super addSubshapesTo:aList]; tempList = [[self region] bondList]; for( i=0; i<[tempList count]; i++ ) { newShape = [[BBBondShape alloc] initFrom:[tempList objectAt:i] asPartOf:self]; [aList addObject:newShape]; } tempList = [[self region] atomList]; for( i=0; i<[tempList count]; i++ ) { newShape = [[BBAtomShape alloc] initFrom:[tempList objectAt:i] asPartOf:self]; [aList addObject:newShape]; } return self; } - (float)atomRadius:sender { return [[sender atom] radius] * 0.5; } - (float)bondRadius:sender { return 0.1; } - (NXColor)bondColor:sender { return NX_COLORGRAY; } @end /* * History: 23.05.94 First regionShape subclass. * * * Bugs: - Nop */
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.