Package org.jmol.shape

Examples of org.jmol.shape.Shape


        translateSelected();
      g3d.renderBackground();
      if (renderers == null)
        renderers = new ShapeRenderer[JmolConstants.SHAPE_MAX];
      for (int i = 0; i < JmolConstants.SHAPE_MAX && g3d.currentlyRendering(); ++i) {
        Shape shape = shapeManager.getShape(i);
        if (shape == null)
          continue;
        getRenderer(i, g3d).render(g3d, modelSet, shape);
        if (logTime)
          Logger.checkTimer("render time " + JmolConstants.getShapeClassName(i));
View Full Code Here


      Logger.error("Cannot export " + type);
      return null;
    }
    g3dExport.renderBackground();
    for (int i = 0; i < JmolConstants.SHAPE_MAX; ++i) {
      Shape shape = shapeManager.getShape(i);
      if (shape != null)
        getRenderer(i, g3d).render(g3dExport, modelSet, shape);
    }
    return g3dExport.finalizeOutput();
  }
View Full Code Here

  }
  public boolean checkObjectDragged(int prevX, int prevY, int x, int y,
                          int modifiers, BitSet bsVisible, int iShape) {
    for (int i = iShape; i < JmolConstants.SHAPE_MAX; ++i) {
      Shape shape = shapes[i];
      if (shape != null
          && shape.checkObjectDragged(prevX, prevY, x, y, modifiers, bsVisible)
          || iShape > 0)
        return true;
    }
    return false;
  }
View Full Code Here

  public Hashtable getShapeInfo() {
    Hashtable info = new Hashtable();
    StringBuffer commands = new StringBuffer();
    if (shapes != null)
      for (int i = 0; i < JmolConstants.SHAPE_MAX; ++i) {
        Shape shape = shapes[i];
        if (shape != null) {
          String shapeType = JmolConstants.shapeClassBases[i];
          List shapeDetail = shape.getShapeDetail();
          if (shapeDetail != null)
            info.put(shapeType, shapeDetail);
        }
      }
    if (commands.length() > 0)
View Full Code Here

  public void getShapeState(StringBuffer commands, boolean isAll) {
    if (shapes == null)
      return;
    String cmd;
    for (int i = 0; i < JmolConstants.SHAPE_MAX; ++i) {
      Shape shape = shapes[i];
      if (shape != null && (isAll || JmolConstants.isShapeSecondary(i))
          && (cmd = shape.getShapeState()) != null && cmd.length() > 1)
        commands.append(cmd);
    }
    commands.append("  select *;\n");
  }
View Full Code Here

        || shapeID == JmolConstants.SHAPE_STRUTS)
      return null;
    String className = JmolConstants.getShapeClassName(shapeID);
    try {
      Class shapeClass = Class.forName(className);
      Shape shape = (Shape) shapeClass.newInstance();
      viewer.setShapeErrorState(shapeID, "allocate");
      shape.initializeShape(viewer, g3d, modelSet, shapeID);
      viewer.setShapeErrorState(-1, null);
      return shape;
    } catch (Exception e) {
      Logger.error("Could not instantiate shape:" + className, e);
    }
View Full Code Here

    // BALLS sets the JmolConstants.ATOM_IN_MODEL flag.
    shapes[JmolConstants.SHAPE_BALLS].setVisibilityFlags(bs);

    //set clickability -- this enables measures and such
    for (int i = 0; i < JmolConstants.SHAPE_MAX; ++i) {
      Shape shape = shapes[i];
      if (shape != null)
        shape.setModelClickability();
    }
  }
View Full Code Here

    }
    return mad / 2000f;
  }

  public boolean frankClicked(int x, int y) {
    Shape frankShape = shapes[JmolConstants.SHAPE_FRANK];
    return (frankShape != null && frankShape.wasClicked(x, y));
  }
View Full Code Here

    Shape frankShape = shapes[JmolConstants.SHAPE_FRANK];
    return (frankShape != null && frankShape.wasClicked(x, y));
  }

  public boolean checkObjectHovered(int x, int y, BitSet bsVisible, boolean checkBonds) {
    Shape shape    = shapes[JmolConstants.SHAPE_STICKS];
    if (checkBonds && shape != null
        && shape.checkObjectHovered(x, y, bsVisible))
      return true;
    shape = shapes[JmolConstants.SHAPE_ECHO];
    if (shape != null && shape.checkObjectHovered(x, y, bsVisible))
      return true;
    shape = shapes[JmolConstants.SHAPE_ISOSURFACE];
    if (shape != null && shape.checkObjectHovered(x, y, bsVisible))
      return true;
    shape = shapes[JmolConstants.SHAPE_DRAW];
    if (shape != null && viewer.getDrawHover()
        && shape.checkObjectHovered(x, y, bsVisible))
      return true;
    shape = shapes[JmolConstants.SHAPE_FRANK];
    if (viewer.getShowFrank() && shape != null 
        && shape.checkObjectHovered(x, y, bsVisible))
      return true;
    return false;
  }
View Full Code Here

    return false;
  }

  public Token checkObjectClicked(int x, int y, int modifiers,
                                    BitSet bsVisible) {
    Shape shape;
    Point3fi pt = null;
    if ((shape = shapes[JmolConstants.SHAPE_ISOSURFACE]) != null
        && (viewer.getDrawPicking() || viewer.getNavigationMode() && viewer.getNavigateSurface())
         && (pt = shape.checkObjectClicked(x, y, modifiers, bsVisible)) != null)
      return new Token(Token.isosurface, pt);

    if (modifiers != 0 && viewer.getBondPicking()
        && (pt = shapes[JmolConstants.SHAPE_STICKS].checkObjectClicked(x, y,
            modifiers, bsVisible)) != null)
      return new Token(Token.bonds, pt);

    if ((shape = shapes[JmolConstants.SHAPE_ECHO])!= null && modifiers != 0
        && (pt = shape.checkObjectClicked(x, y, modifiers, bsVisible)) != null)
      return new Token(Token.echo, pt);
    if ((shape = shapes[JmolConstants.SHAPE_DRAW]) != null &&
        (pt = shape.checkObjectClicked(x, y, modifiers, bsVisible)) != null)
      return new Token(Token.draw, pt);
    return null;
  }
View Full Code Here

TOP

Related Classes of org.jmol.shape.Shape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.