Commit f9842d34 authored by Morten Ofstad's avatar Morten Ofstad
Browse files

Changed 'Vec' to 'Vector' since we're trying to avoid unnecessary and arbitrary abbreviations.

parent d8e82552
......@@ -75,23 +75,23 @@ bool operator!=(const Vector<T, N> &a, const Vector<T, N> &b)
}
template<typename T>
using Vec2 = Vector<T, 2>;
using Vector2 = Vector<T, 2>;
template<typename T>
using Vec3 = Vector<T, 3>;
using Vector3 = Vector<T, 3>;
template<typename T>
using Vec4 = Vector<T, 4>;
using Vector4 = Vector<T, 4>;
using IntVec2 = Vec2<int>;
using IntVec3 = Vec3<int>;
using IntVec4 = Vec4<int>;
using IntVector2 = Vector2<int>;
using IntVector3 = Vector3<int>;
using IntVector4 = Vector4<int>;
using FloatVec2 = Vec2<float>;
using FloatVec3 = Vec3<float>;
using FloatVec4 = Vec4<float>;
using FloatVector2 = Vector2<float>;
using FloatVector3 = Vector3<float>;
using FloatVector4 = Vector4<float>;
using DoubleVec2 = Vec2<double>;
using DoubleVec3 = Vec3<double>;
using DoubleVec4 = Vec4<double>;
using DoubleVector2 = Vector2<double>;
using DoubleVector3 = Vector3<double>;
using DoubleVector4 = Vector4<double>;
}
......@@ -51,23 +51,24 @@ namespace OpenVDS
{
struct MetadataContainer
{
std::unordered_map<MetadataKey, int> intData;
std::unordered_map<MetadataKey, IntVec2> intVec2Data;
std::unordered_map<MetadataKey, IntVec3> intVec3Data;
std::unordered_map<MetadataKey, IntVec4> intVec4Data;
std::unordered_map<MetadataKey, int> intData;
std::unordered_map<MetadataKey, IntVector2> intVector2Data;
std::unordered_map<MetadataKey, IntVector3> intVector3Data;
std::unordered_map<MetadataKey, IntVector4> intVector4Data;
std::unordered_map<MetadataKey, float> floatData;
std::unordered_map<MetadataKey, FloatVec2> floatVec2Data;
std::unordered_map<MetadataKey, FloatVec3> floatVec3Data;
std::unordered_map<MetadataKey, FloatVec4> floatVec4Data;
std::unordered_map<MetadataKey, float> floatData;
std::unordered_map<MetadataKey, FloatVector2> floatVector2Data;
std::unordered_map<MetadataKey, FloatVector3> floatVector3Data;
std::unordered_map<MetadataKey, FloatVector4> floatVector4Data;
std::unordered_map<MetadataKey, double> doubleData;
std::unordered_map<MetadataKey, DoubleVec2> doubleVec2Data;
std::unordered_map<MetadataKey, DoubleVec3> doubleVec3Data;
std::unordered_map<MetadataKey, DoubleVec4> doubleVec4Data;
std::unordered_map<MetadataKey, double> doubleData;
std::unordered_map<MetadataKey, DoubleVector2> doubleVector2Data;
std::unordered_map<MetadataKey, DoubleVector3> doubleVector3Data;
std::unordered_map<MetadataKey, DoubleVector4> doubleVector4Data;
std::unordered_map<MetadataKey, std::string> stringData;
std::unordered_map<MetadataKey, std::vector<uint8_t>> blobData;
};
} // end namespace OpenVDS
......
This diff is collapsed.
......@@ -458,15 +458,15 @@ static bool parseVDSObject(const std::string &json, VDSHandle &handle, Error &er
}
else if (metadata["Type"].asString() == "IntVector2")
{
handle.metaDataContainer.intVec2Data[key] = { metadata["Value"][0].asInt(), metadata["Value"][1].asInt()};
handle.metaDataContainer.intVector2Data[key] = { metadata["Value"][0].asInt(), metadata["Value"][1].asInt()};
}
else if (metadata["Type"].asString() == "IntVector3")
{
handle.metaDataContainer.intVec3Data[key] = { metadata["Value"][0].asInt(), metadata["Value"][1].asInt(), metadata["Value"][2].asInt() };
handle.metaDataContainer.intVector3Data[key] = { metadata["Value"][0].asInt(), metadata["Value"][1].asInt(), metadata["Value"][2].asInt() };
}
else if (metadata["Type"].asString() == "IntVector4")
{
handle.metaDataContainer.intVec4Data[key] = { metadata["Value"][0].asInt(), metadata["Value"][1].asInt(), metadata["Value"][2].asInt(), metadata["Value"][3].asInt() };
handle.metaDataContainer.intVector4Data[key] = { metadata["Value"][0].asInt(), metadata["Value"][1].asInt(), metadata["Value"][2].asInt(), metadata["Value"][3].asInt() };
}
else if (metadata["Type"].asString() == "Float")
{
......@@ -474,15 +474,15 @@ static bool parseVDSObject(const std::string &json, VDSHandle &handle, Error &er
}
else if (metadata["Type"].asString() == "FloatVector2")
{
handle.metaDataContainer.floatVec2Data[key] = { metadata["Value"][0].asFloat(), metadata["Value"][1].asFloat() };
handle.metaDataContainer.floatVector2Data[key] = { metadata["Value"][0].asFloat(), metadata["Value"][1].asFloat() };
}
else if (metadata["Type"].asString() == "FloatVector3")
{
handle.metaDataContainer.floatVec3Data[key] = { metadata["Value"][0].asFloat(), metadata["Value"][1].asFloat(), metadata["Value"][2].asFloat() };
handle.metaDataContainer.floatVector3Data[key] = { metadata["Value"][0].asFloat(), metadata["Value"][1].asFloat(), metadata["Value"][2].asFloat() };
}
else if (metadata["Type"].asString() == "FloatVector4")
{
handle.metaDataContainer.floatVec4Data[key] = { metadata["Value"][0].asFloat(), metadata["Value"][1].asFloat(), metadata["Value"][2].asFloat(), metadata["Value"][3].asFloat() };
handle.metaDataContainer.floatVector4Data[key] = { metadata["Value"][0].asFloat(), metadata["Value"][1].asFloat(), metadata["Value"][2].asFloat(), metadata["Value"][3].asFloat() };
}
else if (metadata["Type"].asString() == "Double")
{
......@@ -490,15 +490,15 @@ static bool parseVDSObject(const std::string &json, VDSHandle &handle, Error &er
}
else if (metadata["Type"].asString() == "DoubleVector2")
{
handle.metaDataContainer.doubleVec2Data[key] = { metadata["Value"][0].asDouble(), metadata["Value"][1].asDouble() };
handle.metaDataContainer.doubleVector2Data[key] = { metadata["Value"][0].asDouble(), metadata["Value"][1].asDouble() };
}
else if (metadata["Type"].asString() == "DoubleVector3")
{
handle.metaDataContainer.doubleVec3Data[key] = { metadata["Value"][0].asDouble(), metadata["Value"][1].asDouble(), metadata["Value"][2].asDouble() };
handle.metaDataContainer.doubleVector3Data[key] = { metadata["Value"][0].asDouble(), metadata["Value"][1].asDouble(), metadata["Value"][2].asDouble() };
}
else if (metadata["Type"].asString() == "DoubleVector4")
{
handle.metaDataContainer.doubleVec4Data[key] = { metadata["Value"][0].asDouble(), metadata["Value"][1].asDouble(), metadata["Value"][2].asDouble(), metadata["Value"][3].asDouble() };
handle.metaDataContainer.doubleVector4Data[key] = { metadata["Value"][0].asDouble(), metadata["Value"][1].asDouble(), metadata["Value"][2].asDouble(), metadata["Value"][3].asDouble() };
}
else if (metadata["Type"].asString() == "String")
{
......
......@@ -350,11 +350,11 @@ float VolumeDataLayer::getIntegerOffset() const
return m_volumeDataLayout->getChannelIntegerOffset(m_channel);
}
FloatVec2 VolumeDataLayer::getQuantizingScaleOffset(VolumeDataChannelDescriptor::Format format) const
FloatVector2 VolumeDataLayer::getQuantizingScaleOffset(VolumeDataChannelDescriptor::Format format) const
{
VolumeDataChannelDescriptor::Format layerFormat = getFormat();
FloatVec2 scaleAndOffset = {getIntegerScale(), getIntegerOffset()};
FloatVector2 scaleAndOffset = {getIntegerScale(), getIntegerOffset()};
if (format == VolumeDataChannelDescriptor::FormatU8 || format == VolumeDataChannelDescriptor::FormatU16)
{
......@@ -376,14 +376,14 @@ FloatVec2 VolumeDataLayer::getQuantizingScaleOffset(VolumeDataChannelDescriptor:
return scaleAndOffset;
}
FloatVec2 VolumeDataLayer::getTextureScaleOffset(VolumeDataChannelDescriptor::Format eDataBlockFormat) const
FloatVector2 VolumeDataLayer::getTextureScaleOffset(VolumeDataChannelDescriptor::Format eDataBlockFormat) const
{
return staticGetTextureScaleOffset(getValueRange(), getIntegerScale(), getIntegerOffset(), isUseNoValue(), getFormat(), eDataBlockFormat);
}
FloatVec2 VolumeDataLayer::staticGetTextureScaleOffset(const FloatRange &valueRange, float integerScale, float integerOffset, bool isUseNoValue, VolumeDataChannelDescriptor::Format originalFormat, VolumeDataChannelDescriptor::Format dataBlockFormat)
FloatVector2 VolumeDataLayer::staticGetTextureScaleOffset(const FloatRange &valueRange, float integerScale, float integerOffset, bool isUseNoValue, VolumeDataChannelDescriptor::Format originalFormat, VolumeDataChannelDescriptor::Format dataBlockFormat)
{
FloatVec2 scaleAndOffset= {1.0f, 0.0f};
FloatVector2 scaleAndOffset= {1.0f, 0.0f};
if (dataBlockFormat == VolumeDataChannelDescriptor::FormatU8 || dataBlockFormat == VolumeDataChannelDescriptor::FormatU16)
{
......
......@@ -217,13 +217,13 @@ public:
float getIntegerOffset() const;
// in cases where we have an integer data block for a non-integer layer, use this scale/offset to get back to the original values
FloatVec2 getQuantizingScaleOffset(VolumeDataChannelDescriptor::Format dataBlockFormat) const;
FloatVector2 getQuantizingScaleOffset(VolumeDataChannelDescriptor::Format dataBlockFormat) const;
FloatVec2 getTextureScaleOffset(VolumeDataChannelDescriptor::Format dataBlockFormat) const;
FloatVector2 getTextureScaleOffset(VolumeDataChannelDescriptor::Format dataBlockFormat) const;
void setProduceStatus(ProduceStatus produceStatus);
static FloatVec2 staticGetTextureScaleOffset(const FloatRange &valueRange, float integerScale, float integerOffset, bool isUseNoValue, VolumeDataChannelDescriptor::Format originalFormat, VolumeDataChannelDescriptor::Format dataBlockFormat);
static FloatVector2 staticGetTextureScaleOffset(const FloatRange &valueRange, float integerScale, float integerOffset, bool isUseNoValue, VolumeDataChannelDescriptor::Format originalFormat, VolumeDataChannelDescriptor::Format dataBlockFormat);
};
}
#endif //VOLUMEDATALAYER_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment