boolean isEnergy = (pid == JmolConstants.PALETTE_ENERGY);
BondIterator iter = (selectedBonds != null ? modelSet.getBondIterator(selectedBonds)
: modelSet.getBondIterator(myMask, bs));
while (iter.hasNext()) {
bsColixSet.set(iter.nextIndex());
Bond bond = iter.next();
if (isEnergy) {
bond.setColix(setColix(colix, pid, bond));
bond.setPaletteID(pid);
} else {
bond.setColix(Graphics3D.getColix(JmolConstants.getArgbHbondType(bond.getOrder())));
}
}
return;
}
if (colix == Graphics3D.USE_PALETTE && pid != JmolConstants.PALETTE_CPK)
return; //palettes not implemented for bonds
BondIterator iter = (selectedBonds != null ? modelSet.getBondIterator(selectedBonds)
: modelSet.getBondIterator(myMask, bs));
while (iter.hasNext()) {
int iBond = iter.nextIndex();
Bond bond = iter.next();
bond.setColix(colix);
bsColixSet.set(iBond, (colix != Graphics3D.INHERIT_ALL
&& colix != Graphics3D.USE_PALETTE));
}
return;
}