Example #1
0
// Paste oriented model to target model
void Fragment::pasteOrientedModel(Vec3<double> origin, Model* target)
{
	Messenger::enter("Fragment::pasteOrientedModel");

	// Translate model to correct origin
	orientedModel_.translateSelectionLocal(origin, true);

	// Select all atoms except any anchor atoms
	orientedModel_.selectAll();
	orientedModel_.deselectElement(0);
	
	// Paste to the target model, bonding the anchor and linkPartners if a bond was there before
	Clipboard clip;
	clip.copySelection(&orientedModel_);
	clip.pasteToModel(target, false);

	// Translate orientedModel_ back to its previous position
	orientedModel_.translateSelectionLocal(-origin, true);
	orientedModel_.selectNone();
	
	Messenger::exit("Fragment::pasteOrientedModel");
}