git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@111
a2be9bc6-48de-4e38-9406-
05402d4bc13c
return -2; /* Number of atoms does not match */
for (i = 0, ap1 = arena->mol->atoms, ap2 = arena->xmol->atoms; i < arena->mol->natoms; i++, ap1 = ATOM_NEXT(ap1), ap2 = ATOM_NEXT(ap2)) {
ap1->r = ap2->r;
+ ap1->occupancy = ap2->occupancy; /* Occupancy can be used to exclude particular atoms */
}
if (arena->mol->cell != NULL && arena->xmol->cell != NULL)
memmove(arena->mol->cell, arena->xmol->cell, sizeof(XtalCell));
static VALUE s_AtomRef_SetOccupancy(VALUE self, VALUE val) {
VALUE oval = s_AtomRef_GetOccupancy(self);
+ Molecule *mp;
val = rb_Float(val);
- s_AtomFromValue(self)->occupancy = NUM2DBL(val);
+ s_AtomAndMoleculeFromValue(self, &mp)->occupancy = NUM2DBL(val);
s_RegisterUndoForAtomAttrChange(self, s_OccupancySym, val, oval);
+ mp->needsMDCopyCoordinates = 1; /* Occupancy can be used to exclude particular atoms from MM/MD */
return val;
}