public int getParticleCount(byte type, Shape shape) {
		int n = 0;
		for (int i = 0; i < numberOfAtoms; i++) {
			if (type == -1) {
				if (shape == null || atom[i].isCenterOfMassContained(shape)) {
					n++;
				}
			} else {
				if (atom[i].id == type) {
					if (shape == null || atom[i].isCenterOfMassContained(shape)) {
						n++;
					}
				}
			}
		}
		return n;
	}