Commit 79c8d420 authored by Morten Ofstad's avatar Morten Ofstad
Browse files

Changed LodLevels enum to LODLevels and changed DimensionsND enum to be...

Changed LodLevels enum to LODLevels and changed DimensionsND enum to be prefixed with Dimensions_ rather than using enum class.
parent 61a4c480
......@@ -34,43 +34,43 @@ enum class InterpolationMethod
};
/// 2D or 3D dimension group\n
enum class DimensionsND
enum DimensionsND
{
Group012,
Group013,
Group014,
Group015,
Group023,
Group024,
Group025,
Group034,
Group035,
Group045,
Group123,
Group124,
Group125,
Group134,
Group135,
Group145,
Group234,
Group235,
Group245,
Group345,
Group01,
Group02,
Group03,
Group04,
Group05,
Group12,
Group13,
Group14,
Group15,
Group23,
Group24,
Group25,
Group34,
Group35,
Group45
Dimensions_012,
Dimensions_013,
Dimensions_014,
Dimensions_015,
Dimensions_023,
Dimensions_024,
Dimensions_025,
Dimensions_034,
Dimensions_035,
Dimensions_045,
Dimensions_123,
Dimensions_124,
Dimensions_125,
Dimensions_134,
Dimensions_135,
Dimensions_145,
Dimensions_234,
Dimensions_235,
Dimensions_245,
Dimensions_345,
Dimensions_01,
Dimensions_02,
Dimensions_03,
Dimensions_04,
Dimensions_05,
Dimensions_12,
Dimensions_13,
Dimensions_14,
Dimensions_15,
Dimensions_23,
Dimensions_24,
Dimensions_25,
Dimensions_34,
Dimensions_35,
Dimensions_45
};
/// Mapping volume data channels
......
......@@ -35,21 +35,21 @@ public:
BrickSize_4096 = 12
};
enum LodLevels
enum LODLevels
{
LodLevelNone = 0,
LodLevel1 = 1,
LodLevel2 = 2,
LodLevel3 = 3,
LodLevel4 = 4,
LodLevel5 = 5,
LodLevel6 = 6,
LodLevel7 = 7,
LodLevel8 = 8,
LodLevel9 = 9,
LodLevel10 = 10,
LodLevel11 = 11,
LodLevel12 = 12
LODLevels_None = 0,
LODLevels_1 = 1,
LODLevels_2 = 2,
LODLevels_3 = 3,
LODLevels_4 = 4,
LODLevels_5 = 5,
LODLevels_6 = 6,
LODLevels_7 = 7,
LODLevels_8 = 8,
LODLevels_9 = 9,
LODLevels_10 = 10,
LODLevels_11 = 11,
LODLevels_12 = 12
};
enum Options
......@@ -66,7 +66,7 @@ private:
int m_positiveMargin;
int m_brickSizeMultiplier2D;
LodLevels m_lodLevels;
LODLevels m_lodLevels;
Options m_options;
......@@ -74,7 +74,7 @@ private:
public:
VolumeDataLayoutDescriptor() : m_brickSize(), m_negativeMargin(), m_positiveMargin(), m_brickSizeMultiplier2D(), m_lodLevels(), m_options(), m_fullResolutionDimension() {}
VolumeDataLayoutDescriptor(BrickSize brickSize, int negativeMargin, int positiveMargin, int brickSizeMultiplier2D, LodLevels lodLevels, Options options, int fullResolutionDimension = 0) : m_brickSize(brickSize), m_negativeMargin(negativeMargin), m_positiveMargin(positiveMargin), m_brickSizeMultiplier2D(brickSizeMultiplier2D), m_lodLevels(lodLevels), m_options(options), m_fullResolutionDimension(fullResolutionDimension) {}
VolumeDataLayoutDescriptor(BrickSize brickSize, int negativeMargin, int positiveMargin, int brickSizeMultiplier2D, LODLevels lodLevels, Options options, int fullResolutionDimension = 0) : m_brickSize(brickSize), m_negativeMargin(negativeMargin), m_positiveMargin(positiveMargin), m_brickSizeMultiplier2D(brickSizeMultiplier2D), m_lodLevels(lodLevels), m_options(options), m_fullResolutionDimension(fullResolutionDimension) {}
bool isValid() const { return m_brickSize != 0; }
......@@ -82,7 +82,7 @@ public:
int getNegativeMargin() const { return m_negativeMargin; }
int getPositiveMargin() const { return m_positiveMargin; }
int getBrickSizeMultiplier2D() const { return m_brickSizeMultiplier2D; }
LodLevels getLodLevels() const { return m_lodLevels; }
LODLevels getLODLevels() const { return m_lodLevels; }
bool isCreate2DLods() const { return (m_options & Options_Create2DLods) != 0; }
bool isForceFullResolutionDimension() const { return (m_options & Options_ForceFullResolutionDimension) != 0; }
......
......@@ -465,7 +465,7 @@ main(int argc, char *argv[])
}
OpenVDS::VolumeDataLayoutDescriptor::Options layoutOptions = OpenVDS::VolumeDataLayoutDescriptor::Options_None;
OpenVDS::VolumeDataLayoutDescriptor::LodLevels lodLevels = OpenVDS::VolumeDataLayoutDescriptor::LodLevelNone;
OpenVDS::VolumeDataLayoutDescriptor::LODLevels lodLevels = OpenVDS::VolumeDataLayoutDescriptor::LODLevels_None;
int negativeMargin = 0;
int positiveMargin = 0;
......
......@@ -1051,75 +1051,75 @@ DimensionGroup getDimensionGroupFromDimensionsND(DimensionsND dimensionsND)
{
default:
assert(false && ("Illegal dimensions ND"));
case DimensionsND::Group012:
case Dimensions_012:
return DimensionGroup_012;
case DimensionsND::Group013:
case Dimensions_013:
return DimensionGroup_013;
case DimensionsND::Group014:
case Dimensions_014:
return DimensionGroup_014;
case DimensionsND::Group015:
case Dimensions_015:
return DimensionGroup_015;
case DimensionsND::Group023:
case Dimensions_023:
return DimensionGroup_023;
case DimensionsND::Group024:
case Dimensions_024:
return DimensionGroup_024;
case DimensionsND::Group025:
case Dimensions_025:
return DimensionGroup_025;
case DimensionsND::Group034:
case Dimensions_034:
return DimensionGroup_034;
case DimensionsND::Group035:
case Dimensions_035:
return DimensionGroup_035;
case DimensionsND::Group045:
case Dimensions_045:
return DimensionGroup_045;
case DimensionsND::Group123:
case Dimensions_123:
return DimensionGroup_123;
case DimensionsND::Group124:
case Dimensions_124:
return DimensionGroup_124;
case DimensionsND::Group125:
case Dimensions_125:
return DimensionGroup_125;
case DimensionsND::Group134:
case Dimensions_134:
return DimensionGroup_134;
case DimensionsND::Group135:
case Dimensions_135:
return DimensionGroup_135;
case DimensionsND::Group145:
case Dimensions_145:
return DimensionGroup_145;
case DimensionsND::Group234:
case Dimensions_234:
return DimensionGroup_234;
case DimensionsND::Group235:
case Dimensions_235:
return DimensionGroup_235;
case DimensionsND::Group245:
case Dimensions_245:
return DimensionGroup_245;
case DimensionsND::Group345:
case Dimensions_345:
return DimensionGroup_345;
case DimensionsND::Group01:
case Dimensions_01:
return DimensionGroup_01;
case DimensionsND::Group02:
case Dimensions_02:
return DimensionGroup_02;
case DimensionsND::Group03:
case Dimensions_03:
return DimensionGroup_03;
case DimensionsND::Group04:
case Dimensions_04:
return DimensionGroup_04;
case DimensionsND::Group05:
case Dimensions_05:
return DimensionGroup_05;
case DimensionsND::Group12:
case Dimensions_12:
return DimensionGroup_12;
case DimensionsND::Group13:
case Dimensions_13:
return DimensionGroup_13;
case DimensionsND::Group14:
case Dimensions_14:
return DimensionGroup_14;
case DimensionsND::Group15:
case Dimensions_15:
return DimensionGroup_15;
case DimensionsND::Group23:
case Dimensions_23:
return DimensionGroup_23;
case DimensionsND::Group24:
case Dimensions_24:
return DimensionGroup_24;
case DimensionsND::Group25:
case Dimensions_25:
return DimensionGroup_25;
case DimensionsND::Group34:
case Dimensions_34:
return DimensionGroup_34;
case DimensionsND::Group35:
case Dimensions_35:
return DimensionGroup_35;
case DimensionsND::Group45:
case Dimensions_45:
return DimensionGroup_45;
}
}
......@@ -1131,75 +1131,75 @@ DimensionsND getDimensionsNDFromDimensionGroup(DimensionGroup dimensionGroup)
default:
assert(false && ("Illegal dimensiongroup"));
case DimensionGroup_012:
return DimensionsND::Group012;
return Dimensions_012;
case DimensionGroup_013:
return DimensionsND::Group013;
return Dimensions_013;
case DimensionGroup_014:
return DimensionsND::Group014;
return Dimensions_014;
case DimensionGroup_015:
return DimensionsND::Group015;
return Dimensions_015;
case DimensionGroup_023:
return DimensionsND::Group023;
return Dimensions_023;
case DimensionGroup_024:
return DimensionsND::Group024;
return Dimensions_024;
case DimensionGroup_025:
return DimensionsND::Group025;
return Dimensions_025;
case DimensionGroup_034:
return DimensionsND::Group034;
return Dimensions_034;
case DimensionGroup_035:
return DimensionsND::Group035;
return Dimensions_035;
case DimensionGroup_045:
return DimensionsND::Group045;
return Dimensions_045;
case DimensionGroup_123:
return DimensionsND::Group123;
return Dimensions_123;
case DimensionGroup_124:
return DimensionsND::Group124;
return Dimensions_124;
case DimensionGroup_125:
return DimensionsND::Group125;
return Dimensions_125;
case DimensionGroup_134:
return DimensionsND::Group134;
return Dimensions_134;
case DimensionGroup_135:
return DimensionsND::Group135;
return Dimensions_135;
case DimensionGroup_145:
return DimensionsND::Group145;
return Dimensions_145;
case DimensionGroup_234:
return DimensionsND::Group234;
return Dimensions_234;
case DimensionGroup_235:
return DimensionsND::Group235;
return Dimensions_235;
case DimensionGroup_245:
return DimensionsND::Group245;
return Dimensions_245;
case DimensionGroup_345:
return DimensionsND::Group345;
return Dimensions_345;
case DimensionGroup_01:
return DimensionsND::Group01;
return Dimensions_01;
case DimensionGroup_02:
return DimensionsND::Group02;
return Dimensions_02;
case DimensionGroup_03:
return DimensionsND::Group03;
return Dimensions_03;
case DimensionGroup_04:
return DimensionsND::Group04;
return Dimensions_04;
case DimensionGroup_05:
return DimensionsND::Group05;
return Dimensions_05;
case DimensionGroup_12:
return DimensionsND::Group12;
return Dimensions_12;
case DimensionGroup_13:
return DimensionsND::Group13;
return Dimensions_13;
case DimensionGroup_14:
return DimensionsND::Group14;
return Dimensions_14;
case DimensionGroup_15:
return DimensionsND::Group15;
return Dimensions_15;
case DimensionGroup_23:
return DimensionsND::Group23;
return Dimensions_23;
case DimensionGroup_24:
return DimensionsND::Group24;
return Dimensions_24;
case DimensionGroup_25:
return DimensionsND::Group25;
return Dimensions_25;
case DimensionGroup_34:
return DimensionsND::Group34;
return Dimensions_34;
case DimensionGroup_35:
return DimensionsND::Group35;
return Dimensions_35;
case DimensionGroup_45:
return DimensionsND::Group45;
return Dimensions_45;
}
}
......@@ -1362,42 +1362,42 @@ const char* getDimensionsGroupString(DimensionsND dimensions)
{
switch(dimensions)
{
case DimensionsND::Group012: return "012";
case DimensionsND::Group013: return "013";
case DimensionsND::Group014: return "014";
case DimensionsND::Group015: return "015";
case DimensionsND::Group023: return "023";
case DimensionsND::Group024: return "024";
case DimensionsND::Group025: return "025";
case DimensionsND::Group034: return "034";
case DimensionsND::Group035: return "035";
case DimensionsND::Group045: return "045";
case DimensionsND::Group123: return "123";
case DimensionsND::Group124: return "124";
case DimensionsND::Group125: return "125";
case DimensionsND::Group134: return "134";
case DimensionsND::Group135: return "135";
case DimensionsND::Group145: return "145";
case DimensionsND::Group234: return "234";
case DimensionsND::Group235: return "235";
case DimensionsND::Group245: return "245";
case DimensionsND::Group345: return "345";
case Dimensions_012: return "012";
case Dimensions_013: return "013";
case Dimensions_014: return "014";
case Dimensions_015: return "015";
case Dimensions_023: return "023";
case Dimensions_024: return "024";
case Dimensions_025: return "025";
case Dimensions_034: return "034";
case Dimensions_035: return "035";
case Dimensions_045: return "045";
case Dimensions_123: return "123";
case Dimensions_124: return "124";
case Dimensions_125: return "125";
case Dimensions_134: return "134";
case Dimensions_135: return "135";
case Dimensions_145: return "145";
case Dimensions_234: return "234";
case Dimensions_235: return "235";
case Dimensions_245: return "245";
case Dimensions_345: return "345";
case DimensionsND::Group01: return "01";
case DimensionsND::Group02: return "02";
case DimensionsND::Group03: return "03";
case DimensionsND::Group04: return "04";
case DimensionsND::Group05: return "05";
case DimensionsND::Group12: return "12";
case DimensionsND::Group13: return "13";
case DimensionsND::Group14: return "14";
case DimensionsND::Group15: return "15";
case DimensionsND::Group23: return "23";
case DimensionsND::Group24: return "24";
case DimensionsND::Group25: return "25";
case DimensionsND::Group34: return "34";
case DimensionsND::Group35: return "35";
case DimensionsND::Group45: return "45";
case Dimensions_01: return "01";
case Dimensions_02: return "02";
case Dimensions_03: return "03";
case Dimensions_04: return "04";
case Dimensions_05: return "05";
case Dimensions_12: return "12";
case Dimensions_13: return "13";
case Dimensions_14: return "14";
case Dimensions_15: return "15";
case Dimensions_23: return "23";
case Dimensions_24: return "24";
case Dimensions_25: return "25";
case Dimensions_34: return "34";
case Dimensions_35: return "35";
case Dimensions_45: return "45";
default:
;
}
......
......@@ -138,61 +138,61 @@ static enum VolumeDataLayoutDescriptor::BrickSize convertToBrickSize(Json::Value
throw Json::Exception("Illegal brick size");
}
static enum VolumeDataLayoutDescriptor::LodLevels convertToLodLevel(Json::Value const &jsonLodLevels)
static enum VolumeDataLayoutDescriptor::LODLevels convertToLODLevel(Json::Value const &jsonLODLevels)
{
std::string lodLevelString = jsonLodLevels.asString();
std::string lodLevelString = jsonLODLevels.asString();
if(lodLevelString == "LODLevelNone")
{
return VolumeDataLayoutDescriptor::LodLevelNone;
return VolumeDataLayoutDescriptor::LODLevels_None;
}
else if(lodLevelString == "LODLevel1")
{
return VolumeDataLayoutDescriptor::LodLevel1;
return VolumeDataLayoutDescriptor::LODLevels_1;
}
else if(lodLevelString == "LODLevel2")
{
return VolumeDataLayoutDescriptor::LodLevel2;
return VolumeDataLayoutDescriptor::LODLevels_2;
}
else if(lodLevelString == "LODLevel3")
{
return VolumeDataLayoutDescriptor::LodLevel3;
return VolumeDataLayoutDescriptor::LODLevels_3;
}
else if(lodLevelString == "LODLevel4")
{
return VolumeDataLayoutDescriptor::LodLevel4;
return VolumeDataLayoutDescriptor::LODLevels_4;
}
else if(lodLevelString == "LODLevel5")
{
return VolumeDataLayoutDescriptor::LodLevel5;
return VolumeDataLayoutDescriptor::LODLevels_5;
}
else if(lodLevelString == "LODLevel6")
{
return VolumeDataLayoutDescriptor::LodLevel6;
return VolumeDataLayoutDescriptor::LODLevels_6;
}
else if(lodLevelString == "LODLevel7")
{
return VolumeDataLayoutDescriptor::LodLevel7;
return VolumeDataLayoutDescriptor::LODLevels_7;
}
else if(lodLevelString == "LODLevel8")
{
return VolumeDataLayoutDescriptor::LodLevel8;
return VolumeDataLayoutDescriptor::LODLevels_8;
}
else if(lodLevelString == "LODLevel9")
{
return VolumeDataLayoutDescriptor::LodLevel9;
return VolumeDataLayoutDescriptor::LODLevels_9;
}
else if(lodLevelString == "LODLevel10")
{
return VolumeDataLayoutDescriptor::LodLevel10;
return VolumeDataLayoutDescriptor::LODLevels_10;
}
else if(lodLevelString == "LODLevel11")
{
return VolumeDataLayoutDescriptor::LodLevel11;
return VolumeDataLayoutDescriptor::LODLevels_11;
}
else if(lodLevelString == "LODLevel12")
{
return VolumeDataLayoutDescriptor::LodLevel12;
return VolumeDataLayoutDescriptor::LODLevels_12;
}
throw Json::Exception("Illegal lod levels");
}
......@@ -340,7 +340,7 @@ static bool parseVDSObject(const std::vector<uint8_t> &json, VDSHandle &handle,
enum VolumeDataLayoutDescriptor::BrickSize brickSize = convertToBrickSize(root["FullVCSize"]);
enum VolumeDataLayoutDescriptor::LodLevels lodLevel = convertToLodLevel(root["LODLevels"]);
enum VolumeDataLayoutDescriptor::LODLevels lodLevel = convertToLODLevel(root["LODLevels"]);
Internal::BitMask<enum VolumeDataLayoutDescriptor::Options> options(root["Create2DLODs"].asBool() ? VolumeDataLayoutDescriptor::Options_Create2DLods : VolumeDataLayoutDescriptor::Options_None);
options |= root["ForceFullResolutionDimension"].asBool() ? VolumeDataLayoutDescriptor::Options_ForceFullResolutionDimension : VolumeDataLayoutDescriptor::Options_None;
int brickSizeMultiplier2D = root.isMember("2DBrickSizeMultiplier") ? root["2DBrickSizeMultiplier"].asInt() : 4;
......@@ -551,7 +551,7 @@ static VolumeDataLayer::ProduceStatus produceStatusFromJSON(Json::Value const &j
static bool parseProduceStatus(const std::vector<uint8_t> &json, VDSHandle &handle, Error &error)
{
handle.produceStatuses.clear();
handle.produceStatuses.resize(int(DimensionsND::Group45) + 1, VolumeDataLayer::ProduceStatusUnavailable);
handle.produceStatuses.resize(int(Dimensions_45) + 1, VolumeDataLayer::ProduceStatusUnavailable);
Json::Value root;
if (!parseJSONFromBuffer(json, root, error))
{
......@@ -561,41 +561,41 @@ static bool parseProduceStatus(const std::vector<uint8_t> &json, VDSHandle &hand
if (root.empty())
return true;
handle.produceStatuses[int32_t(DimensionsND::Group012)] = produceStatusFromJSON(root["ProduceStatusDimensions_012"]);
handle.produceStatuses[int32_t(DimensionsND::Group013)] = produceStatusFromJSON(root["ProduceStatusDimensions_013"]);
handle.produceStatuses[int32_t(DimensionsND::Group014)] = produceStatusFromJSON(root["ProduceStatusDimensions_014"]);
handle.produceStatuses[int32_t(DimensionsND::Group015)] = produceStatusFromJSON(root["ProduceStatusDimensions_015"]);
handle.produceStatuses[int32_t(DimensionsND::Group023)] = produceStatusFromJSON(root["ProduceStatusDimensions_023"]);
handle.produceStatuses[int32_t(DimensionsND::Group024)] = produceStatusFromJSON(root["ProduceStatusDimensions_024"]);
handle.produceStatuses[int32_t(DimensionsND::Group025)] = produceStatusFromJSON(root["ProduceStatusDimensions_025"]);
handle.produceStatuses[int32_t(DimensionsND::Group034)] = produceStatusFromJSON(root["ProduceStatusDimensions_034"]);
handle.produceStatuses[int32_t(DimensionsND::Group035)] = produceStatusFromJSON(root["ProduceStatusDimensions_035"]);
handle.produceStatuses[int32_t(DimensionsND::Group045)] = produceStatusFromJSON(root["ProduceStatusDimensions_045"]);
handle.produceStatuses[int32_t(DimensionsND::Group123)] = produceStatusFromJSON(root["ProduceStatusDimensions_123"]);
handle.produceStatuses[int32_t(DimensionsND::Group124)] = produceStatusFromJSON(root["ProduceStatusDimensions_124"]);
handle.produceStatuses[int32_t(DimensionsND::Group125)] = produceStatusFromJSON(root["ProduceStatusDimensions_125"]);
handle.produceStatuses[int32_t(DimensionsND::Group134)] = produceStatusFromJSON(root["ProduceStatusDimensions_134"]);
handle.produceStatuses[int32_t(DimensionsND::Group135)] = produceStatusFromJSON(root["ProduceStatusDimensions_135"]);
handle.produceStatuses[int32_t(DimensionsND::Group145)] = produceStatusFromJSON(root["ProduceStatusDimensions_145"]);
handle.produceStatuses[int32_t(DimensionsND::Group234)] = produceStatusFromJSON(root["ProduceStatusDimensions_234"]);
handle.produceStatuses[int32_t(DimensionsND::Group235)] = produceStatusFromJSON(root["ProduceStatusDimensions_235"]);
handle.produceStatuses[int32_t(DimensionsND::Group245)] = produceStatusFromJSON(root["ProduceStatusDimensions_245"]);
handle.produceStatuses[int32_t(DimensionsND::Group345)] = produceStatusFromJSON(root["ProduceStatusDimensions_345"]);
handle.produceStatuses[int32_t(DimensionsND::Group01)] = produceStatusFromJSON(root["ProduceStatusDimensions_01"]);
handle.produceStatuses[int32_t(DimensionsND::Group02)] = produceStatusFromJSON(root["ProduceStatusDimensions_02"]);
handle.produceStatuses[int32_t(DimensionsND::Group03)] = produceStatusFromJSON(root["ProduceStatusDimensions_03"]);
handle.produceStatuses[int32_t(DimensionsND::Group04)] = produceStatusFromJSON(root["ProduceStatusDimensions_04"]);
handle.produceStatuses[int32_t(DimensionsND::Group05)] = produceStatusFromJSON(root["ProduceStatusDimensions_05"]);
handle.produceStatuses[int32_t(DimensionsND::Group12)] = produceStatusFromJSON(root["ProduceStatusDimensions_12"]);
handle.produceStatuses[int32_t(DimensionsND::Group13)] = produceStatusFromJSON(root["ProduceStatusDimensions_13"]);
handle.produceStatuses[int32_t(DimensionsND::Group14)] = produceStatusFromJSON(root["ProduceStatusDimensions_14"]);
handle.produceStatuses[int32_t(DimensionsND::Group15)] = produceStatusFromJSON(root["ProduceStatusDimensions_15"]);
handle.produceStatuses[int32_t(DimensionsND::Group23)] = produceStatusFromJSON(root["ProduceStatusDimensions_23"]);
handle.produceStatuses[int32_t(DimensionsND::Group24)] = produceStatusFromJSON(root["ProduceStatusDimensions_24"]);
handle.produceStatuses[int32_t(DimensionsND::Group25)] = produceStatusFromJSON(root["ProduceStatusDimensions_25"]);
handle.produceStatuses[int32_t(DimensionsND::Group34)] = produceStatusFromJSON(root["ProduceStatusDimensions_34"]);
handle.produceStatuses[int32_t(DimensionsND::Group35)] = produceStatusFromJSON(root["ProduceStatusDimensions_35"]);
handle.produceStatuses[int32_t(DimensionsND::Group45)] = produceStatusFromJSON(root["ProduceStatusDimensions_45"]);
handle.produceStatuses[int32_t(Dimensions_012)] = produceStatusFromJSON(root["ProduceStatusDimensions_012"]);