Commit 9e94f5e8 authored by Morten Ofstad's avatar Morten Ofstad
Browse files

Merge branch feature/morten.ofstad/PythonPropertiesForGetters with...

Merge branch feature/morten.ofstad/PythonPropertiesForGetters with refs/heads/master into refs/merge-requests/127/train
parents ec5c4a72 5dd98054
Pipeline #1415 passed with stages
in 2 minutes and 44 seconds
......@@ -272,6 +272,7 @@ PyMetadata::initModule(py::module& m)
MetadataReadAccess_.def("getMetadataDoubleVector4" , [](MetadataReadAccess* self, const char * category, const char * name) { return (DoubleVector4Adapter::AdaptedType)(self->GetMetadataDoubleVector4(category, name)); }, py::arg("category"), py::arg("name"), OPENVDS_DOCSTRING(MetadataReadAccess_GetMetadataDoubleVector4));
MetadataReadAccess_.def("getMetadataString" , static_cast<const char *(MetadataReadAccess::*)(const char *, const char *) const>(&MetadataReadAccess::GetMetadataString), py::arg("category"), py::arg("name"), OPENVDS_DOCSTRING(MetadataReadAccess_GetMetadataString));
MetadataReadAccess_.def("getMetadataKeys" , static_cast<native::MetadataKeyRange(MetadataReadAccess::*)() const>(&MetadataReadAccess::GetMetadataKeys), OPENVDS_DOCSTRING(MetadataReadAccess_GetMetadataKeys));
MetadataReadAccess_.def_property_readonly("metadataKeys", &MetadataReadAccess::GetMetadataKeys, OPENVDS_DOCSTRING(MetadataReadAccess_GetMetadataKeys));
// MetadataWriteAccess
py::class_<MetadataWriteAccess, std::unique_ptr<MetadataWriteAccess, py::nodelete>>
......@@ -344,6 +345,7 @@ PyMetadata::initModule(py::module& m)
MetadataContainer_.def("clearMetadata" , static_cast<void(MetadataContainer::*)(const char *)>(&MetadataContainer::ClearMetadata), py::arg("category"), OPENVDS_DOCSTRING(MetadataContainer_ClearMetadata_2));
// AUTOGENERATE FAIL : MetadataContainer_.def("getMetadataBLOB" , static_cast<void(MetadataContainer::*)(const char *, const char *, const void **, size_t *) const>(&MetadataContainer::GetMetadataBLOB), py::arg("category"), py::arg("name"), py::arg("data"), py::arg("size"), OPENVDS_DOCSTRING(MetadataContainer_GetMetadataBLOB));
MetadataContainer_.def("getMetadataKeys" , static_cast<native::MetadataKeyRange(MetadataContainer::*)() const>(&MetadataContainer::GetMetadataKeys), OPENVDS_DOCSTRING(MetadataContainer_GetMetadataKeys));
MetadataContainer_.def_property_readonly("metadataKeys", &MetadataContainer::GetMetadataKeys, OPENVDS_DOCSTRING(MetadataContainer_GetMetadataKeys));
//AUTOGEN-END
......
......@@ -95,7 +95,9 @@ PyVolumeData::initModule(py::module& m)
CompressionInfo_.def(py::init< >(), OPENVDS_DOCSTRING(CompressionInfo_CompressionInfo));
CompressionInfo_.def(py::init<native::CompressionMethod, int>(), py::arg("compressionMethod"), py::arg("adaptiveLevel"), OPENVDS_DOCSTRING(CompressionInfo_CompressionInfo_2));
CompressionInfo_.def("getCompressionMethod" , static_cast<native::CompressionMethod(CompressionInfo::*)() const>(&CompressionInfo::GetCompressionMethod), OPENVDS_DOCSTRING(CompressionInfo_GetCompressionMethod));
CompressionInfo_.def_property_readonly("compressionMethod", &CompressionInfo::GetCompressionMethod, OPENVDS_DOCSTRING(CompressionInfo_GetCompressionMethod));
CompressionInfo_.def("getAdaptiveLevel" , static_cast<int(CompressionInfo::*)() const>(&CompressionInfo::GetAdaptiveLevel), OPENVDS_DOCSTRING(CompressionInfo_GetAdaptiveLevel));
CompressionInfo_.def_property_readonly("adaptiveLevel", &CompressionInfo::GetAdaptiveLevel, OPENVDS_DOCSTRING(CompressionInfo_GetAdaptiveLevel));
py::enum_<Dimensionality>
Dimensionality_(m,"Dimensionality", OPENVDS_DOCSTRING(Dimensionality));
......
......@@ -119,8 +119,11 @@ PyVolumeDataAccess::initModule(py::module& m)
VolumeDataAccessor_(m,"VolumeDataAccessor", OPENVDS_DOCSTRING(VolumeDataAccessor));
VolumeDataAccessor_.def("getManager" , static_cast<native::VolumeDataAccessManager &(VolumeDataAccessor::*)()>(&VolumeDataAccessor::GetManager), OPENVDS_DOCSTRING(VolumeDataAccessor_GetManager));
VolumeDataAccessor_.def_property_readonly("manager", &VolumeDataAccessor::GetManager, OPENVDS_DOCSTRING(VolumeDataAccessor_GetManager));
VolumeDataAccessor_.def("getLayout" , static_cast<const native::VolumeDataLayout *(VolumeDataAccessor::*)()>(&VolumeDataAccessor::GetLayout), OPENVDS_DOCSTRING(VolumeDataAccessor_GetLayout));
VolumeDataAccessor_.def_property_readonly("layout", &VolumeDataAccessor::GetLayout, OPENVDS_DOCSTRING(VolumeDataAccessor_GetLayout));
VolumeDataAccessor_.def("getBase" , static_cast<native::VolumeDataAccessorBase *(VolumeDataAccessor::*)()>(&VolumeDataAccessor::GetBase), OPENVDS_DOCSTRING(VolumeDataAccessor_GetBase));
VolumeDataAccessor_.def_property_readonly("base", &VolumeDataAccessor::GetBase, OPENVDS_DOCSTRING(VolumeDataAccessor_GetBase));
// VolumeDataAccessor::IndexOutOfRangeException
py::class_<VolumeDataAccessor::IndexOutOfRangeException, std::unique_ptr<VolumeDataAccessor::IndexOutOfRangeException>>
......@@ -131,6 +134,7 @@ PyVolumeDataAccess::initModule(py::module& m)
VolumeDataAccessManager_(m,"VolumeDataAccessManager", OPENVDS_DOCSTRING(VolumeDataAccessManager));
VolumeDataAccessManager_.def("getVolumeDataLayout" , static_cast<const native::VolumeDataLayout *(VolumeDataAccessManager::*)() const>(&VolumeDataAccessManager::GetVolumeDataLayout), OPENVDS_DOCSTRING(VolumeDataAccessManager_GetVolumeDataLayout));
VolumeDataAccessManager_.def_property_readonly("volumeDataLayout", &VolumeDataAccessManager::GetVolumeDataLayout, OPENVDS_DOCSTRING(VolumeDataAccessManager_GetVolumeDataLayout));
VolumeDataAccessManager_.def("getVDSProduceStatus" , static_cast<native::VDSProduceStatus(VolumeDataAccessManager::*)(const native::VolumeDataLayout *, native::DimensionsND, int, int) const>(&VolumeDataAccessManager::GetVDSProduceStatus), py::arg("volumeDataLayout"), py::arg("dimensionsND"), py::arg("lod"), py::arg("channel"), OPENVDS_DOCSTRING(VolumeDataAccessManager_GetVDSProduceStatus));
VolumeDataAccessManager_.def("createVolumeDataPageAccessor", static_cast<native::VolumeDataPageAccessor *(VolumeDataAccessManager::*)(const native::VolumeDataLayout *, native::DimensionsND, int, int, int, native::VolumeDataAccessManager::AccessMode)>(&VolumeDataAccessManager::CreateVolumeDataPageAccessor), py::arg("volumeDataLayout"), py::arg("dimensionsND"), py::arg("lod"), py::arg("channel"), py::arg("maxPages"), py::arg("accessMode"), OPENVDS_DOCSTRING(VolumeDataAccessManager_CreateVolumeDataPageAccessor));
VolumeDataAccessManager_.def("destroyVolumeDataPageAccessor", static_cast<void(VolumeDataAccessManager::*)(native::VolumeDataPageAccessor *)>(&VolumeDataAccessManager::DestroyVolumeDataPageAccessor), py::arg("volumeDataPageAccessor"), OPENVDS_DOCSTRING(VolumeDataAccessManager_DestroyVolumeDataPageAccessor));
......@@ -210,17 +214,23 @@ PyVolumeDataAccess::initModule(py::module& m)
VolumeDataPageAccessor_(m,"VolumeDataPageAccessor", OPENVDS_DOCSTRING(VolumeDataPageAccessor));
VolumeDataPageAccessor_.def("getLayout" , static_cast<const native::VolumeDataLayout *(VolumeDataPageAccessor::*)() const>(&VolumeDataPageAccessor::GetLayout), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetLayout));
VolumeDataPageAccessor_.def_property_readonly("layout", &VolumeDataPageAccessor::GetLayout, OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetLayout));
VolumeDataPageAccessor_.def("getLOD" , static_cast<int(VolumeDataPageAccessor::*)() const>(&VolumeDataPageAccessor::GetLOD), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetLOD));
VolumeDataPageAccessor_.def_property_readonly("LOD", &VolumeDataPageAccessor::GetLOD, OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetLOD));
VolumeDataPageAccessor_.def("getChannelIndex" , static_cast<int(VolumeDataPageAccessor::*)() const>(&VolumeDataPageAccessor::GetChannelIndex), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChannelIndex));
VolumeDataPageAccessor_.def_property_readonly("channelIndex", &VolumeDataPageAccessor::GetChannelIndex, OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChannelIndex));
VolumeDataPageAccessor_.def("getChannelDescriptor" , static_cast<const native::VolumeDataChannelDescriptor &(VolumeDataPageAccessor::*)() const>(&VolumeDataPageAccessor::GetChannelDescriptor), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChannelDescriptor));
VolumeDataPageAccessor_.def_property_readonly("channelDescriptor", &VolumeDataPageAccessor::GetChannelDescriptor, OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChannelDescriptor));
VolumeDataPageAccessor_.def("getNumSamples" , [](VolumeDataPageAccessor* self, py::array_t<int>& numSamples) { return self->GetNumSamples(PyArrayAdapter<int, 6, true>::getArrayChecked(numSamples)); }, py::arg("numSamples"), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetNumSamples));
VolumeDataPageAccessor_.def("getChunkCount" , static_cast<int64_t(VolumeDataPageAccessor::*)() const>(&VolumeDataPageAccessor::GetChunkCount), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChunkCount));
VolumeDataPageAccessor_.def_property_readonly("chunkCount", &VolumeDataPageAccessor::GetChunkCount, OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChunkCount));
VolumeDataPageAccessor_.def("getChunkMinMax" , [](VolumeDataPageAccessor* self, int64_t chunk, py::array_t<int>& min, py::array_t<int>& max) { return self->GetChunkMinMax(chunk, PyArrayAdapter<int, 6, true>::getArrayChecked(min), PyArrayAdapter<int, 6, true>::getArrayChecked(max)); }, py::arg("chunk"), py::arg("min"), py::arg("max"), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChunkMinMax));
VolumeDataPageAccessor_.def("getChunkMinMaxExcludingMargin", [](VolumeDataPageAccessor* self, int64_t chunk, py::array_t<int>& minExcludingMargin, py::array_t<int>& maxExcludingMargin) { return self->GetChunkMinMaxExcludingMargin(chunk, PyArrayAdapter<int, 6, true>::getArrayChecked(minExcludingMargin), PyArrayAdapter<int, 6, true>::getArrayChecked(maxExcludingMargin)); }, py::arg("chunk"), py::arg("minExcludingMargin"), py::arg("maxExcludingMargin"), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChunkMinMaxExcludingMargin));
VolumeDataPageAccessor_.def("getChunkIndex" , [](VolumeDataPageAccessor* self, const py::array_t<int>& position) { return self->GetChunkIndex(PyArrayAdapter<int, 6, false>::getArrayChecked(position)); }, py::arg("position"), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetChunkIndex));
VolumeDataPageAccessor_.def("addReference" , static_cast<int(VolumeDataPageAccessor::*)()>(&VolumeDataPageAccessor::AddReference), OPENVDS_DOCSTRING(VolumeDataPageAccessor_AddReference));
VolumeDataPageAccessor_.def("removeReference" , static_cast<int(VolumeDataPageAccessor::*)()>(&VolumeDataPageAccessor::RemoveReference), OPENVDS_DOCSTRING(VolumeDataPageAccessor_RemoveReference));
VolumeDataPageAccessor_.def("getMaxPages" , static_cast<int(VolumeDataPageAccessor::*)()>(&VolumeDataPageAccessor::GetMaxPages), OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetMaxPages));
VolumeDataPageAccessor_.def_property_readonly("maxPages", &VolumeDataPageAccessor::GetMaxPages, OPENVDS_DOCSTRING(VolumeDataPageAccessor_GetMaxPages));
VolumeDataPageAccessor_.def("setMaxPages" , static_cast<void(VolumeDataPageAccessor::*)(int)>(&VolumeDataPageAccessor::SetMaxPages), py::arg("maxPages"), OPENVDS_DOCSTRING(VolumeDataPageAccessor_SetMaxPages));
VolumeDataPageAccessor_.def("createPage" , static_cast<native::VolumeDataPage *(VolumeDataPageAccessor::*)(int64_t)>(&VolumeDataPageAccessor::CreatePage), py::arg("chunkIndex"), OPENVDS_DOCSTRING(VolumeDataPageAccessor_CreatePage));
VolumeDataPageAccessor_.def("readPage" , static_cast<native::VolumeDataPage *(VolumeDataPageAccessor::*)(int64_t)>(&VolumeDataPageAccessor::ReadPage), py::arg("chunkIndex"), OPENVDS_DOCSTRING(VolumeDataPageAccessor_ReadPage));
......
......@@ -30,11 +30,17 @@ PyVolumeDataAxisDescriptor::initModule(py::module& m)
VolumeDataAxisDescriptor_.def(py::init< >(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_VolumeDataAxisDescriptor));
VolumeDataAxisDescriptor_.def(py::init<int, const char *, const char *, float, float>(), py::arg("numSamples"), py::arg("name"), py::arg("unit"), py::arg("coordinateMin"), py::arg("coordinateMax"), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_VolumeDataAxisDescriptor_2));
VolumeDataAxisDescriptor_.def("getNumSamples" , static_cast<int(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetNumSamples), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetNumSamples));
VolumeDataAxisDescriptor_.def_property_readonly("numSamples", &VolumeDataAxisDescriptor::GetNumSamples, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetNumSamples));
VolumeDataAxisDescriptor_.def("getName" , static_cast<const char *(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetName), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetName));
VolumeDataAxisDescriptor_.def_property_readonly("name", &VolumeDataAxisDescriptor::GetName, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetName));
VolumeDataAxisDescriptor_.def("getUnit" , static_cast<const char *(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetUnit), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetUnit));
VolumeDataAxisDescriptor_.def_property_readonly("unit", &VolumeDataAxisDescriptor::GetUnit, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetUnit));
VolumeDataAxisDescriptor_.def("getCoordinateMin" , static_cast<float(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetCoordinateMin), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateMin));
VolumeDataAxisDescriptor_.def_property_readonly("coordinateMin", &VolumeDataAxisDescriptor::GetCoordinateMin, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateMin));
VolumeDataAxisDescriptor_.def("getCoordinateMax" , static_cast<float(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetCoordinateMax), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateMax));
VolumeDataAxisDescriptor_.def_property_readonly("coordinateMax", &VolumeDataAxisDescriptor::GetCoordinateMax, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateMax));
VolumeDataAxisDescriptor_.def("getCoordinateStep" , static_cast<float(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetCoordinateStep), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateStep));
VolumeDataAxisDescriptor_.def_property_readonly("coordinateStep", &VolumeDataAxisDescriptor::GetCoordinateStep, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateStep));
VolumeDataAxisDescriptor_.def("sampleIndexToCoordinate" , static_cast<float(VolumeDataAxisDescriptor::*)(int)>(&VolumeDataAxisDescriptor::SampleIndexToCoordinate), py::arg("sampleIndex"), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_SampleIndexToCoordinate));
VolumeDataAxisDescriptor_.def("coordinateToSampleIndex" , static_cast<int(VolumeDataAxisDescriptor::*)(float)>(&VolumeDataAxisDescriptor::CoordinateToSampleIndex), py::arg("coordinate"), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_CoordinateToSampleIndex));
......
......@@ -37,22 +37,39 @@ PyVolumeDataChannelDescriptor::initModule(py::module& m)
VolumeDataChannelDescriptor_.def(py::init<native::VolumeDataChannelDescriptor::Format, native::VolumeDataChannelDescriptor::Components, const char *, const char *, float, float, float, native::VolumeDataMapping, VolumeDataChannelDescriptor::Flags>(), py::arg("format"), py::arg("components"), py::arg("pName"), py::arg("pUnit"), py::arg("valueRangeMin"), py::arg("valueRangeMax"), py::arg("noValue"), py::arg("mapping"), py::arg("flags"), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_VolumeDataChannelDescriptor_8));
VolumeDataChannelDescriptor_.def(py::init<native::VolumeDataChannelDescriptor::Format, native::VolumeDataChannelDescriptor::Components, const char *, const char *, float, float, native::VolumeDataMapping, int, VolumeDataChannelDescriptor::Flags, float, float, float>(), py::arg("format"), py::arg("components"), py::arg("name"), py::arg("unit"), py::arg("valueRangeMin"), py::arg("valueRangeMax"), py::arg("mapping"), py::arg("mappedValueCount"), py::arg("flags"), py::arg("noValue"), py::arg("integerScale"), py::arg("integerOffset"), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_VolumeDataChannelDescriptor_9));
VolumeDataChannelDescriptor_.def("getFormat" , static_cast<native::VolumeDataChannelDescriptor::Format(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetFormat), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetFormat));
VolumeDataChannelDescriptor_.def_property_readonly("format", &VolumeDataChannelDescriptor::GetFormat, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetFormat));
VolumeDataChannelDescriptor_.def("getComponents" , static_cast<native::VolumeDataChannelDescriptor::Components(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetComponents), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetComponents));
VolumeDataChannelDescriptor_.def_property_readonly("components", &VolumeDataChannelDescriptor::GetComponents, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetComponents));
VolumeDataChannelDescriptor_.def("isDiscrete" , static_cast<bool(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::IsDiscrete), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsDiscrete));
VolumeDataChannelDescriptor_.def_property_readonly("discrete", &VolumeDataChannelDescriptor::IsDiscrete, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsDiscrete));
VolumeDataChannelDescriptor_.def("isRenderable" , static_cast<bool(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::IsRenderable), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsRenderable));
VolumeDataChannelDescriptor_.def_property_readonly("renderable", &VolumeDataChannelDescriptor::IsRenderable, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsRenderable));
VolumeDataChannelDescriptor_.def("isAllowLossyCompression" , static_cast<bool(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::IsAllowLossyCompression), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsAllowLossyCompression));
VolumeDataChannelDescriptor_.def_property_readonly("allowLossyCompression", &VolumeDataChannelDescriptor::IsAllowLossyCompression, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsAllowLossyCompression));
VolumeDataChannelDescriptor_.def("isUseZipForLosslessCompression", static_cast<bool(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::IsUseZipForLosslessCompression), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsUseZipForLosslessCompression));
VolumeDataChannelDescriptor_.def_property_readonly("useZipForLosslessCompression", &VolumeDataChannelDescriptor::IsUseZipForLosslessCompression, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsUseZipForLosslessCompression));
VolumeDataChannelDescriptor_.def("getName" , static_cast<const char *(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetName), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetName));
VolumeDataChannelDescriptor_.def_property_readonly("name", &VolumeDataChannelDescriptor::GetName, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetName));
VolumeDataChannelDescriptor_.def("getUnit" , static_cast<const char *(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetUnit), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetUnit));
VolumeDataChannelDescriptor_.def_property_readonly("unit", &VolumeDataChannelDescriptor::GetUnit, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetUnit));
VolumeDataChannelDescriptor_.def("getValueRange" , static_cast<const native::FloatRange &(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetValueRange), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetValueRange));
VolumeDataChannelDescriptor_.def_property_readonly("valueRange", &VolumeDataChannelDescriptor::GetValueRange, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetValueRange));
VolumeDataChannelDescriptor_.def("getValueRangeMin" , static_cast<float(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetValueRangeMin), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetValueRangeMin));
VolumeDataChannelDescriptor_.def_property_readonly("valueRangeMin", &VolumeDataChannelDescriptor::GetValueRangeMin, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetValueRangeMin));
VolumeDataChannelDescriptor_.def("getValueRangeMax" , static_cast<float(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetValueRangeMax), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetValueRangeMax));
VolumeDataChannelDescriptor_.def_property_readonly("valueRangeMax", &VolumeDataChannelDescriptor::GetValueRangeMax, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetValueRangeMax));
VolumeDataChannelDescriptor_.def("getMapping" , static_cast<native::VolumeDataMapping(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetMapping), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetMapping));
VolumeDataChannelDescriptor_.def_property_readonly("mapping", &VolumeDataChannelDescriptor::GetMapping, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetMapping));
VolumeDataChannelDescriptor_.def("getMappedValueCount" , static_cast<int(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetMappedValueCount), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetMappedValueCount));
VolumeDataChannelDescriptor_.def_property_readonly("mappedValueCount", &VolumeDataChannelDescriptor::GetMappedValueCount, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetMappedValueCount));
VolumeDataChannelDescriptor_.def("isUseNoValue" , static_cast<bool(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::IsUseNoValue), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsUseNoValue));
VolumeDataChannelDescriptor_.def_property_readonly("useNoValue", &VolumeDataChannelDescriptor::IsUseNoValue, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_IsUseNoValue));
VolumeDataChannelDescriptor_.def("getNoValue" , static_cast<float(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetNoValue), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetNoValue));
VolumeDataChannelDescriptor_.def_property_readonly("noValue", &VolumeDataChannelDescriptor::GetNoValue, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetNoValue));
VolumeDataChannelDescriptor_.def("getIntegerScale" , static_cast<float(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetIntegerScale), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetIntegerScale));
VolumeDataChannelDescriptor_.def_property_readonly("integerScale", &VolumeDataChannelDescriptor::GetIntegerScale, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetIntegerScale));
VolumeDataChannelDescriptor_.def("getIntegerOffset" , static_cast<float(VolumeDataChannelDescriptor::*)() const>(&VolumeDataChannelDescriptor::GetIntegerOffset), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetIntegerOffset));
VolumeDataChannelDescriptor_.def_property_readonly("integerOffset", &VolumeDataChannelDescriptor::GetIntegerOffset, OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_GetIntegerOffset));
VolumeDataChannelDescriptor_.def_static("traceMappedVolumeDataChannelDescriptor", static_cast<native::VolumeDataChannelDescriptor(*)(native::VolumeDataChannelDescriptor::Format, native::VolumeDataChannelDescriptor::Components, const char *, const char *, float, float, int, VolumeDataChannelDescriptor::Flags)>(&VolumeDataChannelDescriptor::TraceMappedVolumeDataChannelDescriptor), py::arg("format"), py::arg("components"), py::arg("pName"), py::arg("pUnit"), py::arg("valueRangeMin"), py::arg("valueRangeMax"), py::arg("mappedValueCount"), py::arg("flags"), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_TraceMappedVolumeDataChannelDescriptor));
VolumeDataChannelDescriptor_.def_static("traceMappedVolumeDataChannelDescriptor", static_cast<native::VolumeDataChannelDescriptor(*)(native::VolumeDataChannelDescriptor::Format, native::VolumeDataChannelDescriptor::Components, const char *, const char *, float, float, int, VolumeDataChannelDescriptor::Flags, float)>(&VolumeDataChannelDescriptor::TraceMappedVolumeDataChannelDescriptor), py::arg("format"), py::arg("components"), py::arg("pName"), py::arg("pUnit"), py::arg("valueRangeMin"), py::arg("valueRangeMax"), py::arg("mappedValueCount"), py::arg("flags"), py::arg("noValue"), OPENVDS_DOCSTRING(VolumeDataChannelDescriptor_TraceMappedVolumeDataChannelDescriptor_2));
......
......@@ -28,11 +28,15 @@ PyVolumeDataLayout::initModule(py::module& m)
VolumeDataLayout_(m,"VolumeDataLayout", OPENVDS_DOCSTRING(VolumeDataLayout));
VolumeDataLayout_.def("getContentsHash" , static_cast<uint64_t(VolumeDataLayout::*)() const>(&VolumeDataLayout::GetContentsHash), OPENVDS_DOCSTRING(VolumeDataLayout_GetContentsHash));
VolumeDataLayout_.def_property_readonly("contentsHash", &VolumeDataLayout::GetContentsHash, OPENVDS_DOCSTRING(VolumeDataLayout_GetContentsHash));
VolumeDataLayout_.def("getDimensionality" , static_cast<int(VolumeDataLayout::*)() const>(&VolumeDataLayout::GetDimensionality), OPENVDS_DOCSTRING(VolumeDataLayout_GetDimensionality));
VolumeDataLayout_.def_property_readonly("dimensionality", &VolumeDataLayout::GetDimensionality, OPENVDS_DOCSTRING(VolumeDataLayout_GetDimensionality));
VolumeDataLayout_.def("getChannelCount" , static_cast<int(VolumeDataLayout::*)() const>(&VolumeDataLayout::GetChannelCount), OPENVDS_DOCSTRING(VolumeDataLayout_GetChannelCount));
VolumeDataLayout_.def_property_readonly("channelCount", &VolumeDataLayout::GetChannelCount, OPENVDS_DOCSTRING(VolumeDataLayout_GetChannelCount));
VolumeDataLayout_.def("isChannelAvailable" , static_cast<bool(VolumeDataLayout::*)(const char *) const>(&VolumeDataLayout::IsChannelAvailable), py::arg("channelName"), OPENVDS_DOCSTRING(VolumeDataLayout_IsChannelAvailable));
VolumeDataLayout_.def("getChannelIndex" , static_cast<int(VolumeDataLayout::*)(const char *) const>(&VolumeDataLayout::GetChannelIndex), py::arg("channelName"), OPENVDS_DOCSTRING(VolumeDataLayout_GetChannelIndex));
VolumeDataLayout_.def("getLayoutDescriptor" , static_cast<native::VolumeDataLayoutDescriptor(VolumeDataLayout::*)() const>(&VolumeDataLayout::GetLayoutDescriptor), OPENVDS_DOCSTRING(VolumeDataLayout_GetLayoutDescriptor));
VolumeDataLayout_.def_property_readonly("layoutDescriptor", &VolumeDataLayout::GetLayoutDescriptor, OPENVDS_DOCSTRING(VolumeDataLayout_GetLayoutDescriptor));
VolumeDataLayout_.def("getChannelDescriptor" , static_cast<native::VolumeDataChannelDescriptor(VolumeDataLayout::*)(int) const>(&VolumeDataLayout::GetChannelDescriptor), py::arg("channel"), OPENVDS_DOCSTRING(VolumeDataLayout_GetChannelDescriptor));
VolumeDataLayout_.def("getAxisDescriptor" , static_cast<native::VolumeDataAxisDescriptor(VolumeDataLayout::*)(int) const>(&VolumeDataLayout::GetAxisDescriptor), py::arg("dimension"), OPENVDS_DOCSTRING(VolumeDataLayout_GetAxisDescriptor));
VolumeDataLayout_.def("getChannelFormat" , static_cast<VolumeDataChannelDescriptor::Format(VolumeDataLayout::*)(int) const>(&VolumeDataLayout::GetChannelFormat), py::arg("channel"), OPENVDS_DOCSTRING(VolumeDataLayout_GetChannelFormat));
......@@ -57,8 +61,7 @@ PyVolumeDataLayout::initModule(py::module& m)
VolumeDataLayout_.def("getChannelIntegerOffset" , static_cast<float(VolumeDataLayout::*)(int) const>(&VolumeDataLayout::GetChannelIntegerOffset), py::arg("channel"), OPENVDS_DOCSTRING(VolumeDataLayout_GetChannelIntegerOffset));
//AUTOGEN-END
VolumeDataLayout_.def_property_readonly("dimensions" , static_cast<int(VolumeDataLayout::*)() const>(&VolumeDataLayout::GetDimensionality), OPENVDS_DOCSTRING(VolumeDataLayout_GetDimensionality));
VolumeDataLayout_.def_property_readonly("shape" , [](VolumeDataLayout* self)
VolumeDataLayout_.def_property_readonly("numSamples" , [](VolumeDataLayout* self)
{
int dimensions = self->GetDimensionality();
int anVoxelCount[6];
......
......@@ -30,14 +30,22 @@ PyVolumeDataLayoutDescriptor::initModule(py::module& m)
VolumeDataLayoutDescriptor_.def(py::init< >(), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_VolumeDataLayoutDescriptor));
VolumeDataLayoutDescriptor_.def(py::init<native::VolumeDataLayoutDescriptor::BrickSize, int, int, int, native::VolumeDataLayoutDescriptor::LODLevels, native::VolumeDataLayoutDescriptor::Options, int>(), py::arg("brickSize"), py::arg("negativeMargin"), py::arg("positiveMargin"), py::arg("brickSize2DMultiplier"), py::arg("lodLevels"), py::arg("options"), py::arg("fullResolutionDimension"), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_VolumeDataLayoutDescriptor_2));
VolumeDataLayoutDescriptor_.def("isValid" , static_cast<bool(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::IsValid), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_IsValid));
VolumeDataLayoutDescriptor_.def_property_readonly("valid", &VolumeDataLayoutDescriptor::IsValid, OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_IsValid));
VolumeDataLayoutDescriptor_.def("getBrickSize" , static_cast<native::VolumeDataLayoutDescriptor::BrickSize(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::GetBrickSize), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetBrickSize));
VolumeDataLayoutDescriptor_.def_property_readonly("brickSize", &VolumeDataLayoutDescriptor::GetBrickSize, OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetBrickSize));
VolumeDataLayoutDescriptor_.def("getNegativeMargin" , static_cast<int(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::GetNegativeMargin), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetNegativeMargin));
VolumeDataLayoutDescriptor_.def_property_readonly("negativeMargin", &VolumeDataLayoutDescriptor::GetNegativeMargin, OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetNegativeMargin));
VolumeDataLayoutDescriptor_.def("getPositiveMargin" , static_cast<int(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::GetPositiveMargin), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetPositiveMargin));
VolumeDataLayoutDescriptor_.def_property_readonly("positiveMargin", &VolumeDataLayoutDescriptor::GetPositiveMargin, OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetPositiveMargin));
VolumeDataLayoutDescriptor_.def("getBrickSizeMultiplier2D" , static_cast<int(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::GetBrickSizeMultiplier2D), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetBrickSizeMultiplier2D));
VolumeDataLayoutDescriptor_.def_property_readonly("brickSizeMultiplier2D", &VolumeDataLayoutDescriptor::GetBrickSizeMultiplier2D, OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetBrickSizeMultiplier2D));
VolumeDataLayoutDescriptor_.def("getLODLevels" , static_cast<native::VolumeDataLayoutDescriptor::LODLevels(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::GetLODLevels), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetLODLevels));
VolumeDataLayoutDescriptor_.def("isCreate2DLODs" , static_cast<bool(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::IsCreate2DLODs), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_IsCreate2DLODs));
VolumeDataLayoutDescriptor_.def_property_readonly("create2DLODs", &VolumeDataLayoutDescriptor::IsCreate2DLODs, OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_IsCreate2DLODs));
VolumeDataLayoutDescriptor_.def("isForceFullResolutionDimension", static_cast<bool(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::IsForceFullResolutionDimension), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_IsForceFullResolutionDimension));
VolumeDataLayoutDescriptor_.def_property_readonly("forceFullResolutionDimension", &VolumeDataLayoutDescriptor::IsForceFullResolutionDimension, OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_IsForceFullResolutionDimension));
VolumeDataLayoutDescriptor_.def("getFullResolutionDimension" , static_cast<int(VolumeDataLayoutDescriptor::*)() const>(&VolumeDataLayoutDescriptor::GetFullResolutionDimension), OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetFullResolutionDimension));
VolumeDataLayoutDescriptor_.def_property_readonly("fullResolutionDimension", &VolumeDataLayoutDescriptor::GetFullResolutionDimension, OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_GetFullResolutionDimension));
py::enum_<VolumeDataLayoutDescriptor::BrickSize>
VolumeDataLayoutDescriptor_BrickSize_(VolumeDataLayoutDescriptor_,"BrickSize", OPENVDS_DOCSTRING(VolumeDataLayoutDescriptor_BrickSize));
......
......@@ -51,12 +51,10 @@ def _ndarrayarray(tuples: List[Tuple[float]]):
class VolumeDataRequest(object):
def __init__(self, accessManager: openvds.core.VolumeDataAccessManager, layout: openvds.core.VolumeDataLayout, data_out: np.array = None, dimensionsND: DimensionsND = DimensionsND.Dimensions_012, lod: int = 0, channel: int = 0, min: Tuple[int] = None, max: Tuple[int] = None, format: VoxelFormat = VoxelFormat.Format_R32, replacementNoValue = None):
array_interface = None
if hasattr(data_out, "__cuda_array_interface__"):
array_interface = data_out.__cuda_array_interface__
elif hasattr(data_out, "__array_interface__"):
if hasattr(data_out, "__array_interface__"):
array_interface = data_out.__array_interface__
elif not data_out is None:
raise TypeError("data_out: Invalid type: Only numpy.ndarray and numba.cuda.devicearray are supported")
raise TypeError("data_out: Invalid type: Only numpy.ndarray is supported")
if array_interface:
dtype = np.dtype(array_interface["typestr"])
ptr, readonly = array_interface["data"]
......@@ -213,7 +211,7 @@ class VolumeDataSamplesRequest(VolumeDataRequest):
self.samplePositions = samplePositions
self.interpolationMethod = interpolationMethod
self.sampleCount = len(samplePositions)
min_, max_ = layout.shape
min_, max_ = layout.numSamples
super().__init__(accessManager, layout, data_out, dimensionsND, lod, channel, min_, max_, VoxelFormat.Format_R32, replacementNoValue)
if self._data_out is None:
self._data_out = np.zeros((self.sampleCount), dtype=np.float32)
......@@ -244,7 +242,7 @@ class VolumeDataTracesRequest(VolumeDataRequest):
self.interpolationMethod = interpolationMethod
self.traceCount = len(tracePositions)
self.traceDimension = traceDimension
min_, max_ = layout.shape
min_, max_ = layout.numSamples
super().__init__(accessManager, layout, data_out, dimensionsND, lod, channel, min_, max_, VoxelFormat.Format_R32, replacementNoValue)
if self._data_out is None:
self._data_out = np.zeros(self._accessManager.getVolumeTracesBufferSize(self._layout, traceCount, traceDimension, lod), dtype=np.int8)
......@@ -256,7 +254,7 @@ class VolumeDataTracesRequest(VolumeDataRequest):
class VolumeDataAccessManager(object):
"""Interface class for VDS data access.
This class has functions for making asynchronous data requests on a VDS object using numpy arrays or cuda devicearrays.
This class has functions for making asynchronous data requests on a VDS object using numpy arrays.
Parameters:
-----------
......@@ -305,7 +303,7 @@ class VolumeDataAccessManager(object):
Specifies the minimum voxel coordinates of the request (inclusive)
max : tuple
Specifies the maximum voxel coordinates of the request (exclusive)
data_out : numpy.ndarray or numba.cuda.devicearray, optional
data_out : numpy.ndarray, optional
If specified, the data requested is copied to this array. Otherwise, a suitable numpy array is allocated.
dimensionsND : DimensionsND, optional
If specified, determine the dimensiongroup requested. Defaults to DimensionGroup012
......@@ -359,7 +357,7 @@ class VolumeDataAccessManager(object):
Specifies the minimum voxel coordinates of the request (inclusive)
max : tuple
Specifies the maximum voxel coordinates of the request (exclusive)
data_out : numpy.ndarray or numba.cuda.devicearray, optional
data_out : numpy.ndarray, optional
If specified, the data requested is copied to this array. Otherwise, a suitable numpy array is allocated.
dimensionsND : DimensionsND, optional
If specified, determine the dimensiongroup requested. Defaults to DimensionGroup012
......@@ -518,7 +516,7 @@ class VolumeDataAccessManager(object):
def _createVolumeDataAccessor(self, factoryName: str, pageAccessor: VolumeDataPageAccessor=None, replacementNoValue=None, interpolationMethod: InterpolationMethod=None):
if pageAccessor is None:
defaultDimensions = { 2: DimensionsND.Dimensions_01, 3: DimensionsND.Dimensions_012, 4: DimensionsND.Dimensions_012 }
pageAccessor = self.manager.createVolumeDataPageAccessor(self.layout, defaultDimensions[self.layout.dimensions], 0, 0, 8, self.manager.AccessMode.AccessMode_ReadOnly)
pageAccessor = self.manager.createVolumeDataPageAccessor(self.layout, defaultDimensions[self.layout.dimensionality], 0, 0, 8, self.manager.AccessMode.AccessMode_ReadOnly)
return VolmeDataAccessorManager(factoryName.strip(), self.manager, pageAccessor, replacementNoValue, interpolationMethod)
def create2DVolumeDataAccessor1Bit (self, pageAccessor: VolumeDataPageAccessor=None, replacementNoValue=None): return self._createVolumeDataAccessor("create2DVolumeDataAccessor1Bit", pageAccessor, replacementNoValue)
......
......@@ -129,7 +129,7 @@ def dump_node(n, file=sys.stdout):
print("name: {0:40} {2:20} displayname: {1}".format(n.spelling, n.displayname, str(n.kind).replace('CursorKind.', '')), file)
def getpyname(name):
return name[0].lower() + name[1:]
return name[0].lower() + name[1:] if not name[1:2].isupper() else name
def getparent(node, all_):
if node.semantic_parent:
......@@ -347,20 +347,32 @@ def generate_function(node, all_, output, indent, parent_prefix, context):
argnames
)
line = ''
fnname = getpyname(sanitize_name(node.spelling))
if not can_generate_function(restype, arglist):
try:
code = """.def({0:30}, {1}, {2});""".format(
q(getpyname(sanitize_name(node.spelling))),
q(fnname),
try_generate_trampoline_function(node, all_, restype, arglist, params),
format_docstring_decl(overload_name)
)
except UnsupportedFunctionSignatureError:
fnname = '' # Prevent generation of property getter
line = '// AUTOGENERATE FAIL : '
_AUTOGEN_FAIL_LIST.append(node)
if node.is_static_method():
code = code.replace('.def(', '.def_static(')
line = line + indent + parent_prefix + code
output.append(line)
# Generate read-only property for get...() and is...() methods with no arguments
pname = getpyname(fnname[3:]) if fnname.startswith("get") else getpyname(fnname[2:]) if fnname.startswith("is") else ""
if pname and not argnames and not pname.isdigit() and not pname == "LODLevels":
getter_code = """.def_property_readonly("{}", &{}, {});""".format(
pname,
getnativename(node, all_),
format_docstring_decl(overload_name)
)
getter_line = indent + parent_prefix + getter_code
output.append(getter_line)
def generate_class(node, all_, output, indent, parent_prefix, context):
if node.is_definition():
......
Supports Markdown
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