コード例 #1
0
ファイル: PL02BranchGroup.java プロジェクト: bgarrels/jCAE
 @Override
 public boolean equals(Object obj) {
   if (!(obj instanceof SelectionEdge)) return false;
   SelectionEdge se = (SelectionEdge) obj;
   return Arrays.equals(end1, se.end1)
       && Arrays.equals(end2, se.end2)
       && (groupIdx == se.groupIdx);
 }
コード例 #2
0
  /**
   * This is a callback to be executed before resampleAll is executed. The idea is to initialize the
   * necessary parameters needed for the shear warp resampling of the volume data. The actual shear
   * parameters are computed based on the orientation of the bounding box of the volume data. The
   * permuted slice bounds, index set, and encoding table are selected based on the input
   * permutation. The skip array is initialized to zero since before rendering, all intermediate
   * pixels are transparent. Derived classes may provide additional initializations as needed.
   *
   * <p>Each one of the indices is a permutation; either one of (0,1,2), (1,2,0), (2,0,1).
   *
   * @param k0 Index to <code>m_aiBound</code>, a value of 0, 1 or 2.
   * @param k1 Index to <code>m_aiBound</code>, a value of 0, 1 or 2.
   * @param k2 Index to <code>m_aiBound</code>, a value of 0, 1 or 2.
   */
  protected void beforeResampleAll(int k0, int k1, int k2) {

    // save permutation for use in computing positions
    m_iPermute = k2;

    // all intermediate voxels have not been processed yet
    Arrays.fill(m_aiInterC, 0);

    // compute bounding rectangle for sheared slices
    float fInvMax = 1.0f / m_aafBox[2][k2];
    m_afShear[0] = -m_aafBox[2][k0] * fInvMax;
    m_afOffset[0] =
        0.5f * (m_iInterBoundM1 - ((m_aiBound[k0] - 1) + (m_afShear[0] * (m_aiBound[k2] - 1))));
    m_afShear[1] = -m_aafBox[2][k1] * fInvMax;
    m_afOffset[1] =
        0.5f * (m_iInterBoundM1 - ((m_aiBound[k1] - 1) + (m_afShear[1] * (m_aiBound[k2] - 1))));

    // inverse shear warp
    float fDet = (m_aafBox[0][k0] * m_aafBox[1][k1]) - (m_aafBox[0][k1] * m_aafBox[1][k0]);
    float fInvDet = 1.0f / fDet;
    m_aafM[0][0] = m_aafBox[1][k1] * fInvDet;
    m_aafM[0][1] = -m_aafBox[0][k1] * fInvDet;
    m_aafM[1][0] = -m_aafBox[1][k0] * fInvDet;
    m_aafM[1][1] = m_aafBox[0][k0] * fInvDet;

    // slice bounds and slice selection
    m_aiSliceBound[0] = m_aiBound[k0];
    m_aiSliceBound[1] = m_aiBound[k1];
    m_aiSliceBound[2] = m_aiBound[k2];
    m_iSliceQuantity = m_aiSliceBound[0] * m_aiSliceBound[1];
    m_aiSliceMin[0] = m_aiClipMin[k0];
    m_aiSliceMin[1] = m_aiClipMin[k1];
    m_aiSliceMin[2] = m_aiClipMin[k2];
    m_aiSliceMax[0] = m_aiClipMax[k0];
    m_aiSliceMax[1] = m_aiClipMax[k1];
    m_aiSliceMax[2] = m_aiClipMax[k2];

    // current index array
    m_aiCurrentI = m_aaiIndex[k2];

    if (m_bDoEncodeSkip) {
      m_aaasVolumeEncode = m_aaaasEncode[k2];
      Arrays.fill(m_asSkip, (short) 0);
    }
  }