コード例 #1
0
 public JmolSymmetryScriptGeneratorCn(RotationAxisAligner axisTransformation, String name) {
   super(axisTransformation, name);
   if (axisTransformation.getRotationGroup().getPointGroup().equals("C2")) {
     setPolyhedron(
         new RectangularPrism(
             axisTransformation.getDimension().z * 2,
             axisTransformation.getDimension().x * 2,
             axisTransformation.getDimension().y * 2));
   } else {
     Prism p = new Prism(axisTransformation.getRotationGroup().getRotation(0).getFold());
     p.setHeight(axisTransformation.getDimension().z * 2);
     p.setInscribedRadius(axisTransformation.getRadius());
     setPolyhedron(p);
   }
 }
コード例 #2
0
  @Override
  public int getZoom() {
    // find maximum extension of structure
    double maxExtension = getMaxExtension();
    // find maximum extension of polyhedron
    RotationAxisAligner at = getAxisTransformation();
    double polyhedronExtension =
        Math.max(getPolyhedron().getCirumscribedRadius(), at.getDimension().z);

    int zoom = Math.round((float) (maxExtension / polyhedronExtension * 110));
    if (zoom > 100) {
      zoom = 100;
    }
    return zoom;
  }