Added field name and methods name for the merge

This commit is contained in:
Morippi
2021-12-09 20:25:01 +01:00
parent f8910b0c3b
commit 30d392f861
4 changed files with 69 additions and 10 deletions
@@ -1,5 +0,0 @@
package com.seibel.lod.core.dataFormat;
public class DataMerger
{
}
@@ -40,12 +40,21 @@ public class PositionDataFormat
return positionData;
}
public static String toString(int verticalData, short positionData)
{
return getLodCount(verticalData) + " " +
getLightFlag(verticalData) + " " +
getGenerationMode(verticalData) + " " +
isVoid(verticalData) + " " +
doesItExist(verticalData) + " " +'\n';
}
public static byte getLodCount(short dataPoint)
{
return (byte) ((dataPoint >>> LOD_COUNT_SHIFT) & LOD_COUNT_MASK);
}
public static boolean getFlag(short dataPoint)
public static boolean getLightFlag(short dataPoint)
{
return ((dataPoint >>> CORRECT_LIGHT_SHIFT) & CORRECT_LIGHT_MASK) == 1;
}
@@ -4,6 +4,7 @@ public class VerticalDataFormat
{
public final static short MIN_WORLD_HEIGHT = -2048;
public final static short MAX_WORLD_HEIGHT = 2047;
public final static short WORLD_HEIGHT = MAX_WORLD_HEIGHT - MIN_WORLD_HEIGHT;
public final static byte HEIGHT_SHIFT = 20;
public final static byte DEPTH_SHIFT = 8;
@@ -25,8 +26,8 @@ public class VerticalDataFormat
public static int createVerticalData(int height, int depth, int level, boolean transparent, boolean bottom)
{
int verticalData = 0;
verticalData |= (height & HEIGHT_MASK) << HEIGHT_SHIFT;
verticalData |= (depth & DEPTH_MASK) << DEPTH_SHIFT;
verticalData |= ((height - MIN_WORLD_HEIGHT) & HEIGHT_MASK) << HEIGHT_SHIFT;
verticalData |= ((depth - MIN_WORLD_HEIGHT) & DEPTH_MASK) << DEPTH_SHIFT;
verticalData |= (level & LEVEL_MASK) << LEVEL_SHIFT;
if (bottom)
verticalData |= BOTTOM_TYPE_MASK << BOTTOM_TYPE_SHIFT;
@@ -37,14 +38,24 @@ public class VerticalDataFormat
return verticalData;
}
public static String toString(int verticalData, short positionData)
{
return getHeight(verticalData) + " " +
getDepth(verticalData) + " " +
getLevel(verticalData) + " " +
isTransparent(verticalData) + " " +
isBottom(verticalData) + " " +
doesItExist(verticalData) + " " + '\n';
}
public static short getHeight(int verticalData)
{
return (short) ((verticalData >>> HEIGHT_SHIFT) & HEIGHT_MASK);
return (short) (((verticalData >>> HEIGHT_SHIFT) & HEIGHT_MASK) + MIN_WORLD_HEIGHT);
}
public static short getDepth(int verticalData)
{
return (short) ((verticalData >>> DEPTH_SHIFT) & DEPTH_MASK);
return (short) (((verticalData >>> DEPTH_SHIFT) & DEPTH_MASK) + MIN_WORLD_HEIGHT);
}
public static byte getLevel(int verticalData)
@@ -36,10 +36,22 @@ public class VerticalLevelContainer implements LevelContainer
public final byte detailLevel;
public final int size;
public final int chunkCount = 0;
public final int chunkSize = 0;
public final int maxVerticalData;
public final long[] dataContainer;
//length should be chunkCount
public final byte[] verticalSize = null;
//length should be chunkCount
public final short[] positionData = null;
public final int[][] verticalData = null;
public final int[][] colorData = null;
public final byte[][] lightData = null;
public VerticalLevelContainer(byte detailLevel)
{
this.detailLevel = detailLevel;
@@ -267,6 +279,38 @@ public class VerticalLevelContainer implements LevelContainer
}
}
/**
*
* @param positionDataToMerge
* @effect
*/
public void computePositionData(int[] positionDataToMerge)
{
}
/**
*
* @param verticalDataToMerge
* @param maxVerticalData max vertical size of the merged data
* @effect save in
*/
public void computeHeightAndDepthData(int[] verticalDataToMerge, int maxVerticalData)
{
}
/**
*
* @param colorDataToMerge
* @param lightDataToMerge
* @effect
*/
public void computeColorLightVerticalData(int[] colorDataToMerge, byte[] lightDataToMerge)
{
}
/**
* This method merge column of multiple data together
* @param dataToMerge one or more columns of data