@Test public void testBuildPrimeTierDimensionsList() { final Bounds roughStackBounds = new Bounds(50000.0, 40000.0, 1.0, 70000.0, 65000.0, 3.0); final int maxPixelsPerDimension = 1024; final List<TierDimensions> tierDimensionsList = TierDimensions.buildPrimeTierDimensionsList(roughStackBounds, maxPixelsPerDimension, 4); final Object[][] expectedTierValues = { { 50000, 40000, 70000, 65000, 1, 1, 0.04096 }, { 50000, 40000, 70001, 65002, 3, 3, 0.12287 }, { 50000, 40000, 70006, 65004, 7, 7, 0.28667 }, { 50000, 40000, 70009, 65007, 17, 17, 0.69613 } }; validateTiers(expectedTierValues, tierDimensionsList); }
static List<TierDimensions> buildPrimeTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerDimension, final int numberOfTiers) { final List<TierDimensions> list = new ArrayList<>(); Bounds parentStackFullScaleBounds = roughStackFullScaleBounds; for (int tier = 0; tier < numberOfTiers; tier++) { final TierDimensions tierDimensions = buildPrimeSplitTier(parentStackFullScaleBounds, maxPixelsPerDimension, tier); list.add(tierDimensions); parentStackFullScaleBounds = tierDimensions.getFullScaleBounds(); } LOG.info("buildPrimeTierDimensionsList: returning dimensions for {} tiers", list.size()); return list; }
TierDimensions implements Serializable { static List<TierDimensions> buildPrimeTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerDimension, final int numberOfTiers) { final List<TierDimensions> list = new ArrayList<>(); Bounds parentStackFullScaleBounds = roughStackFullScaleBounds; for (int tier = 0; tier < numberOfTiers; tier++) { final TierDimensions tierDimensions = buildPrimeSplitTier(parentStackFullScaleBounds, maxPixelsPerDimension, tier); list.add(tierDimensions); parentStackFullScaleBounds = tierDimensions.getFullScaleBounds(); } LOG.info("buildPrimeTierDimensionsList: returning dimensions for {} tiers", list.size()); return list; } }
TierDimensions implements Serializable { static List<TierDimensions> buildPrimeTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerDimension, final int numberOfTiers) { final List<TierDimensions> list = new ArrayList<>(); Bounds parentStackFullScaleBounds = roughStackFullScaleBounds; for (int tier = 0; tier < numberOfTiers; tier++) { final TierDimensions tierDimensions = buildPrimeSplitTier(parentStackFullScaleBounds, maxPixelsPerDimension, tier); list.add(tierDimensions); parentStackFullScaleBounds = tierDimensions.getFullScaleBounds(); } LOG.info("buildPrimeTierDimensionsList: returning dimensions for {} tiers", list.size()); return list; } private  TierDimensions(final int fullScaleCellWidth,
                           final int fullScaleCellHeight,
                           final double scale,
                           final int rows,
                           final int columns,
                           final Bounds fullScaleBounds); }
TierDimensions implements Serializable { static List<TierDimensions> buildPrimeTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerDimension, final int numberOfTiers) { final List<TierDimensions> list = new ArrayList<>(); Bounds parentStackFullScaleBounds = roughStackFullScaleBounds; for (int tier = 0; tier < numberOfTiers; tier++) { final TierDimensions tierDimensions = buildPrimeSplitTier(parentStackFullScaleBounds, maxPixelsPerDimension, tier); list.add(tierDimensions); parentStackFullScaleBounds = tierDimensions.getFullScaleBounds(); } LOG.info("buildPrimeTierDimensionsList: returning dimensions for {} tiers", list.size()); return list; } private  TierDimensions(final int fullScaleCellWidth,
                           final int fullScaleCellHeight,
                           final double scale,
                           final int rows,
                           final int columns,
                           final Bounds fullScaleBounds); int getRows(); int getColumns(); double getScale(); double getMinX(); double getMinY(); @Override String toString(); String toJson(); @JsonIgnore List<HierarchicalStack> getSplitStacks(final StackId roughTilesStackId,
                                                  final int tier); static List<TierDimensions> buildTierDimensionsList(final LayerSplitMethod splitMethod,
                                                               final Bounds roughStackFullScaleBounds,
                                                               final int cellPixelWidth,
                                                               final int cellPixelHeight,
                                                               final Integer maxNumberOfTiers); }
TierDimensions implements Serializable { static List<TierDimensions> buildPrimeTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerDimension, final int numberOfTiers) { final List<TierDimensions> list = new ArrayList<>(); Bounds parentStackFullScaleBounds = roughStackFullScaleBounds; for (int tier = 0; tier < numberOfTiers; tier++) { final TierDimensions tierDimensions = buildPrimeSplitTier(parentStackFullScaleBounds, maxPixelsPerDimension, tier); list.add(tierDimensions); parentStackFullScaleBounds = tierDimensions.getFullScaleBounds(); } LOG.info("buildPrimeTierDimensionsList: returning dimensions for {} tiers", list.size()); return list; } private  TierDimensions(final int fullScaleCellWidth,
                           final int fullScaleCellHeight,
                           final double scale,
                           final int rows,
                           final int columns,
                           final Bounds fullScaleBounds); int getRows(); int getColumns(); double getScale(); double getMinX(); double getMinY(); @Override String toString(); String toJson(); @JsonIgnore List<HierarchicalStack> getSplitStacks(final StackId roughTilesStackId,
                                                  final int tier); static List<TierDimensions> buildTierDimensionsList(final LayerSplitMethod splitMethod,
                                                               final Bounds roughStackFullScaleBounds,
                                                               final int cellPixelWidth,
                                                               final int cellPixelHeight,
                                                               final Integer maxNumberOfTiers); static final JsonUtils.Helper<TierDimensions> JSON_HELPER; }