AtomSymbol generateSymbol ( IAtomContainer container , IAtom atom , HydrogenPosition position , RendererModel model ) { if ( atom instanceof IPseudoAtom ) { IPseudoAtom pAtom = ( IPseudoAtom ) atom ; if ( pAtom . getAttachPointNum ( ) <= 0 ) { if ( pAtom . getLabel ( ) . equals ( "*" ) ) { int mass = unboxSafely ( pAtom . getMassNumber ( ) , 0 ) ; int charge = unboxSafely ( pAtom . getFormalCharge ( ) , 0 ) ; int hcnt = unboxSafely ( pAtom . getImplicitHydrogenCount ( ) , 0 ) ; int nrad = container . getConnectedSingleElectronsCount ( atom ) ; if ( mass != 0 || charge != 0 || hcnt != 0 ) { return generatePeriodicSymbol ( 0 , hcnt , mass , charge , nrad , position ) ; } } return generatePseudoSymbol ( accessPseudoLabel ( pAtom , "?" ) , position ) ; } else return null ; // attach point drawn in bond generator } else { int number = unboxSafely ( atom . getAtomicNumber ( ) , Elements . ofString ( atom . getSymbol ( ) ) . number ( ) ) ; // unset the mass if it's the major isotope (could be an option) Integer mass = atom . getMassNumber ( ) ; if ( number != 0 && mass != null && model != null && model . get ( StandardGenerator . OmitMajorIsotopes . class ) && isMajorIsotope ( number , mass ) ) { mass = null ; } return generatePeriodicSymbol ( number , unboxSafely ( atom . getImplicitHydrogenCount ( ) , 0 ) , unboxSafely ( mass , - 1 ) , unboxSafely ( atom . getFormalCharge ( ) , 0 ) , container . getConnectedSingleElectronsCount ( atom ) , position ) ; } }
Generate the displayed atom symbol for an atom in given structure with the specified hydrogen position .