Example #1
0
  /** Disposes of image memory and associated objects. */
  public void disposeLocal() {
    m_aafBox = null;
    m_aafM = null;

    m_afShear = null;
    m_afOffset = null;
    m_afA = null;
    m_afB = null;
    m_aiSliceBound = null;
    m_aiBound = null;

    m_aiSliceMin = null;
    m_aiSliceMax = null;
    m_aiClipMin = null;
    m_aiClipMax = null;

    m_aaaasEncode = null;
    m_aaasVolumeEncode = null;
    m_aasSliceEncode = null;

    m_aaiIndex = null;
    m_asSkip = null;
    m_aiCurrentI = null;

    m_aiInterC = null;

    m_kP00 = null;
    m_kP01 = null;
    m_kP10 = null;
    m_kP11 = null;
    m_kPosition = null;

    super.disposeLocal();
    System.gc();
  }
Example #2
0
 final void set(SensorRead sensorRead) {
   this.time = sensorRead.time;
   this.numButtons = sensorRead.numButtons;
   this.read.set(sensorRead.read);
   if (numButtons > 0)
     System.arraycopy(sensorRead.buttonValues, 0, this.buttonValues, 0, sensorRead.numButtons);
 }
Example #3
0
  /**
   * The top level rendering call. This function calls beforeResampleAll, resampleAll, and
   * mapIntermediateToFinal, all virtual functions that are implemented in derived classes.
   *
   * @param iDS The number of slices to increment during the resampling phase. The value should be
   *     one or larger. If one, all slices of the volume data are resampled. If two, only every
   *     other slice is resampled. An input larger than one is used to allow fast rendering during
   *     rotation of the volume data. Once the rotation terminates, a composite with input of one
   *     should be called.
   */
  public synchronized void composite(int iDS) {
    long startTime = 0, now = 0;
    double elapsedTime = 0d;

    // compute maximum component of the box direction vector
    float fMax = 0.0f;
    int i, iMax = -1;

    for (i = 0; i < 3; i++) {
      float fAbs = Math.abs(m_aafBox[2][i]);

      if (fAbs > fMax) {
        fMax = fAbs;
        iMax = i;
      }
    }

    startTime = System.currentTimeMillis();
    traceInit();

    // composite in the appropriate direction
    if (iMax == 0) {
      beforeResampleAll(1, 2, 0);
    } else if (iMax == 1) {
      beforeResampleAll(2, 0, 1);
    } else {
      beforeResampleAll(0, 1, 2);
    }

    resampleAll(iDS);
    mapIntermediateToFinal();
    now = System.currentTimeMillis();
    elapsedTime = (double) (now - startTime);

    if (elapsedTime <= 0) {
      elapsedTime = (double) 0.0;
    }

    Preferences.debug(
        "Shear elapse time = " + (double) (elapsedTime / 1000.0) + "\n"); // in seconds
  }
 public static void main(String[] args) {
   new Demo_FirstTexturedPolygon().Execute();
   System.exit(0);
 }
Example #5
0
 /**
  * Copies the array of button values for this SensorRead object into the specified array. This
  * method has no effect if this SensorRead object has 0 buttons. The array must be large enough to
  * hold all of the buttons.
  *
  * @param values array that will receive the values of all buttons for this SensorRead
  */
 public void getButtons(int[] values) {
   if (numButtons > 0) System.arraycopy(buttonValues, 0, values, 0, numButtons);
 }
Example #6
0
 /**
  * Sets the values of all buttons for this SensorRead object.
  *
  * @param values array contining the new buttons for this SensorRead
  * @exception ArrayIndexOutOfBoundsException if this object has 0 buttons or if values.length is
  *     less than the number of buttons in this object.
  */
 public void setButtons(int[] values) {
   if (numButtons == 0) throw new ArrayIndexOutOfBoundsException(J3dI18N.getString("SensorRead1"));
   else if (values.length < numButtons)
     throw new ArrayIndexOutOfBoundsException(J3dI18N.getString("SensorRead0"));
   System.arraycopy(values, 0, buttonValues, 0, numButtons);
 }
  // Override Behavior's initialize method to setup wakeup criteria
  public void initialize() {
    alpha.setStartTime(System.currentTimeMillis());

    // Establish initial wakeup criteria
    wakeupOn(w);
  }