예제 #1
0
 /**
  * Set the useTexture3D property
  *
  * @param use the useTexture3D property
  */
 public void setUseTexture3D(boolean use) {
   useTexture3D = use;
   if (myDisplay != null) {
     try {
       myDisplay.addConstantMap(
           new ConstantMap(
               useTexture3D ? GraphicsModeControl.TEXTURE3D : GraphicsModeControl.STACK2D,
               Display.Texture3DMode));
     } catch (Exception e) {
       logException("setUseTexture3D", e);
     }
   }
 }
예제 #2
0
  /**
   * Call to help make this kind of Display Control; also calls code to made the Displayable (empty
   * of data thus far). This method is called from inside DisplayControlImpl.init(several args).
   *
   * @param dataChoice the DataChoice of the moment.
   * @return true if successful
   * @throws RemoteException Java RMI error
   * @throws VisADException VisAD Error
   */
  public boolean init(DataChoice dataChoice) throws VisADException, RemoteException {

    if (!isDisplay3D()) {
      LogUtil.userMessage(log_, "Can't render volume in 2D display");
      return false;
    }
    myDisplay = new VolumeDisplayable("volrend_" + dataChoice);
    myDisplay.setUseRGBTypeForSelect(true);
    myDisplay.addConstantMap(
        new ConstantMap(
            useTexture3D ? GraphicsModeControl.TEXTURE3D : GraphicsModeControl.STACK2D,
            Display.Texture3DMode));

    myDisplay.setPointSize(getPointSize());
    addDisplayable(myDisplay, getAttributeFlags());

    // Now, set the data. Return false if it fails.
    if (!setData(dataChoice)) {
      return false;
    }

    // Now set up the flags and add the displayable
    return true;
  }