index xrefs 2006/08/08 17:41:24

ChemoJunAtomObject

ChemoJun050 (2006/08/08) Copyright 2002-2006 National Institute of Informatics, Research Organization of Information and Systems.

category:

inheritance:

instance variables:

class instance variables:

class variables:

pool variables:

instance methods:

  1. areaCoefficient [accessing] xrefs
    	^areaCoefficient
  2. areaCoefficient: coefficient [accessing] xrefs
     
    	areaCoefficient := coefficient
  3. atomicArea [accessing] xrefs
    	^(Jun3dBoundingBall center: self atomicPoint radius: self atomicRadius) 
    		area
  4. atomicBody [accessing] xrefs
    	^atomicBody
  5. atomicBody: aBody [accessing] xrefs
     
    	atomicBody := aBody asJunOpenGL3dObject
  6. atomicColor [attribute accessing] xrefs
    	^self attributeTable at: #atomicColor
    		ifAbsent: [self class atomicColorAt: self atomicSymbol]
  7. atomicColor: colorValue [attribute accessing] xrefs
     
    	colorValue ifNil: [self attributeTable removeKey: #atomicColor]
    		ifNotNil: [:it | self attributeTable at: #atomicColor put: it]
  8. atomicPoint [accessing] xrefs
    	atomicPoint isNil ifTrue: [atomicPoint := self defaultAtomicPoint].
    	^atomicPoint
  9. atomicPoint: aPoint [accessing] xrefs
     
    	aPoint isNil
    		ifTrue: [atomicPoint := self defaultAtomicPoint]
    		ifFalse: [atomicPoint := Jun3dPoint fromPoint: aPoint]
  10. atomicRadius [accessing] xrefs
    	atomicRadius isNil ifTrue: [atomicRadius := self defaultAtomicRadius].
    	^atomicRadius
  11. atomicRadius: aNumber [accessing] xrefs
     
    	aNumber isNil
    		ifTrue: [atomicRadius := self defaultAtomicRadius]
    		ifFalse: [atomicRadius := aNumber asDouble]
  12. atomicSymbol [accessing] xrefs
    	atomicSymbol isNil ifTrue: [atomicSymbol := self defaultAtomicSymbol].
    	^atomicSymbol
  13. atomicSymbol: aString [accessing] xrefs
     
    	aString isNil 
    		ifTrue: [atomicSymbol := self defaultAtomicSymbol]
    		ifFalse: [atomicSymbol := aString asString]
  14. attributeTable [attribute accessing] xrefs
    	attributeTable isNil ifTrue: [attributeTable := JunAttributeTable new].
    	^attributeTable
  15. containsPoint: aPoint [testing] xrefs
     
    	^(self atomicPoint distance: aPoint) <= self atomicRadius
  16. defaultAtomicBody [defaults] xrefs
    	| aBall centerPoint radiusValue colorValue aTransformation aSphere |
    	aBall := JunOpenGL3dObject ball: 2.
    	centerPoint := self atomicPoint.
    	radiusValue := self atomicRadius.
    	colorValue := (self class atomicColorAt: self atomicSymbol) 
    				blendWith: ColorValue white.
    	aTransformation := (Jun3dTransformation 
    				scale: radiusValue , radiusValue , radiusValue) 
    					product: (Jun3dTransformation translate: centerPoint).
    	aSphere := aBall transform: aTransformation.
    	aSphere polygonsDo: [:aPolygon | aPolygon paint: colorValue].
    	^aSphere
  17. defaultAtomicPoint [defaults] xrefs
    	^0.0d , 0.0d , 0.0d
  18. defaultAtomicRadius [defaults] xrefs
    	^0.37d
  19. defaultAtomicSymbol [defaults] xrefs
    	^'H' copy
  20. displayBooleanOfModifier [attribute accessing] xrefs
    	^self attributeTable at: #displayBooleanOfModifier ifAbsent: [false]
  21. displayBooleanOfModifier: aBoolean [attribute accessing] xrefs
     
    	aBoolean ifNil: [self attributeTable removeKey: #displayBooleanOfModifier]
    		ifNotNil: [:it | self attributeTable at: #displayBooleanOfModifier put: it = true]
  22. displayBooleanOfSerialNumber [attribute accessing] xrefs
    	^self attributeTable at: #displayBooleanOfSerialNumber ifAbsent: [false]
  23. displayBooleanOfSerialNumber: aBoolean [attribute accessing] xrefs
     
    	aBoolean 
    		ifNil: [self attributeTable removeKey: #displayBooleanOfSerialNumber]
    		ifNotNil: 
    			[:it | 
    			self attributeTable at: #displayBooleanOfSerialNumber put: it = true]
  24. displayBoxOfModifier [attribute accessing] xrefs
    	^self attributeTable at: #displayBoxOfModifier ifAbsent: [nil]
  25. displayBoxOfModifier: aBox [attribute accessing] xrefs
     
    	aBox ifNil: [self attributeTable removeKey: #displayBoxOfModifier]
    		ifNotNil: [:it | self attributeTable at: #displayBoxOfModifier put: it]
  26. displayBoxOfSerialNumber [attribute accessing] xrefs
    	^self attributeTable at: #displayBoxOfSerialNumber ifAbsent: [nil]
  27. displayBoxOfSerialNumber: aBox [attribute accessing] xrefs
     
    	aBox ifNil: [self attributeTable removeKey: #displayBoxOfSerialNumber]
    		ifNotNil: [:it | self attributeTable at: #displayBoxOfSerialNumber put: it]
  28. displayComposedTextOfSerialNumber [attribute accessing] xrefs
    	^self attributeTable at: #displayComposedTextOfSerialNumber ifAbsent: [nil]
  29. displayComposedTextOfSerialNumber: aComposedText [attribute accessing] xrefs
     
    	aComposedText 
    		ifNil: [self attributeTable removeKey: #displayComposedTextOfSerialNumber]
    		ifNotNil: [:it | self attributeTable at: #displayComposedTextOfSerialNumber put: it]
  30. displayFocusAtomPointOfModifier [attribute accessing] xrefs
    	^self attributeTable at: #displayFocusAtomPointOfModifier ifAbsent: [nil]
  31. displayFocusAtomPointOfModifier: aPoint [attribute accessing] xrefs
     
    	aPoint 
    		ifNil: [self attributeTable removeKey: #displayFocusAtomPointOfModifier]
    		ifNotNil: [:it | self attributeTable at: #displayFocusAtomPointOfModifier put: it]
  32. displayImageOfModifier [attribute accessing] xrefs
    	^self attributeTable at: #displayImageOfModifier ifAbsent: [nil]
  33. displayImageOfModifier: anImage [attribute accessing] xrefs
     
    	anImage ifNil: [self attributeTable removeKey: #displayImageOfModifier]
    		ifNotNil: [:it | self attributeTable at: #displayImageOfModifier put: it]
  34. displayOffsetOfModifier [attribute accessing] xrefs
    	^self attributeTable at: #displayOffsetOfModifier ifAbsent: [nil]
  35. displayOffsetOfModifier: aPoint [attribute accessing] xrefs
     
    	aPoint ifNil: [self attributeTable removeKey: #displayOffsetOfModifier]
    		ifNotNil: [:it | self attributeTable at: #displayOffsetOfModifier put: it]
  36. displayOffsetOfSerialNumber [attribute accessing] xrefs
    	^self attributeTable at: #displayOffsetOfSerialNumber ifAbsent: [nil]
  37. displayOffsetOfSerialNumber: aPoint [attribute accessing] xrefs
     
    	aPoint 
    		ifNil: [self attributeTable removeKey: #displayOffsetOfSerialNumber]
    		ifNotNil: [:it | self attributeTable at: #displayOffsetOfSerialNumber put: it]
  38. displayOrderOfModifier [attribute accessing] xrefs
    	^self attributeTable at: #displayOrderOfModifier ifAbsent: [0]
  39. displayOrderOfModifier: zValue [attribute accessing] xrefs
     
    	zValue ifNil: [self attributeTable removeKey: #displayOrderOfModifier]
    		ifNotNil: [:it | self attributeTable at: #displayOrderOfModifier put: it]
  40. displayOrderOfSerialNumber [attribute accessing] xrefs
    	^self attributeTable at: #displayOrderOfSerialNumber ifAbsent: [0]
  41. displayOrderOfSerialNumber: zValue [attribute accessing] xrefs
     
    	zValue ifNil: [self attributeTable removeKey: #displayOrderOfSerialNumber]
    		ifNotNil: [:it | self attributeTable at: #displayOrderOfSerialNumber put: it]
  42. distanceFrom: aPoint [functions] xrefs
     
    	^(self to: aPoint) length
  43. from: aPoint [functions] xrefs
     
    	^self atomicPoint from: aPoint
  44. frontierArea [accessing] xrefs
    	| area |
    	self atomicBody ifNil: [area := self atomicArea]
    		ifNotNil: 
    			[:atomBody | 
    			area := atomBody area.
    			self areaCoefficient ifNotNil: [:coefficient | area := area * coefficient]].
    	^area
  45. hasAtomicColor [testing] xrefs
    	^self attributeTable includesKey: #atomicColor
  46. initialize [initialize-release] xrefs
    	super initialize.
    	atomicSymbol := nil.
    	atomicPoint := nil.
    	atomicRadius := nil.
    	atomicBody := nil.
    	areaCoefficient := nil.
    	attributeTable := nil
  47. interierArea [accessing] xrefs
    	^self atomicArea - self frontierArea
  48. isCarbon [testing] xrefs
    	^self atomicSymbol = 'C'
  49. isChlorine [testing] xrefs
    	^self atomicSymbol = 'Cl'
  50. isFluorine [testing] xrefs
    	^self atomicSymbol = 'F'
  51. isHydrogen [testing] xrefs
    	^self atomicSymbol = 'H'
  52. isNitrogen [testing] xrefs
    	^self atomicSymbol = 'N'
  53. isOxygen [testing] xrefs
    	^self atomicSymbol = 'O'
  54. isPhosphorus [testing] xrefs
    	^self atomicSymbol = 'P'
  55. isSilicon [testing] xrefs
    	^self atomicSymbol = 'Si'
  56. isSulfur [testing] xrefs
    	^self atomicSymbol = 'S'
  57. postCopy [copying] xrefs
    	super postCopy.
    	atomicPoint := atomicPoint copy.
    	atomicBody := atomicBody copy.
    	attributeTable := attributeTable copy
  58. printOn: aStream [printing] xrefs
     
    	aStream nextPutAll: '('.
    	aStream nextPutAll: self serialNumber printString.
    	aStream space.
    	aStream nextPutAll: self atomicSymbol printString.
    	aStream space.
    	aStream nextPutAll: self atomicPoint printString.
    	aStream space.
    	aStream nextPutAll: self atomicRadius printString.
    	aStream nextPutAll: ')'
  59. serialNumber [attribute accessing] xrefs
    	^self attributeTable at: #serialNumber ifAbsent: [0]
  60. serialNumber: positiveInteger [attribute accessing] xrefs
     
    	positiveInteger ifNil: [self attributeTable removeKey: #serialNumber]
    		ifNotNil: [:it | self attributeTable at: #serialNumber put: it]
  61. to: aPoint [functions] xrefs
     
    	^self atomicPoint to: aPoint

class methods:

  1. atomicBonds [constants] xrefs
    	"ChemoJunAtomObject atomicBonds."
    
    	"ChemoJunAtomObject flushConstants."
    
    	| aDictionary |
    	AtomicBonds isNil 
    		ifTrue: 
    			[aDictionary := Dictionary new.
    			aDictionary at: 'H' put: 1.
    			aDictionary at: 'He' put: 0.
    			aDictionary at: 'Li' put: 1.
    			aDictionary at: 'Be' put: 2.
    			aDictionary at: 'B' put: 3.
    			aDictionary at: 'C' put: 4.
    			aDictionary at: 'N' put: 3.
    			aDictionary at: 'O' put: 2.
    			aDictionary at: 'F' put: 1.
    			aDictionary at: 'Ne' put: 0.
    			aDictionary at: 'Na' put: 1.
    			aDictionary at: 'Mg' put: 2.
    			aDictionary at: 'Al' put: 3.
    			aDictionary at: 'Si' put: 4.
    			aDictionary at: 'P' put: 3.
    			aDictionary at: 'S' put: 2.
    			aDictionary at: 'Cl' put: 1.
    			aDictionary at: 'Ar' put: 0.
    			aDictionary at: 'K' put: 1.
    			aDictionary at: 'Ca' put: 2.
    			AtomicBonds := aDictionary].
    	^AtomicBonds
  2. atomicBondsAt: atomicSymbol [constants] xrefs
     
    	"ChemoJunAtomObject atomicBondsAt: 'H'."
    
    	^self atomicBonds at: atomicSymbol asString ifAbsent: [0]
  3. atomicColorAt: atomicSymbol [constants] xrefs
     
    	"ChemoJunAtomObject atomicColorAt: 'H'."
    
    	atomicSymbol isNil ifTrue: [^ColorValue veryLightGray].
    	^self atomicColors at: atomicSymbol asString ifAbsent: [ColorValue veryLightGray]
  4. atomicColors [constants] xrefs
    	"ChemoJunAtomObject atomicColors."
    
    	"ChemoJunAtomObject flushConstants."
    
    	| aDictionary definedAtoms definedColors undefinedAtoms totalSize colorValue |
    	AtomicColors isNil 
    		ifTrue: 
    			[aDictionary := Dictionary new.
    			aDictionary at: 'H' put: ColorValue veryLightGray.
    			aDictionary at: 'C' put: ColorValue veryDarkGray.
    			aDictionary at: 'N' put: ColorValue blue.
    			aDictionary at: 'O' put: ColorValue red.
    			aDictionary at: 'F' put: ColorValue brown.
    			aDictionary at: 'Na' put: ColorValue cyan.
    			aDictionary at: 'P' put: (ColorValue yellow blendWith: ColorValue black).
    			aDictionary at: 'S' put: ColorValue yellow.
    			aDictionary at: 'Cl' put: ColorValue green.
    			aDictionary at: 'Br' put: ColorValue darkGreen.
    			definedAtoms := aDictionary keys asSet.
    			definedColors := aDictionary values asSet.
    			undefinedAtoms := (self vanDerWaalsRadii keys 
    						reject: [:atomicSymbol | definedAtoms includes: atomicSymbol]) 
    							asSortedCollection asOrderedCollection.
    			totalSize := undefinedAtoms size + definedAtoms size.
    			(0 to: totalSize by: 1 / totalSize) do: 
    					[:hueValue | 
    					undefinedAtoms isEmpty 
    						ifFalse: 
    							[colorValue := ColorValue 
    										hue: hueValue
    										saturation: 1
    										brightness: 1.
    							(definedColors includes: colorValue) 
    								ifFalse: 
    									[| atomicSymbol |
    									atomicSymbol := undefinedAtoms removeFirst.
    									aDictionary at: atomicSymbol put: colorValue]]].
    			AtomicColors := aDictionary].
    	^AtomicColors
  5. atomicSymbol: aString atomicPoint: aPoint [instance creation] xrefs
     
    	| aNumber |
    	aNumber := self vanDerWaalsRadiusAt: aString.
    	^self 
    		atomicSymbol: aString
    		atomicPoint: aPoint
    		atomicRadius: aNumber
  6. atomicSymbol: aString atomicPoint: aPoint atomicRadius: aNumber [instance creation] xrefs
     
    	| atomicObject |
    	atomicObject := self new.
    	atomicObject atomicSymbol: aString.
    	atomicObject atomicPoint: aPoint.
    	atomicObject atomicRadius: aNumber.
    	^atomicObject
  7. copyright [copyright] xrefs
    	^'ChemoJun050 (2006/08/08) Copyright 2002-2006 National Institute of Informatics, Research Organization of Information and Systems.'
  8. defaultAtomConnectionClass [defaults] xrefs
    	^self defaultMoleculeObjectClass defaultAtomConnectionClass
  9. defaultMoleculeObjectClass [defaults] xrefs
    	^ChemoJunMoleculeObject
  10. example1 [examples] xrefs
    	"ChemoJunAtomObject example1."
    
    	| atomObject |
    	atomObject := ChemoJunAtomObject new.
    	^atomObject
  11. example2 [examples] xrefs
    	"ChemoJunAtomObject example2."
    
    	| atomObject |
    	atomObject := ChemoJunAtomObject new.
    	atomObject defaultAtomicBody show.
    	^atomObject
  12. flushConstants [constants] xrefs
    	"ChemoJunAtomObject flushConstants."
    
    	VanDerWaalsRadii := nil.
    	AtomicColors := nil.
    	AtomicBonds := nil
  13. initialize [class initialization] xrefs
    	"ChemoJunAtomObject initialize."
    
    	self flushConstants
  14. system [copyright] xrefs
    	^'ChemoJun'
  15. vanDerWaalsRadii [constants] xrefs
    	"ChemoJunAtomObject vanDerWaalsRadii."
    
    	"ChemoJunAtomObject flushConstants."
    
    	VanDerWaalsRadii isNil 
    		ifTrue: 
    			[| aDictionary |
    			aDictionary := Dictionary new.
    			aDictionary at: 'H' put: 1.2d.
    			aDictionary at: 'He' put: 1.4d.
    			aDictionary at: 'Li' put: 1.82d.
    			aDictionary at: 'Be' put: 0.0d.
    			aDictionary at: 'B' put: 1.75d.
    			aDictionary at: 'C' put: 1.7d.
    			aDictionary at: 'N' put: 1.55d.
    			aDictionary at: 'O' put: 1.52d.
    			aDictionary at: 'F' put: 1.47d.
    			aDictionary at: 'Ne' put: 1.54d.
    			aDictionary at: 'Na' put: 2.27d.
    			aDictionary at: 'Mg' put: 1.73d.
    			aDictionary at: 'Al' put: 1.78d.
    			aDictionary at: 'Si' put: 2.1d.
    			aDictionary at: 'P' put: 1.8d.
    			aDictionary at: 'S' put: 1.8d.
    			aDictionary at: 'Cl' put: 1.75d.
    			aDictionary at: 'Ar' put: 1.88d.
    			aDictionary at: 'K' put: 2.75d.
    			aDictionary at: 'Ca' put: 2.32d.
    			aDictionary at: 'Sc' put: 1.98d.
    			aDictionary at: 'Ti' put: 1.8d.
    			aDictionary at: 'V' put: 1.66d.
    			aDictionary at: 'Cr' put: 1.6d.
    			aDictionary at: 'Mn' put: 1.47d.
    			aDictionary at: 'Fe' put: 1.59d.
    			aDictionary at: 'Co' put: 1.6d.
    			aDictionary at: 'Ni' put: 1.63d.
    			aDictionary at: 'Cu' put: 1.4d.
    			aDictionary at: 'Zn' put: 1.39d.
    			aDictionary at: 'Ga' put: 0.0d.
    			aDictionary at: 'Ge' put: 1.98d.
    			aDictionary at: 'As' put: 1.85d.
    			aDictionary at: 'Se' put: 1.9d.
    			aDictionary at: 'Br' put: 1.85d.
    			aDictionary at: 'Kr' put: 2.02d.
    			aDictionary at: 'Rb' put: 0.0d.
    			aDictionary at: 'Sr' put: 0.0d.
    			aDictionary at: 'Y ' put: 0.0d.
    			aDictionary at: 'Zr' put: 0.0d.
    			aDictionary at: 'Nb' put: 0.0d.
    			aDictionary at: 'Mo' put: 0.0d.
    			aDictionary at: 'Tc' put: 0.0d.
    			aDictionary at: 'Ru' put: 0.0d.
    			aDictionary at: 'Rh' put: 0.0d.
    			aDictionary at: 'Pd' put: 1.63d.
    			aDictionary at: 'Ag' put: 1.72d.
    			aDictionary at: 'Cd' put: 1.58d.
    			aDictionary at: 'In' put: 1.93d.
    			aDictionary at: 'Sn' put: 2.16d.
    			aDictionary at: 'Sb' put: 2.12d.
    			aDictionary at: 'Te' put: 2.06d.
    			aDictionary at: 'I ' put: 1.98d.
    			aDictionary at: 'Xe' put: 2.16d.
    			aDictionary at: 'Cs' put: 0.0d.
    			aDictionary at: 'Ba' put: 0.0d.
    			aDictionary at: 'La' put: 0.0d.
    			aDictionary at: 'Ce' put: 0.0d.
    			aDictionary at: 'Pr' put: 0.0d.
    			aDictionary at: 'Nd' put: 0.0d.
    			aDictionary at: 'Pm' put: 0.0d.
    			aDictionary at: 'Sm' put: 0.0d.
    			aDictionary at: 'Eu' put: 0.0d.
    			aDictionary at: 'Gd' put: 0.0d.
    			aDictionary at: 'Tb' put: 0.0d.
    			aDictionary at: 'Dy' put: 0.0d.
    			aDictionary at: 'Ho' put: 0.0d.
    			aDictionary at: 'Er' put: 0.0d.
    			aDictionary at: 'Tm' put: 0.0d.
    			aDictionary at: 'Yb' put: 0.0d.
    			aDictionary at: 'Lu' put: 0.0d.
    			aDictionary at: 'Hf' put: 0.0d.
    			aDictionary at: 'Ta' put: 0.0d.
    			aDictionary at: 'W ' put: 0.0d.
    			aDictionary at: 'Re' put: 0.0d.
    			aDictionary at: 'Os' put: 0.0d.
    			aDictionary at: 'Ir' put: 0.0d.
    			aDictionary at: 'Pt' put: 1.75d.
    			aDictionary at: 'Au' put: 1.66d.
    			aDictionary at: 'Hg' put: 1.55d.
    			aDictionary at: 'Tl' put: 1.96d.
    			aDictionary at: 'Pb' put: 2.02d.
    			aDictionary at: 'Bi' put: 0.0d.
    			aDictionary at: 'Po' put: 0.0d.
    			aDictionary at: 'At' put: 0.0d.
    			aDictionary at: 'Rn' put: 0.0d.
    			aDictionary at: 'Fr' put: 0.0d.
    			aDictionary at: 'Ra' put: 0.0d.
    			aDictionary at: 'Ac' put: 0.0d.
    			aDictionary at: 'Th' put: 0.0d.
    			aDictionary at: 'Pa' put: 0.0d.
    			aDictionary at: 'U ' put: 0.0d.
    			aDictionary at: 'Np' put: 0.0d.
    			aDictionary at: 'Pu' put: 0.0d.
    			aDictionary at: 'Am' put: 0.0d.
    			aDictionary at: 'Cm' put: 0.0d.
    			aDictionary at: 'Bk' put: 0.0d.
    			aDictionary at: 'Cf' put: 0.0d.
    			aDictionary at: 'Es' put: 0.0d.
    			aDictionary at: 'Fm' put: 0.0d.
    			aDictionary at: 'Md' put: 0.0d.
    			aDictionary at: 'No' put: 0.0d.
    			aDictionary at: 'Lr' put: 0.0d.
    			VanDerWaalsRadii := aDictionary].
    	^VanDerWaalsRadii
  16. vanDerWaalsRadiusAt: atomicSymbol [constants] xrefs
     
    	"ChemoJunAtomObject vanDerWaalsRadiusAt: 'H'."
    
    	^self vanDerWaalsRadii at: atomicSymbol asString ifAbsent: [1.0d]
  17. version [copyright] xrefs
    	^'050'

index xrefs