/** Called every time the trajectory changes. Set up FrameMask for the new * parmtop and allocate space for selected atoms from the Frame. */ Action::RetType Action_Rmsd::Setup(Topology* currentParm, Topology** parmAddress) { // Target setup if (SetupRmsMask(*currentParm, "rmsd")) return Action::ERR; // Reference setup if (SetupRef(*currentParm, TgtMask().Nselected(), "rmsd")) return Action::ERR; // Per residue rmsd setup if (perres_) { // If RefParm is still NULL probably 'first', set now. if (RefParm_ == 0) RefParm_ = currentParm; if (perResSetup(currentParm, RefParm_)) return Action::ERR; } return Action::OK; }
/** Called every time the trajectory changes. Set up FrameMask for the new * parmtop and allocate space for selected atoms from the Frame. */ Action::RetType Action_Rmsd::Setup(ActionSetup& setup) { // Target setup if ( setup.Top().SetupIntegerMask( tgtMask_ ) ) return Action::ERR; mprintf("\tTarget mask:"); tgtMask_.BriefMaskInfo(); mprintf("\n"); if ( tgtMask_.None() ) { mprintf("Warning: No atoms in mask '%s'.\n", tgtMask_.MaskString()); return Action::SKIP; } // Allocate space for selected atoms in the frame. This will also put the // correct masses in based on the mask. tgtFrame_.SetupFrameFromMask(tgtMask_, setup.Top().Atoms()); // Reference setup if (REF_.SetupRef(setup.Top(), tgtMask_.Nselected(), "rmsd")) return Action::SKIP; // Per residue rmsd setup if (perres_) { // If RefParm is still NULL probably 'first', set now. if (RefParm_ == 0) RefParm_ = setup.TopAddress(); int err = perResSetup(setup.Top(), *RefParm_); if (err == 1) return Action::SKIP; else if (err == 2) return Action::ERR; } // Warn if PBC and rotating if (rotate_ && setup.CoordInfo().TrajBox().Type() != Box::NOBOX) { mprintf("Warning: Coordinates are being rotated and box coordinates are present.\n" "Warning: Unit cell vectors are NOT rotated; imaging will not be possible\n" "Warning: after the RMS-fit is performed.\n"); } return Action::OK; }