Commit 9163830d authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Capital letter on public members and member functions in API

parent 30e188fd
......@@ -26,6 +26,6 @@ PYBIND11_MODULE(core, m) {
py::class_< OpenVDS::VolumeDataAxisDescriptor >(m, "Axis")
.def(py::init<>())
.def(py::init<int, const char*, const char*, float, float>())
.def_property_readonly("name", &OpenVDS::VolumeDataAxisDescriptor::getName)
.def_property_readonly("name", &OpenVDS::VolumeDataAxisDescriptor::GetName)
;
}
......@@ -44,8 +44,8 @@ IOManager* IOManager::createIOManager(const OpenOptions& options, Error &error)
case OpenOptions::AWS:
return new IOManagerAWS(static_cast<const AWSOpenOptions &>(options), error);
default:
error.code = -1;
error.string = "Unknwon type for OpenOptions";
error.Code = -1;
error.String = "Unknwon type for OpenOptions";
return nullptr;
}
}
......
......@@ -130,8 +130,8 @@ namespace OpenVDS
{
lock.lock();
auto s3error = getObjectOutcome.GetError();
objReq->m_error.code = int(s3error.GetResponseCode());
objReq->m_error.string = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
objReq->m_error.Code = int(s3error.GetResponseCode());
objReq->m_error.String = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
}
objReq->m_done = true;
......@@ -185,12 +185,12 @@ namespace OpenVDS
std::unique_lock<std::mutex> lock(m_mutex);
if (!m_done)
{
error.code = -1;
error.string = "Download not done.";
error.Code = -1;
error.String = "Download not done.";
return false;
}
error = m_error;
return m_error.code == 0;
return m_error.Code == 0;
}
void DownloadRequestAWS::cancel()
......@@ -208,8 +208,8 @@ namespace OpenVDS
if (!outcome.IsSuccess())
{
auto s3error = outcome.GetError();
objReq->m_error.code = int(s3error.GetResponseCode());
objReq->m_error.string = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
objReq->m_error.Code = int(s3error.GetResponseCode());
objReq->m_error.String = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
}
objReq->m_done = true;
......@@ -265,12 +265,12 @@ namespace OpenVDS
std::unique_lock<std::mutex> lock(m_mutex);
if (!m_done)
{
error.code = -1;
error.string = "Download not done.";
error.Code = -1;
error.String = "Download not done.";
return false;
}
error = m_error;
return m_error.code == 0;
return m_error.Code == 0;
}
void UploadRequestAWS::cancel()
{
......@@ -278,14 +278,14 @@ namespace OpenVDS
}
IOManagerAWS::IOManagerAWS(const AWSOpenOptions& openOptions, Error &error)
: m_region(openOptions.region)
, m_bucket(openOptions.bucket)
, m_objectId(openOptions.key)
: m_region(openOptions.Region)
, m_bucket(openOptions.Bucket)
, m_objectId(openOptions.Key)
{
if (m_region.empty() || m_bucket.empty())
{
error.code = -1;
error.string = "AWS Config error. Empty bucket or region";
error.Code = -1;
error.String = "AWS Config error. Empty bucket or region";
return;
}
......
......@@ -34,11 +34,11 @@
namespace OpenVDS
{
VDSHandle *open(const OpenOptions &options, Error &error)
VDSHandle *Open(const OpenOptions &options, Error &error)
{
error = Error();
std::unique_ptr<VDSHandle> ret(new VDSHandle(options, error));
if (error.code)
if (error.Code)
return nullptr;
if (!downloadAndParseVolumeDataLayoutAndLayerStatus(*ret.get(), error))
......@@ -50,14 +50,14 @@ VDSHandle *open(const OpenOptions &options, Error &error)
return ret.release();
}
VolumeDataLayout *getLayout(VDSHandle *handle)
VolumeDataLayout *GetLayout(VDSHandle *handle)
{
if (!handle)
return nullptr;
return handle->volumeDataLayout.get();
}
VolumeDataAccessManager *getDataAccessManager(VDSHandle *handle)
VolumeDataAccessManager *GetDataAccessManager(VDSHandle *handle)
{
if (!handle)
return nullptr;
......@@ -75,10 +75,10 @@ const char *addDescriptorString(std::string const &descriptorString, VDSHandle &
static int32_t getInternalCubeSizeLOD0(const VolumeDataLayoutDescriptor &desc)
{
int32_t size = int32_t(1) << desc.getBrickSize();
int32_t size = int32_t(1) << desc.GetBrickSize();
size -= desc.getNegativeMargin();
size -= desc.getPositiveMargin();
size -= desc.GetNegativeMargin();
size -= desc.GetPositiveMargin();
assert(size > 0);
......@@ -87,7 +87,7 @@ static int32_t getInternalCubeSizeLOD0(const VolumeDataLayoutDescriptor &desc)
static int32_t getLODCount(const VolumeDataLayoutDescriptor &desc)
{
return desc.getLODLevels() + 1;
return desc.GetLODLevels() + 1;
}
std::string getLayerName(VolumeDataLayer const &volumeDataLayer)
......@@ -98,8 +98,8 @@ std::string getLayerName(VolumeDataLayer const &volumeDataLayer)
}
else
{
assert(std::string(volumeDataLayer.getVolumeDataChannelDescriptor().getName()) != "");
return fmt::format("{}{}LOD{}", volumeDataLayer.getVolumeDataChannelDescriptor().getName(), DimensionGroupUtil::getDimensionGroupName(volumeDataLayer.getPrimaryChannelLayer().getChunkDimensionGroup()), volumeDataLayer.getLOD());
assert(std::string(volumeDataLayer.getVolumeDataChannelDescriptor().GetName()) != "");
return fmt::format("{}{}LOD{}", volumeDataLayer.getVolumeDataChannelDescriptor().GetName(), DimensionGroupUtil::getDimensionGroupName(volumeDataLayer.getPrimaryChannelLayer().getChunkDimensionGroup()), volumeDataLayer.getLOD());
}
}
......@@ -160,14 +160,14 @@ void createVolumeDataLayout(VDSHandle &handle)
assert(nChunkDimensionality == 2 || nChunkDimensionality == 3);
int32_t physicalLODLevels = (nChunkDimensionality == 3 || handle.layoutDescriptor.isCreate2DLODs()) ? getLODCount(handle.layoutDescriptor) : 1;
int32_t brickSize = getInternalCubeSizeLOD0(handle.layoutDescriptor) * (nChunkDimensionality == 2 ? handle.layoutDescriptor.getBrickSizeMultiplier2D() : 1);
int32_t physicalLODLevels = (nChunkDimensionality == 3 || handle.layoutDescriptor.IsCreate2DLODs()) ? getLODCount(handle.layoutDescriptor) : 1;
int32_t brickSize = getInternalCubeSizeLOD0(handle.layoutDescriptor) * (nChunkDimensionality == 2 ? handle.layoutDescriptor.GetBrickSizeMultiplier2D() : 1);
handle.volumeDataLayout->createLayers(dimensionGroup, brickSize, physicalLODLevels, handle.produceStatuses[DimensionGroupUtil::getDimensionsNDFromDimensionGroup(dimensionGroup)]);
}
}
VDSHandle* create(const OpenOptions& options, VolumeDataLayoutDescriptor const &layoutDescriptor, std::vector<VolumeDataAxisDescriptor> const &axisDescriptors, std::vector<VolumeDataChannelDescriptor> const &channelDescriptors, MetadataContainer const &metadataContainer, Error &error)
VDSHandle* Create(const OpenOptions& options, VolumeDataLayoutDescriptor const &layoutDescriptor, std::vector<VolumeDataAxisDescriptor> const &axisDescriptors, std::vector<VolumeDataChannelDescriptor> const &channelDescriptors, MetadataContainer const &metadataContainer, Error &error)
{
error = Error();
std::unique_ptr<VDSHandle> handle(new VDSHandle(options, error));
......@@ -176,25 +176,25 @@ VDSHandle* create(const OpenOptions& options, VolumeDataLayoutDescriptor const &
for(auto axisDescriptor : axisDescriptors)
{
handle->axisDescriptors.push_back(VolumeDataAxisDescriptor(axisDescriptor.getNumSamples(), addDescriptorString(axisDescriptor.getName(), *handle), addDescriptorString(axisDescriptor.getUnit(), *handle), axisDescriptor.getCoordinateMin(), axisDescriptor.getCoordinateMax()));
handle->axisDescriptors.push_back(VolumeDataAxisDescriptor(axisDescriptor.GetNumSamples(), addDescriptorString(axisDescriptor.GetName(), *handle), addDescriptorString(axisDescriptor.GetUnit(), *handle), axisDescriptor.GetCoordinateMin(), axisDescriptor.GetCoordinateMax()));
}
for(auto channelDescriptor : channelDescriptors)
{
VolumeDataChannelDescriptor::Flags flags = VolumeDataChannelDescriptor::Default;
if(channelDescriptor.isDiscrete()) flags = flags | VolumeDataChannelDescriptor::DiscreteData;
if(!channelDescriptor.isAllowLossyCompression()) flags = flags | VolumeDataChannelDescriptor::NoLossyCompression;
if(channelDescriptor.isUseZipForLosslessCompression()) flags = flags | VolumeDataChannelDescriptor::NoLossyCompressionUseZip;
if(!channelDescriptor.isRenderable()) flags = flags | VolumeDataChannelDescriptor::NotRenderable;
if(channelDescriptor.IsDiscrete()) flags = flags | VolumeDataChannelDescriptor::DiscreteData;
if(!channelDescriptor.IsAllowLossyCompression()) flags = flags | VolumeDataChannelDescriptor::NoLossyCompression;
if(channelDescriptor.IsUseZipForLosslessCompression()) flags = flags | VolumeDataChannelDescriptor::NoLossyCompressionUseZip;
if(!channelDescriptor.IsRenderable()) flags = flags | VolumeDataChannelDescriptor::NotRenderable;
if(channelDescriptor.isUseNoValue())
if(channelDescriptor.IsUseNoValue())
{
handle->channelDescriptors.push_back(VolumeDataChannelDescriptor(channelDescriptor.getFormat(), channelDescriptor.getComponents(), addDescriptorString(channelDescriptor.getName(), *handle), addDescriptorString(channelDescriptor.getUnit(), *handle), channelDescriptor.getValueRangeMin(), channelDescriptor.getValueRangeMax(), channelDescriptor.getMapping(), channelDescriptor.getMappedValueCount(), flags, channelDescriptor.getNoValue(), channelDescriptor.getIntegerScale(), channelDescriptor.getIntegerOffset()));
handle->channelDescriptors.push_back(VolumeDataChannelDescriptor(channelDescriptor.GetFormat(), channelDescriptor.GetComponents(), addDescriptorString(channelDescriptor.GetName(), *handle), addDescriptorString(channelDescriptor.GetUnit(), *handle), channelDescriptor.GetValueRangeMin(), channelDescriptor.GetValueRangeMax(), channelDescriptor.GetMapping(), channelDescriptor.GetMappedValueCount(), flags, channelDescriptor.GetNoValue(), channelDescriptor.GetIntegerScale(), channelDescriptor.GetIntegerOffset()));
}
else
{
handle->channelDescriptors.push_back(VolumeDataChannelDescriptor(channelDescriptor.getFormat(), channelDescriptor.getComponents(), addDescriptorString(channelDescriptor.getName(), *handle), addDescriptorString(channelDescriptor.getUnit(), *handle), channelDescriptor.getValueRangeMin(), channelDescriptor.getValueRangeMax(), channelDescriptor.getMapping(), channelDescriptor.getMappedValueCount(), flags, channelDescriptor.getIntegerScale(), channelDescriptor.getIntegerOffset()));
handle->channelDescriptors.push_back(VolumeDataChannelDescriptor(channelDescriptor.GetFormat(), channelDescriptor.GetComponents(), addDescriptorString(channelDescriptor.GetName(), *handle), addDescriptorString(channelDescriptor.GetUnit(), *handle), channelDescriptor.GetValueRangeMin(), channelDescriptor.GetValueRangeMax(), channelDescriptor.GetMapping(), channelDescriptor.GetMappedValueCount(), flags, channelDescriptor.GetIntegerScale(), channelDescriptor.GetIntegerOffset()));
}
}
......@@ -205,7 +205,7 @@ VDSHandle* create(const OpenOptions& options, VolumeDataLayoutDescriptor const &
createVolumeDataLayout(*handle);
if (error.code)
if (error.Code)
return nullptr;
if (!serializeAndUploadVolumeDataLayout(*handle, error))
......@@ -217,7 +217,7 @@ VDSHandle* create(const OpenOptions& options, VolumeDataLayoutDescriptor const &
return handle.release();
}
void destroy(VDSHandle *handle)
void Destroy(VDSHandle *handle)
{
delete handle;
}
......
......@@ -49,18 +49,18 @@ protected:
struct AWSOpenOptions : OpenOptions
{
std::string bucket;
std::string key;
std::string region;
std::string Bucket;
std::string Key;
std::string Region;
AWSOpenOptions() : OpenOptions(AWS) {}
AWSOpenOptions(std::string const & bucket, std::string const & key, std::string const & region) : OpenOptions(AWS), bucket(bucket), key(key), region(region) {}
AWSOpenOptions(std::string const & bucket, std::string const & key, std::string const & region) : OpenOptions(AWS), Bucket(bucket), Key(key), Region(region) {}
};
struct Error
{
int code = 0;
std::string string;
int Code = 0;
std::string String;
};
enum class Access
......@@ -73,12 +73,12 @@ class VolumeDataLayout;
class VolumeDataAccessManager;
class VolumeDataPageAccessor;
OPENVDS_EXPORT VDSHandle* open(const OpenOptions& options, Error &error);
OPENVDS_EXPORT VDSHandle* create(const OpenOptions& options, VolumeDataLayoutDescriptor const &layoutDescriptor, std::vector<VolumeDataAxisDescriptor> const &axisDescriptors, std::vector<VolumeDataChannelDescriptor> const &channelDescriptors, MetadataContainer const &metadataContainer, Error &error);
OPENVDS_EXPORT void destroy(VDSHandle *handle);
OPENVDS_EXPORT VDSHandle* Open(const OpenOptions& options, Error &error);
OPENVDS_EXPORT VDSHandle* Create(const OpenOptions& options, VolumeDataLayoutDescriptor const &layoutDescriptor, std::vector<VolumeDataAxisDescriptor> const &axisDescriptors, std::vector<VolumeDataChannelDescriptor> const &channelDescriptors, MetadataContainer const &metadataContainer, Error &error);
OPENVDS_EXPORT void Destroy(VDSHandle *handle);
OPENVDS_EXPORT VolumeDataLayout *getLayout(VDSHandle *handle);
OPENVDS_EXPORT VolumeDataAccessManager *getDataAccessManager(VDSHandle *handle);
OPENVDS_EXPORT VolumeDataLayout *GetLayout(VDSHandle *handle);
OPENVDS_EXPORT VolumeDataAccessManager *GetDataAccessManager(VDSHandle *handle);
}
#endif //OPENVDS_H
......@@ -23,17 +23,17 @@ namespace OpenVDS
template<typename T>
struct Range
{
T min;
T max;
T Min;
T Max;
Range() = default;
Range(T min, T max) : min(min), max(max) {}
Range(T min, T max) : Min(min), Max(max) {}
};
template<typename T>
T rangeSize(const Range<T> &r)
{
return r.max - r.min;
return r.Max - r.Min;
}
using IntRange = Range<int>;
......@@ -42,4 +42,4 @@ using DoubleRange = Range<double>;
}
#endif //RANGE_H
\ No newline at end of file
#endif //RANGE_H
This diff is collapsed.
......@@ -45,23 +45,23 @@ public:
VolumeDataAxisDescriptor(int numSamples, const char *name, const char *unit, const FloatRange &coordinateRange)
: m_numSamples(numSamples), m_name(name), m_unit(unit), m_coordinateRange(coordinateRange) {}
int getNumSamples() const { return m_numSamples; }
const char *getName() const { return m_name; }
const char *getUnit() const { return m_unit; }
float getCoordinateMin() const { return m_coordinateRange.min; }
float getCoordinateMax() const { return m_coordinateRange.max; }
const FloatRange &getCoordinateRange() const { return m_coordinateRange; }
float getCoordinateStep() const { return (m_numSamples > 1) ? ((m_coordinateRange.max - m_coordinateRange.min) / (m_numSamples - 1)) : 0; }
int GetNumSamples() const { return m_numSamples; }
const char *GetName() const { return m_name; }
const char *GetUnit() const { return m_unit; }
float GetCoordinateMin() const { return m_coordinateRange.Min; }
float GetCoordinateMax() const { return m_coordinateRange.Max; }
const FloatRange &GetCoordinateRange() const { return m_coordinateRange; }
float GetCoordinateStep() const { return (m_numSamples > 1) ? ((m_coordinateRange.Max - m_coordinateRange.Min) / (m_numSamples - 1)) : 0; }
/// Convert a sample index on this axis to a coordinate value
/// \param sampleIndex the sample index to convert
/// \return the coordinate
float sampleIndexToCoordinate(int sampleIndex) { return m_coordinateRange.min + sampleIndex * getCoordinateStep(); }
float SampleIndexToCoordinate(int sampleIndex) { return m_coordinateRange.Min + sampleIndex * GetCoordinateStep(); }
/// Convert a coordinate to a sample index (rounding to the closest index)
/// \param coordinate the coordinate to convert
/// \return the sample index
int coordinateToSampleIndex(float coordinate) { return (coordinate == m_coordinateRange.min) ? 0 : (int)floorf(((coordinate - m_coordinateRange.min) / (m_coordinateRange.max - m_coordinateRange.min)) * (m_numSamples - 1) + 0.5f); }
int CoordinateToSampleIndex(float coordinate) { return (coordinate == m_coordinateRange.Min) ? 0 : (int)floorf(((coordinate - m_coordinateRange.Min) / (m_coordinateRange.Max - m_coordinateRange.Min)) * (m_numSamples - 1) + 0.5f); }
};
}
#endif //VOLUMEDATAAXISDESCRIPTOR_H
......
......@@ -173,26 +173,26 @@ public:
VolumeDataChannelDescriptor(Format format, Components components, const char *name, const char *unit, float valueRangeMin, float valueRangeMax, VolumeDataMapping mapping, int mappedValueCount, enum Flags flags, float noValue, float integerScale, float integerOffset)
: m_format(format), m_components(components), m_name(name), m_unit(unit), m_valueRange(valueRangeMin, valueRangeMax), m_mapping(mapping), m_mappedValueCount(mappedValueCount), m_flags(flags), m_useNoValue(true), m_noValue(noValue), m_integerScale(integerScale), m_integerOffset(integerOffset) {}
Format getFormat() const { return m_format; }
Components getComponents() const { return m_components; }
bool isDiscrete() const { return (m_flags & DiscreteData) || m_format == Format_1Bit; }
bool isRenderable() const { return !(m_flags & NotRenderable); }
bool isAllowLossyCompression() const { return !(m_flags & NoLossyCompression) && !isDiscrete(); }
bool isUseZipForLosslessCompression() const { return (m_flags & NoLossyCompressionUseZip) == NoLossyCompressionUseZip; }
const char *getName() const { return m_name; }
const char *getUnit() const { return m_unit; }
const FloatRange &getValueRange() const { return m_valueRange; }
float getValueRangeMin() const { return m_valueRange.min; }
float getValueRangeMax() const { return m_valueRange.max; }
VolumeDataMapping getMapping() const { return m_mapping; }
int getMappedValueCount() const { return m_mappedValueCount; }
bool isUseNoValue() const { return m_useNoValue; }
float getNoValue() const { return m_noValue; }
float getIntegerScale() const { return m_integerScale; }
float getIntegerOffset() const { return m_integerOffset; }
Format GetFormat() const { return m_format; }
Components GetComponents() const { return m_components; }
bool IsDiscrete() const { return (m_flags & DiscreteData) || m_format == Format_1Bit; }
bool IsRenderable() const { return !(m_flags & NotRenderable); }
bool IsAllowLossyCompression() const { return !(m_flags & NoLossyCompression) && !IsDiscrete(); }
bool IsUseZipForLosslessCompression() const { return (m_flags & NoLossyCompressionUseZip) == NoLossyCompressionUseZip; }
const char *GetName() const { return m_name; }
const char *GetUnit() const { return m_unit; }
const FloatRange &GetValueRange() const { return m_valueRange; }
float GetValueRangeMin() const { return m_valueRange.Min; }
float GetValueRangeMax() const { return m_valueRange.Max; }
VolumeDataMapping GetMapping() const { return m_mapping; }
int GetMappedValueCount() const { return m_mappedValueCount; }
bool IsUseNoValue() const { return m_useNoValue; }
float GetNoValue() const { return m_noValue; }
float GetIntegerScale() const { return m_integerScale; }
float GetIntegerOffset() const { return m_integerOffset; }
/// Named constructor for a trace mapped channel
/// \param format the data format for this channel
......
......@@ -35,67 +35,67 @@ protected:
virtual ~VolumeDataLayout() {};
public:
virtual uint64_t
getContentsHash() const = 0; ///< gets the contents hash of this VDS
GetContentsHash() const = 0; ///< gets the contents hash of this VDS
virtual int getDimensionality() const = 0; ///< gets the number of dimensions in this VDS
virtual int GetDimensionality() const = 0; ///< gets the number of dimensions in this VDS
virtual int getChannelCount() const = 0; ///< gets the number of channels in this VDS
virtual int GetChannelCount() const = 0; ///< gets the number of channels in this VDS
virtual bool isChannelAvailable(const char *channelName) const = 0; ///< Returns true of the VDS contains
virtual bool IsChannelAvailable(const char *channelName) const = 0; ///< Returns true of the VDS contains
virtual int getChannelIndex(const char *channelName) const = 0; ///< Returns the index of a the channel with the given name
virtual int GetChannelIndex(const char *channelName) const = 0; ///< Returns the index of a the channel with the given name
virtual VolumeDataChannelDescriptor
getChannelDescriptor(int channel) const = 0; ///< Returns the descriptor for the given channel index
GetChannelDescriptor(int channel) const = 0; ///< Returns the descriptor for the given channel index
virtual VolumeDataAxisDescriptor
getAxisDescriptor(int dimension) const = 0; ///< Returns the axis descriptor for the given dimension
GetAxisDescriptor(int dimension) const = 0; ///< Returns the axis descriptor for the given dimension
// These convenience functions provide access to the individual elements of the value descriptor
virtual VolumeDataChannelDescriptor::Format
getChannelFormat(int channel) const = 0; ///< get the format for the given channel index
GetChannelFormat(int channel) const = 0; ///< get the format for the given channel index
virtual VolumeDataChannelDescriptor::Components
getChannelComponents(int channel) const = 0; ///< get the vector count for the given channel index
GetChannelComponents(int channel) const = 0; ///< get the vector count for the given channel index
virtual const char *
getChannelName(int channel) const = 0; ///< get the name for the given channel index
GetChannelName(int channel) const = 0; ///< get the name for the given channel index
virtual const char *
getChannelUnit(int channel) const = 0; ///< get the unit for the given channel index
GetChannelUnit(int channel) const = 0; ///< get the unit for the given channel index
virtual float getChannelValueRangeMin(int channel) const = 0; ///< get the value range minimum for the given channel index
virtual float GetChannelValueRangeMin(int channel) const = 0; ///< get the value range minimum for the given channel index
virtual float getChannelValueRangeMax(int channel) const = 0; ///< get the value range maximum for the given channel index
virtual float GetChannelValueRangeMax(int channel) const = 0; ///< get the value range maximum for the given channel index
virtual bool isChannelDiscrete(int channel) const = 0; ///< get the discrete flag for the the given channel index
virtual bool IsChannelDiscrete(int channel) const = 0; ///< get the discrete flag for the the given channel index
virtual bool isChannelRenderable(int channel) const = 0; ///< get the renderable flag for the given channel index
virtual bool IsChannelRenderable(int channel) const = 0; ///< get the renderable flag for the given channel index
virtual bool isChannelAllowingLossyCompression(int channel) const = 0; ///< get the allow lossy compression flag for the given channel index
virtual bool IsChannelAllowingLossyCompression(int channel) const = 0; ///< get the allow lossy compression flag for the given channel index
virtual bool isChannelUseZipForLosslessCompression(int channel) const = 0; ///< get the use Zip when compressing flag for the given channel index
virtual bool IsChannelUseZipForLosslessCompression(int channel) const = 0; ///< get the use Zip when compressing flag for the given channel index
virtual VolumeDataMapping
getChannelMapping(int channel) const = 0; ///< get the mapping for the given channel index
GetChannelMapping(int channel) const = 0; ///< get the mapping for the given channel index
// These convenience functions provide access to the individual elements of the axis descriptors
virtual int getDimensionNumSamples(int dimension) const = 0; ///< get the number of samples for the given dimension
virtual int GetDimensionNumSamples(int dimension) const = 0; ///< get the number of samples for the given dimension
virtual const char *
getDimensionName(int dimension) const = 0; ///< get the name for the given dimension
GetDimensionName(int dimension) const = 0; ///< get the name for the given dimension
virtual const char *
getDimensionUnit(int dimension) const = 0; ///< get the unit for the given dimension
virtual float getDimensionMin(int dimension) const = 0; ///< get the coordinate minimum for the given dimension
virtual float getDimensionMax(int dimension) const = 0; ///< get the coordinate maximum for the given dimension
GetDimensionUnit(int dimension) const = 0; ///< get the unit for the given dimension
virtual float GetDimensionMin(int dimension) const = 0; ///< get the coordinate minimum for the given dimension
virtual float GetDimensionMax(int dimension) const = 0; ///< get the coordinate maximum for the given dimension
// virtual VDSIJKGridDefinition
// getVDSIJKGridDefinitionFromMetadata() const = 0; ///< get the VDSIJKGridDefinition from the metadata in this VDS
virtual bool isChannelUseNoValue(int channel) const = 0; ///< Returns true if the given channel index uses No Value
virtual float getChannelNoValue(int channel) const = 0; ///< gets the No Value for the given channel index
virtual bool IsChannelUseNoValue(int channel) const = 0; ///< Returns true if the given channel index uses No Value
virtual float GetChannelNoValue(int channel) const = 0; ///< gets the No Value for the given channel index
virtual float getChannelIntegerScale(int channel) const = 0; ///< Returns the integer scale for the given channel index
virtual float getChannelIntegerOffset(int channel) const = 0; ///< Returns the integer offset for the given channel index
virtual float GetChannelIntegerScale(int channel) const = 0; ///< Returns the integer scale for the given channel index
virtual float GetChannelIntegerOffset(int channel) const = 0; ///< Returns the integer offset for the given channel index
};
}
......
......@@ -76,21 +76,21 @@ public:
VolumeDataLayoutDescriptor() : m_brickSize(), m_negativeMargin(), m_positiveMargin(), m_brickSize2DMultiplier(), m_lodLevels(), m_options(), m_fullResolutionDimension() {}
VolumeDataLayoutDescriptor(BrickSize brickSize, int negativeMargin, int positiveMargin, int brickSize2DMultiplier, LODLevels lodLevels, Options options, int fullResolutionDimension = 0) : m_brickSize(brickSize), m_negativeMargin(negativeMargin), m_positiveMargin(positiveMargin), m_brickSize2DMultiplier(brickSize2DMultiplier), m_lodLevels(lodLevels), m_options(options), m_fullResolutionDimension(fullResolutionDimension) {}
bool isValid() const { return m_brickSize != 0; }
bool IsValid() const { return m_brickSize != 0; }
BrickSize getBrickSize() const { return m_brickSize; }
int getNegativeMargin() const { return m_negativeMargin; }
int getPositiveMargin() const { return m_positiveMargin; }
int getBrickSizeMultiplier2D() const { return m_brickSize2DMultiplier; }
LODLevels getLODLevels() const { return m_lodLevels; }
BrickSize GetBrickSize() const { return m_brickSize; }
int GetNegativeMargin() const { return m_negativeMargin; }
int GetPositiveMargin() const { return m_positiveMargin; }
int GetBrickSizeMultiplier2D() const { return m_brickSize2DMultiplier; }
LODLevels GetLODLevels() const { return m_lodLevels; }
bool isCreate2DLODs() const { return (m_options & Options_Create2DLODs) != 0; }
bool isForceFullResolutionDimension() const { return (m_options & Options_ForceFullResolutionDimension) != 0; }
bool IsCreate2DLODs() const { return (m_options & Options_Create2DLODs) != 0; }
bool IsForceFullResolutionDimension() const { return (m_options & Options_ForceFullResolutionDimension) != 0; }
int getFullResolutionDimension() const { return m_fullResolutionDimension; }
int GetFullResolutionDimension() const { return m_fullResolutionDimension; }
};
inline VolumeDataLayoutDescriptor::Options operator|(VolumeDataLayoutDescriptor::Options lhs, VolumeDataLayoutDescriptor::Options rhs) { return (VolumeDataLayoutDescriptor::Options)((int)lhs | (int)rhs); }
}
#endif //VOLUMEDATALAYOUTDESCRIPTOR_H
\ No newline at end of file
#endif //VOLUMEDATALAYOUTDESCRIPTOR_H
......@@ -79,11 +79,11 @@ main(int argc, char *argv[])
std::string
key = !prefix.empty() ? prefix + "/" + persistentID : persistentID;
std::unique_ptr<OpenVDS::VDSHandle, decltype(&OpenVDS::destroy)> vds(OpenVDS::open(OpenVDS::AWSOpenOptions(bucket, key, region), openError), &OpenVDS::destroy);
std::unique_ptr<OpenVDS::VDSHandle, decltype(&OpenVDS::Destroy)> vds(OpenVDS::Open(OpenVDS::AWSOpenOptions(bucket, key, region), openError), &OpenVDS::Destroy);
if(openError.code != 0)
if(openError.Code != 0)
{
fmt::print(stderr, "Could not open VDS: {}", openError.string);
fmt::print(stderr, "Could not open VDS: {}", openError.String);
return EXIT_FAILURE;
}
......@@ -101,22 +101,22 @@ main(int argc, char *argv[])
return EXIT_FAILURE;
}
auto dataAccessManager = OpenVDS::getDataAccessManager(vds.get());
auto volumeDataLayout = dataAccessManager->getVolumeDataLayout();
auto dataAccessManager = OpenVDS::GetDataAccessManager(vds.get());
auto volumeDataLayout = dataAccessManager->GetVolumeDataLayout();
if(!volumeDataLayout->isChannelAvailable("Trace"))
if(!volumeDataLayout->IsChannelAvailable("Trace"))
{
fmt::print(stderr, "VDS has no \"Trace\" channel");
return EXIT_FAILURE;
}
int traceFlagChannel = volumeDataLayout->getChannelIndex("Trace");
int traceFlagChannel = volumeDataLayout->GetChannelIndex("Trace");
if(!volumeDataLayout->isChannelAvailable("SEGYTraceHeader"))
if(!volumeDataLayout->IsChannelAvailable("SEGYTraceHeader"))
{
fmt::print(stderr, "VDS has no \"SEGYTraceHeader\" channel");
return EXIT_FAILURE;
}
int segyTraceHeaderChannel = volumeDataLayout->getChannelIndex("SEGYTraceHeader");
int segyTraceHeaderChannel = volumeDataLayout->GetChannelIndex("SEGYTraceHeader");
if(!volumeDataLayout->IsMetadataBLOBAvailable("SEGY", "TextHeader") || !volumeDataLayout->IsMetadataBLOBAvailable("SEGY", "BinaryHeader"))
{
......@@ -144,18 +144,18 @@ main(int argc, char *argv[])
return EXIT_FAILURE;
}
int dimensionality = dataAccessManager->getVolumeDataLayout()->getDimensionality();
int dimensionality = dataAccessManager->GetVolumeDataLayout()->GetDimensionality();
int outerDimension = std::max(2, dimensionality - 1);
int lineCount = volumeDataLayout->getDimensionNumSamples(outerDimension);
int lineCount = volumeDataLayout->GetDimensionNumSamples(outerDimension);
int64_t traceCount = 1;
for(int dimension = 1; dimension < outerDimension; dimension++)
{
traceCount *= volumeDataLayout->getDimensionNumSamples(dimension);
traceCount *= volumeDataLayout->GetDimensionNumSamples(dimension);
}
const int sampleFormatSize = 4;
const int sampleCount = volumeDataLayout->getDimensionNumSamples(0);
const int sampleCount = volumeDataLayout->GetDimensionNumSamples(0);
const int traceDataSize = sampleCount * sampleFormatSize;