All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.biojava.nbio.structure.xtal.UnitCellBoundingBox Maven / Gradle / Ivy

There is a newer version: 7.2.2
Show newest version
/*
 *                    BioJava development code
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  If you do not have a copy,
 * see:
 *
 *      http://www.gnu.org/copyleft/lesser.html
 *
 * Copyright for this code is held jointly by the individual
 * authors.  These should be listed in @author doc comments.
 *
 * For more information on the BioJava project and its aims,
 * or to join the biojava-l mailing list, visit the home page
 * at:
 *
 *      http://www.biojava.org/
 *
 */
package org.biojava.nbio.structure.xtal;

import org.biojava.nbio.structure.Calc;
import org.biojava.nbio.structure.Structure;
import org.biojava.nbio.structure.StructureTools;
import org.biojava.nbio.structure.contact.BoundingBox;

import javax.vecmath.Matrix4d;
import javax.vecmath.Vector3d;

/**
 * A class to contain the BoundingBoxes of all molecules in a full unit cell
 *
 * @author duarte_j
 *
 */
public class UnitCellBoundingBox {

	/**
	 * An array with dimensions numOperatorsSg x numChainsAu to contain all
	 * bounding boxes of all chains of all AUs in unit cell
	 * e.g. chainBbs[0] would be the bounding boxes for all chains in the original AU
	 */
	private BoundingBox[][] chainBbs;

	/**
	 * An array with dimensions numOperatorsSg to contain all bounding boxes of
	 * all AUs in unit cell
	 */
	private BoundingBox[] auBbs;

	private int numOperatorsSg; // i.e. multiplicity of space group
	private int numChainsAu;

	public UnitCellBoundingBox(int numOperatorsSg, int numChainsAu) {
		this.numOperatorsSg = numOperatorsSg;
		this.numChainsAu = numChainsAu;
		this.chainBbs = new BoundingBox[numOperatorsSg][numChainsAu];
		this.auBbs = new BoundingBox[numOperatorsSg];
	}

	public void setBbs(Structure structure, Matrix4d[] ops, boolean includeHetAtoms) {

		setBb(structure, includeHetAtoms, 0);
		for (int i=1;i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy