-
areaCoefficient [accessing]
^areaCoefficient
-
areaCoefficient: coefficient [accessing]
areaCoefficient := coefficient
-
atomicArea [accessing]
^(Jun3dBoundingBall center: self atomicPoint radius: self atomicRadius)
area
-
atomicBody [accessing]
^atomicBody
-
atomicBody: aBody [accessing]
atomicBody := aBody asJunOpenGL3dObject
-
atomicColor [attribute accessing]
^self attributeTable at: #atomicColor
ifAbsent: [self class atomicColorAt: self atomicSymbol]
-
atomicColor: colorValue [attribute accessing]
colorValue ifNil: [self attributeTable removeKey: #atomicColor]
ifNotNil: [:it | self attributeTable at: #atomicColor put: it]
-
atomicPoint [accessing]
atomicPoint isNil ifTrue: [atomicPoint := self defaultAtomicPoint].
^atomicPoint
-
atomicPoint: aPoint [accessing]
aPoint isNil
ifTrue: [atomicPoint := self defaultAtomicPoint]
ifFalse: [atomicPoint := Jun3dPoint fromPoint: aPoint]
-
atomicRadius [accessing]
atomicRadius isNil ifTrue: [atomicRadius := self defaultAtomicRadius].
^atomicRadius
-
atomicRadius: aNumber [accessing]
aNumber isNil
ifTrue: [atomicRadius := self defaultAtomicRadius]
ifFalse: [atomicRadius := aNumber asDouble]
-
atomicSymbol [accessing]
atomicSymbol isNil ifTrue: [atomicSymbol := self defaultAtomicSymbol].
^atomicSymbol
-
atomicSymbol: aString [accessing]
aString isNil
ifTrue: [atomicSymbol := self defaultAtomicSymbol]
ifFalse: [atomicSymbol := aString asString]
-
attributeTable [attribute accessing]
attributeTable isNil ifTrue: [attributeTable := JunAttributeTable new].
^attributeTable
-
containsPoint: aPoint [testing]
^(self atomicPoint distance: aPoint) <= self atomicRadius
-
defaultAtomicBody [defaults]
| 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
-
defaultAtomicPoint [defaults]
^0.0d , 0.0d , 0.0d
-
defaultAtomicRadius [defaults]
^0.37d
-
defaultAtomicSymbol [defaults]
^'H' copy
-
displayBooleanOfModifier [attribute accessing]
^self attributeTable at: #displayBooleanOfModifier ifAbsent: [false]
-
displayBooleanOfModifier: aBoolean [attribute accessing]
aBoolean ifNil: [self attributeTable removeKey: #displayBooleanOfModifier]
ifNotNil: [:it | self attributeTable at: #displayBooleanOfModifier put: it = true]
-
displayBooleanOfSerialNumber [attribute accessing]
^self attributeTable at: #displayBooleanOfSerialNumber ifAbsent: [false]
-
displayBooleanOfSerialNumber: aBoolean [attribute accessing]
aBoolean
ifNil: [self attributeTable removeKey: #displayBooleanOfSerialNumber]
ifNotNil:
[:it |
self attributeTable at: #displayBooleanOfSerialNumber put: it = true]
-
displayBoxOfModifier [attribute accessing]
^self attributeTable at: #displayBoxOfModifier ifAbsent: [nil]
-
displayBoxOfModifier: aBox [attribute accessing]
aBox ifNil: [self attributeTable removeKey: #displayBoxOfModifier]
ifNotNil: [:it | self attributeTable at: #displayBoxOfModifier put: it]
-
displayBoxOfSerialNumber [attribute accessing]
^self attributeTable at: #displayBoxOfSerialNumber ifAbsent: [nil]
-
displayBoxOfSerialNumber: aBox [attribute accessing]
aBox ifNil: [self attributeTable removeKey: #displayBoxOfSerialNumber]
ifNotNil: [:it | self attributeTable at: #displayBoxOfSerialNumber put: it]
-
displayComposedTextOfSerialNumber [attribute accessing]
^self attributeTable at: #displayComposedTextOfSerialNumber ifAbsent: [nil]
-
displayComposedTextOfSerialNumber: aComposedText [attribute accessing]
aComposedText
ifNil: [self attributeTable removeKey: #displayComposedTextOfSerialNumber]
ifNotNil: [:it | self attributeTable at: #displayComposedTextOfSerialNumber put: it]
-
displayFocusAtomPointOfModifier [attribute accessing]
^self attributeTable at: #displayFocusAtomPointOfModifier ifAbsent: [nil]
-
displayFocusAtomPointOfModifier: aPoint [attribute accessing]
aPoint
ifNil: [self attributeTable removeKey: #displayFocusAtomPointOfModifier]
ifNotNil: [:it | self attributeTable at: #displayFocusAtomPointOfModifier put: it]
-
displayImageOfModifier [attribute accessing]
^self attributeTable at: #displayImageOfModifier ifAbsent: [nil]
-
displayImageOfModifier: anImage [attribute accessing]
anImage ifNil: [self attributeTable removeKey: #displayImageOfModifier]
ifNotNil: [:it | self attributeTable at: #displayImageOfModifier put: it]
-
displayOffsetOfModifier [attribute accessing]
^self attributeTable at: #displayOffsetOfModifier ifAbsent: [nil]
-
displayOffsetOfModifier: aPoint [attribute accessing]
aPoint ifNil: [self attributeTable removeKey: #displayOffsetOfModifier]
ifNotNil: [:it | self attributeTable at: #displayOffsetOfModifier put: it]
-
displayOffsetOfSerialNumber [attribute accessing]
^self attributeTable at: #displayOffsetOfSerialNumber ifAbsent: [nil]
-
displayOffsetOfSerialNumber: aPoint [attribute accessing]
aPoint
ifNil: [self attributeTable removeKey: #displayOffsetOfSerialNumber]
ifNotNil: [:it | self attributeTable at: #displayOffsetOfSerialNumber put: it]
-
displayOrderOfModifier [attribute accessing]
^self attributeTable at: #displayOrderOfModifier ifAbsent: [0]
-
displayOrderOfModifier: zValue [attribute accessing]
zValue ifNil: [self attributeTable removeKey: #displayOrderOfModifier]
ifNotNil: [:it | self attributeTable at: #displayOrderOfModifier put: it]
-
displayOrderOfSerialNumber [attribute accessing]
^self attributeTable at: #displayOrderOfSerialNumber ifAbsent: [0]
-
displayOrderOfSerialNumber: zValue [attribute accessing]
zValue ifNil: [self attributeTable removeKey: #displayOrderOfSerialNumber]
ifNotNil: [:it | self attributeTable at: #displayOrderOfSerialNumber put: it]
-
distanceFrom: aPoint [functions]
^(self to: aPoint) length
-
from: aPoint [functions]
^self atomicPoint from: aPoint
-
frontierArea [accessing]
| area |
self atomicBody ifNil: [area := self atomicArea]
ifNotNil:
[:atomBody |
area := atomBody area.
self areaCoefficient ifNotNil: [:coefficient | area := area * coefficient]].
^area
-
hasAtomicColor [testing]
^self attributeTable includesKey: #atomicColor
-
initialize [initialize-release]
super initialize.
atomicSymbol := nil.
atomicPoint := nil.
atomicRadius := nil.
atomicBody := nil.
areaCoefficient := nil.
attributeTable := nil
-
interierArea [accessing]
^self atomicArea - self frontierArea
-
isCarbon [testing]
^self atomicSymbol = 'C'
-
isChlorine [testing]
^self atomicSymbol = 'Cl'
-
isFluorine [testing]
^self atomicSymbol = 'F'
-
isHydrogen [testing]
^self atomicSymbol = 'H'
-
isNitrogen [testing]
^self atomicSymbol = 'N'
-
isOxygen [testing]
^self atomicSymbol = 'O'
-
isPhosphorus [testing]
^self atomicSymbol = 'P'
-
isSilicon [testing]
^self atomicSymbol = 'Si'
-
isSulfur [testing]
^self atomicSymbol = 'S'
-
postCopy [copying]
super postCopy.
atomicPoint := atomicPoint copy.
atomicBody := atomicBody copy.
attributeTable := attributeTable copy
-
printOn: aStream [printing]
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: ')'
-
serialNumber [attribute accessing]
^self attributeTable at: #serialNumber ifAbsent: [0]
-
serialNumber: positiveInteger [attribute accessing]
positiveInteger ifNil: [self attributeTable removeKey: #serialNumber]
ifNotNil: [:it | self attributeTable at: #serialNumber put: it]
-
to: aPoint [functions]
^self atomicPoint to: aPoint
-
atomicBonds [constants]
"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
-
atomicBondsAt: atomicSymbol [constants]
"ChemoJunAtomObject atomicBondsAt: 'H'."
^self atomicBonds at: atomicSymbol asString ifAbsent: [0]
-
atomicColorAt: atomicSymbol [constants]
"ChemoJunAtomObject atomicColorAt: 'H'."
atomicSymbol isNil ifTrue: [^ColorValue veryLightGray].
^self atomicColors at: atomicSymbol asString ifAbsent: [ColorValue veryLightGray]
-
atomicColors [constants]
"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
-
atomicSymbol: aString atomicPoint: aPoint [instance creation]
| aNumber |
aNumber := self vanDerWaalsRadiusAt: aString.
^self
atomicSymbol: aString
atomicPoint: aPoint
atomicRadius: aNumber
-
atomicSymbol: aString atomicPoint: aPoint atomicRadius: aNumber [instance creation]
| atomicObject |
atomicObject := self new.
atomicObject atomicSymbol: aString.
atomicObject atomicPoint: aPoint.
atomicObject atomicRadius: aNumber.
^atomicObject
-
copyright [copyright]
^'ChemoJun050 (2006/08/08) Copyright 2002-2006 National Institute of Informatics, Research Organization of Information and Systems.'
-
defaultAtomConnectionClass [defaults]
^self defaultMoleculeObjectClass defaultAtomConnectionClass
-
defaultMoleculeObjectClass [defaults]
^ChemoJunMoleculeObject
-
example1 [examples]
"ChemoJunAtomObject example1."
| atomObject |
atomObject := ChemoJunAtomObject new.
^atomObject
-
example2 [examples]
"ChemoJunAtomObject example2."
| atomObject |
atomObject := ChemoJunAtomObject new.
atomObject defaultAtomicBody show.
^atomObject
-
flushConstants [constants]
"ChemoJunAtomObject flushConstants."
VanDerWaalsRadii := nil.
AtomicColors := nil.
AtomicBonds := nil
-
initialize [class initialization]
"ChemoJunAtomObject initialize."
self flushConstants
-
system [copyright]
^'ChemoJun'
-
vanDerWaalsRadii [constants]
"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
-
vanDerWaalsRadiusAt: atomicSymbol [constants]
"ChemoJunAtomObject vanDerWaalsRadiusAt: 'H'."
^self vanDerWaalsRadii at: atomicSymbol asString ifAbsent: [1.0d]
-
version [copyright]
^'050'