コード例 #1
0
ファイル: PL02BranchGroup.java プロジェクト: bgarrels/jCAE
  private Wire[] createWireList() {
    int[] ids = provider.getDomainIDs();
    LOGGER.finest("computing wires for " + ids.length + " domain.");
    int numberOfWire = 0;

    for (int i = 0; i < ids.length; i++) {
      FDDomain domain = (FDDomain) provider.getDomain(ids[i]);
      numberOfWire += domain.getNumberOfXWire();
      numberOfWire += domain.getNumberOfYWire();
      numberOfWire += domain.getNumberOfZWire();
    }
    LOGGER.finest("found " + numberOfWire + " wires.");

    Wire[] wires = new Wire[numberOfWire];
    int iw = 0;
    for (int i = 0; i < ids.length; i++) {
      FDDomain domain = (FDDomain) provider.getDomain(ids[i]);
      Iterator<int[]> it = domain.getXWireIterator();
      while (it.hasNext()) {
        int[] indices = it.next();
        Wire w = new WireX();
        w.position1 = indices[1];
        w.position2 = indices[2];
        w.min = indices[0];
        w.max = indices[3];
        wires[iw] = w;
        iw++;
      }

      domain = (FDDomain) provider.getDomain(ids[i]);
      it = domain.getYWireIterator();
      while (it.hasNext()) {
        int[] indices = it.next();
        Wire w = new WireY();
        w.position1 = indices[0];
        w.position2 = indices[2];
        w.min = indices[1];
        w.max = indices[3];
        wires[iw] = w;
        iw++;
      }

      domain = (FDDomain) provider.getDomain(ids[i]);
      it = domain.getZWireIterator();
      while (it.hasNext()) {
        int[] indices = it.next();
        Wire w = new WireZ();
        w.position1 = indices[0];
        w.position2 = indices[1];
        w.min = indices[2];
        w.max = indices[3];
        wires[iw] = w;
        iw++;
      }
    }
    return wires;
  }