diff --git a/core/src/main/java/com/seibel/lod/core/api/external/methods/data/DhApiTerrainDataRepo.java b/core/src/main/java/com/seibel/lod/core/api/external/methods/data/DhApiTerrainDataRepo.java index 8013038d9..122937345 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/methods/data/DhApiTerrainDataRepo.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/methods/data/DhApiTerrainDataRepo.java @@ -7,7 +7,7 @@ import com.seibel.lod.api.objects.data.DhApiTerrainDataPoint; import com.seibel.lod.api.interfaces.data.IDhApiTerrainDataRepo; import com.seibel.lod.api.objects.math.DhApiVec3i; import com.seibel.lod.core.api.internal.SharedApi; -import com.seibel.lod.core.dataObjects.fullData.accessor.SingleFullDataAccessor; +import com.seibel.lod.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor; import com.seibel.lod.core.dataObjects.fullData.sources.IFullDataSource; import com.seibel.lod.core.util.FullDataPointUtil; import com.seibel.lod.core.dataObjects.fullData.FullDataPointIdMap; @@ -209,7 +209,7 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo { // attempt to get the LOD data from the data source FullDataPointIdMap mapping = dataSource.getMapping(); - SingleFullDataAccessor dataColumn = dataSource.tryGet(relativePos.x, relativePos.z); + SingleColumnFullDataAccessor dataColumn = dataSource.tryGet(relativePos.x, relativePos.z); if (dataColumn != null) { int dataColumnIndexCount = dataColumn.getSingleLength(); diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/FullDataDownSampler.java b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/FullDataDownSampler.java index 842b220d3..e0d2c6162 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/FullDataDownSampler.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/FullDataDownSampler.java @@ -1,6 +1,6 @@ package com.seibel.lod.core.dataObjects.fullData; -import com.seibel.lod.core.dataObjects.fullData.accessor.SingleFullDataAccessor; +import com.seibel.lod.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor; import com.seibel.lod.core.dataObjects.fullData.sources.CompleteFullDataSource; import com.seibel.lod.core.dataObjects.fullData.sources.IFullDataSource; import com.seibel.lod.core.file.fullDatafile.IFullDataSourceProvider; @@ -101,7 +101,7 @@ public class FullDataDownSampler { for (int ox = 0; ox < overlappedTrgDataSize; ox++) { for (int oz = 0; oz < overlappedTrgDataSize; oz++) { - SingleFullDataAccessor column = target.get(ox + offsetX, oz + offsetZ); + SingleColumnFullDataAccessor column = target.get(ox + offsetX, oz + offsetZ); column.downsampleFrom(source.subView(srcDataPerTrgData, ox * srcDataPerTrgData, oz * srcDataPerTrgData)); } } diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/FullDataArrayAccessor.java b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/FullDataArrayAccessor.java index 6da057347..72a5ae3b3 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/FullDataArrayAccessor.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/FullDataArrayAccessor.java @@ -124,7 +124,7 @@ public class FullDataArrayAccessor implements IFullDataAccessor { for (int zOffset = 0; zOffset < this.width; zOffset++) { - SingleFullDataAccessor column = this.get(xOffset, zOffset); + SingleColumnFullDataAccessor column = this.get(xOffset, zOffset); column.downsampleFrom(fullDataAccessor.subView(dataPointsPerWidthUnit, xOffset * dataPointsPerWidthUnit, zOffset * dataPointsPerWidthUnit)); } } @@ -140,9 +140,9 @@ public class FullDataArrayAccessor implements IFullDataAccessor public FullDataPointIdMap getMapping() { return this.mapping; } @Override - public SingleFullDataAccessor get(int index) { return this.get(index / this.width, index % this.width); } + public SingleColumnFullDataAccessor get(int index) { return this.get(index / this.width, index % this.width); } @Override - public SingleFullDataAccessor get(int relativeX, int relativeZ) { return new SingleFullDataAccessor(this.mapping, this.dataArrays, relativeX * this.width + relativeZ + this.offset); } + public SingleColumnFullDataAccessor get(int relativeX, int relativeZ) { return new SingleColumnFullDataAccessor(this.mapping, this.dataArrays, relativeX * this.width + relativeZ + this.offset); } @Override public int width() { return this.width; } diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/IFullDataAccessor.java b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/IFullDataAccessor.java index cad84191e..ddca3534f 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/IFullDataAccessor.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/IFullDataAccessor.java @@ -19,8 +19,8 @@ public interface IFullDataAccessor FullDataPointIdMap getMapping(); /** generally used for iterating through the whole data set */ - SingleFullDataAccessor get(int index); - SingleFullDataAccessor get(int relativeX, int relativeZ); + SingleColumnFullDataAccessor get(int index); + SingleColumnFullDataAccessor get(int relativeX, int relativeZ); /** measured in full data points */ int width(); @@ -35,9 +35,9 @@ public interface IFullDataAccessor /** Returns an iterator that goes over each data column */ - default Iterator iterator() + default Iterator iterator() { - return new Iterator() + return new Iterator() { private int index = 0; private final int size = width() * width(); @@ -46,7 +46,7 @@ public interface IFullDataAccessor public boolean hasNext() { return this.index < this.size; } @Override - public SingleFullDataAccessor next() + public SingleColumnFullDataAccessor next() { LodUtil.assertTrue(this.hasNext(), "No more data to iterate!"); return get(this.index++); diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/SingleFullDataAccessor.java b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/SingleColumnFullDataAccessor.java similarity index 85% rename from core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/SingleFullDataAccessor.java rename to core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/SingleColumnFullDataAccessor.java index edf778d30..440850b0b 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/SingleFullDataAccessor.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/accessor/SingleColumnFullDataAccessor.java @@ -8,7 +8,7 @@ import com.seibel.lod.core.util.FullDataPointUtil; * * @see FullDataPointUtil */ -public class SingleFullDataAccessor implements IFullDataAccessor +public class SingleColumnFullDataAccessor implements IFullDataAccessor { /** * A flattened 2D array (for the X and Z directions) containing an array for the Y direction. @@ -16,13 +16,13 @@ public class SingleFullDataAccessor implements IFullDataAccessor * @see FullDataArrayAccessor#dataArrays */ private final long[][] dataArrays; - /** indicates what index of the {@link SingleFullDataAccessor#dataArrays} is used by this accessor */ + /** indicates what index of the {@link SingleColumnFullDataAccessor#dataArrays} is used by this accessor */ private final int dataArrayIndex; private final FullDataPointIdMap mapping; - public SingleFullDataAccessor(FullDataPointIdMap mapping, long[][] dataArrays, int dataArrayIndex) + public SingleColumnFullDataAccessor(FullDataPointIdMap mapping, long[][] dataArrays, int dataArrayIndex) { this.dataArrays = dataArrays; this.dataArrayIndex = dataArrayIndex; @@ -37,7 +37,7 @@ public class SingleFullDataAccessor implements IFullDataAccessor public FullDataPointIdMap getMapping() { return this.mapping; } @Override - public SingleFullDataAccessor get(int index) + public SingleColumnFullDataAccessor get(int index) { if (index != 0) { @@ -48,7 +48,7 @@ public class SingleFullDataAccessor implements IFullDataAccessor } @Override - public SingleFullDataAccessor get(int relativeX, int relativeZ) + public SingleColumnFullDataAccessor get(int relativeX, int relativeZ) { if (relativeX != 0 || relativeZ != 0) { @@ -77,14 +77,14 @@ public class SingleFullDataAccessor implements IFullDataAccessor { if (width != 1 || xOffset != 1 || zOffset != 1) { - throw new IllegalArgumentException("Getting invalid range of subView from SingleFullDataAccessor!"); + throw new IllegalArgumentException("Getting invalid range of subView from SingleColumnFullDataAccessor!"); } return this; } /** WARNING: This may potentially share the underlying array objects! */ - public void shadowCopyTo(SingleFullDataAccessor target) + public void shadowCopyTo(SingleColumnFullDataAccessor target) { if (target.mapping.equals(this.mapping)) { @@ -105,7 +105,7 @@ public class SingleFullDataAccessor implements IFullDataAccessor } /** Copies both ID data and mapping data. */ - public void deepCopyTo(SingleFullDataAccessor target) + public void deepCopyTo(SingleColumnFullDataAccessor target) { if (target.mapping.equals(this.mapping)) { @@ -131,7 +131,7 @@ public class SingleFullDataAccessor implements IFullDataAccessor public void downsampleFrom(IFullDataAccessor source) { //TODO: average the data instead of just picking the first column - SingleFullDataAccessor firstColumn = source.get(0); + SingleColumnFullDataAccessor firstColumn = source.get(0); firstColumn.deepCopyTo(this); } diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/CompleteFullDataSource.java b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/CompleteFullDataSource.java index dbf58273d..68815d62d 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/CompleteFullDataSource.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/CompleteFullDataSource.java @@ -4,7 +4,7 @@ import com.seibel.lod.api.enums.worldGeneration.EDhApiWorldGenerationStep; import com.seibel.lod.core.dataObjects.fullData.FullDataPointIdMap; import com.seibel.lod.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; import com.seibel.lod.core.dataObjects.fullData.accessor.FullDataArrayAccessor; -import com.seibel.lod.core.dataObjects.fullData.accessor.SingleFullDataAccessor; +import com.seibel.lod.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor; import com.seibel.lod.core.level.IDhLevel; import com.seibel.lod.core.pos.DhBlockPos2D; import com.seibel.lod.core.pos.DhLodPos; @@ -65,7 +65,7 @@ public class CompleteFullDataSource extends FullDataArrayAccessor implements IFu public EDhApiWorldGenerationStep getWorldGenStep() { return EDhApiWorldGenerationStep.EMPTY; } @Override - public SingleFullDataAccessor tryGet(int relativeX, int relativeZ) { return this.get(relativeX, relativeZ); } + public SingleColumnFullDataAccessor tryGet(int relativeX, int relativeZ) { return this.get(relativeX, relativeZ); } @Override public void update(ChunkSizedFullDataAccessor chunkDataView) @@ -86,7 +86,7 @@ public class CompleteFullDataSource extends FullDataArrayAccessor implements IFu { for (int z = 0; z < LodUtil.CHUNK_WIDTH; z++) { - SingleFullDataAccessor column = this.get(x + blockOffset.x, z + blockOffset.z); + SingleColumnFullDataAccessor column = this.get(x + blockOffset.x, z + blockOffset.z); LodUtil.assertTrue(column.doesColumnExist()); } } @@ -108,7 +108,7 @@ public class CompleteFullDataSource extends FullDataArrayAccessor implements IFu { for (int zOffset = 0; zOffset < fullSize; zOffset++) { - SingleFullDataAccessor column = this.get(xOffset + offsetX, zOffset + offsetZ); + SingleColumnFullDataAccessor column = this.get(xOffset + offsetX, zOffset + offsetZ); column.downsampleFrom(chunkDataView.subView(dataPerFull, xOffset * dataPerFull, zOffset * dataPerFull)); } } @@ -255,7 +255,7 @@ public class CompleteFullDataSource extends FullDataArrayAccessor implements IFu { for (int z = 0; z < this.width; z++) { - SingleFullDataAccessor column = this.get(x, z); + SingleColumnFullDataAccessor column = this.get(x, z); if (!column.doesColumnExist()) continue; @@ -332,7 +332,7 @@ public class CompleteFullDataSource extends FullDataArrayAccessor implements IFu { for (int zOffset = 0; zOffset < count; zOffset++) { - SingleFullDataAccessor column = this.get(xOffset + dataOffsetX, zOffset + dataOffsetZ); + SingleColumnFullDataAccessor column = this.get(xOffset + dataOffsetX, zOffset + dataOffsetZ); column.downsampleFrom(subData.subView(dataPerCount, xOffset * dataPerCount, zOffset * dataPerCount)); } } diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/IFullDataSource.java b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/IFullDataSource.java index 93b3fe1bb..d953bb6f5 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/IFullDataSource.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/IFullDataSource.java @@ -4,7 +4,7 @@ import com.seibel.lod.api.enums.worldGeneration.EDhApiWorldGenerationStep; import com.seibel.lod.core.dataObjects.fullData.FullDataPointIdMap; import com.seibel.lod.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; import com.seibel.lod.core.dataObjects.fullData.accessor.IFullDataAccessor; -import com.seibel.lod.core.dataObjects.fullData.accessor.SingleFullDataAccessor; +import com.seibel.lod.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor; import com.seibel.lod.core.dataObjects.render.ColumnRenderSource; import com.seibel.lod.core.file.fullDatafile.FullDataMetaFile; import com.seibel.lod.core.level.IDhLevel; @@ -76,7 +76,7 @@ public interface IFullDataSource * Attempts to get the data column for the given relative x and z position. * @return null if the data doesn't exist */ - public abstract SingleFullDataAccessor tryGet(int relativeX, int relativeZ); + public abstract SingleColumnFullDataAccessor tryGet(int relativeX, int relativeZ); public abstract FullDataPointIdMap getMapping(); diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/SparseFullDataSource.java b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/SparseFullDataSource.java index 4012564f5..accba4b44 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/SparseFullDataSource.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/fullData/sources/SparseFullDataSource.java @@ -4,7 +4,7 @@ import com.seibel.lod.api.enums.worldGeneration.EDhApiWorldGenerationStep; import com.seibel.lod.core.dataObjects.fullData.FullDataPointIdMap; import com.seibel.lod.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; import com.seibel.lod.core.dataObjects.fullData.accessor.FullDataArrayAccessor; -import com.seibel.lod.core.dataObjects.fullData.accessor.SingleFullDataAccessor; +import com.seibel.lod.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor; import com.seibel.lod.core.file.fullDatafile.FullDataMetaFile; import com.seibel.lod.core.level.IDhLevel; import com.seibel.lod.core.pos.DhLodPos; @@ -137,7 +137,7 @@ public class SparseFullDataSource implements IIncompleteFullDataSource { for (int zOffset = 0; zOffset < count; zOffset++) { - SingleFullDataAccessor column = newArray.get(xOffset, zOffset); + SingleColumnFullDataAccessor column = newArray.get(xOffset, zOffset); column.downsampleFrom(chunkDataView.subView(dataPerCount, xOffset * dataPerCount, zOffset * dataPerCount)); } } @@ -286,7 +286,7 @@ public class SparseFullDataSource implements IIncompleteFullDataSource { for (int z = 0; z < array.width(); z++) { - SingleFullDataAccessor column = array.get(x, z); + SingleColumnFullDataAccessor column = array.get(x, z); LodUtil.assertTrue(column.getMapping() == this.mapping); // the mappings must be exactly equal! if (column.doesColumnExist()) @@ -512,7 +512,7 @@ public class SparseFullDataSource implements IIncompleteFullDataSource return fullDataSource; } - public SingleFullDataAccessor tryGet(int relativeX, int relativeZ) + public SingleColumnFullDataAccessor tryGet(int relativeX, int relativeZ) { LodUtil.assertTrue(relativeX >=0 && relativeX =0 && relativeZ