public void InitializeSquareCluster(int x, int y, int z) { for (int s = 0; s < Length; ++s) { nodes_ids[s] = UTL.CoordToIdx(x * RootLength + s % RootLength, y * RootLength + s / RootLength, z); } }
public void InitializeZCluster(int x, int y) { for (int z = 0; z < Length; ++z) { nodes_ids[z] = UTL.CoordToIdx(x, y, z); } }
public void InitializeXCluster(int y, int z) { for (int x = 0; x < Length; ++x) { nodes_ids[x] = UTL.CoordToIdx(x, y, z); } }
public void InitializeYCluster(int x, int z) { for (int y = 0; y < Length; ++y) { nodes_ids[y] = UTL.CoordToIdx(x, y, z); } }
private TileButton _tile_button; // the button that need to be modified public Node(int x, int y, int z, TileButton tile_button_) { _tile_button = tile_button_; is_fixed = false; is_true = false; is_propagated = false; time = InvalidInt; coord = new UTL.Coord3(x, y, z); neighbour_ids = new int[NumNeighbours]; cluster_ids = new int[4]; int idx = 0; for (int xi = 0; xi < Length; ++xi) { if (xi == x) { continue; } neighbour_ids[idx] = UTL.CoordToIdx(xi, y, z); ++idx; } for (int yi = 0; yi < Length; ++yi) { if (yi == y) { continue; } neighbour_ids[idx] = UTL.CoordToIdx(x, yi, z); ++idx; } for (int zi = 0; zi < Length; ++zi) { if (zi == z) { continue; } neighbour_ids[idx] = UTL.CoordToIdx(x, y, zi); ++idx; } for (int yi = (y / RootLength) * RootLength; yi < (y / RootLength + 1) * RootLength; ++yi) { if (yi == y) { continue; } for (int xi = (x / RootLength) * RootLength; xi < (x / RootLength + 1) * RootLength; ++xi) { if (xi == x) { continue; } neighbour_ids[idx] = UTL.CoordToIdx(xi, yi, z); ++idx; } } cluster_ids[0] = UTL.CoordToIdx(y, z); cluster_ids[1] = UTL.CoordToIdx(x, z) + Area; cluster_ids[2] = UTL.CoordToIdx(x, y) + Area * 2; cluster_ids[3] = UTL.CoordToIdx((x / RootLength) + RootLength * (y / RootLength), z) + Area * 3; }