diff --git a/OpenMesh/OMPropertyModel.hh b/OpenMesh/OMPropertyModel.hh index fc2b8920996da0adc6869e65d74cfde937a74e7f..0171444fdabb9713eccdb7adaf19ba112e6fa1c7 100644 --- a/OpenMesh/OMPropertyModel.hh +++ b/OpenMesh/OMPropertyModel.hh @@ -168,6 +168,7 @@ public: static const TypeInfoWrapper proptype_bool; static const TypeInfoWrapper proptype_int; static const TypeInfoWrapper proptype_uint; + static const TypeInfoWrapper proptype_uint8_t; static const TypeInfoWrapper proptype_double; static const TypeInfoWrapper proptype_Vec3d; static const TypeInfoWrapper proptype_Vec3f; @@ -205,6 +206,8 @@ template const TypeInfoWrapper OMPropertyModel::proptype_int = TypeInfoWrapper(typeid(OpenMesh::PropertyT), "int"); template const TypeInfoWrapper OMPropertyModel::proptype_uint = TypeInfoWrapper(typeid(OpenMesh::PropertyT), "unsigned int"); +template const TypeInfoWrapper OMPropertyModel::proptype_uint8_t + = TypeInfoWrapper(typeid(OpenMesh::PropertyT), "uint8_t"); template const TypeInfoWrapper OMPropertyModel::proptype_double = TypeInfoWrapper(typeid(OpenMesh::PropertyT), "double"); template const TypeInfoWrapper OMPropertyModel::proptype_Vec3d diff --git a/OpenMesh/OMPropertyModelT.cc b/OpenMesh/OMPropertyModelT.cc index 81cf5ddffd7493cb13022ad742977fa7a11b8d51..7b2d805b0b258310a3ca5cef24f5cf4c16ce93ba 100644 --- a/OpenMesh/OMPropertyModelT.cc +++ b/OpenMesh/OMPropertyModelT.cc @@ -547,6 +547,8 @@ void OMPropertyModel::addPropertyVisualizer(OpenMesh::BaseProperty* const propertyVisualizers.push_back(new OMPropertyVisualizerInteger(mesh, propInfo, false)); else if (propInfo.typeinfo() == proptype_uint) propertyVisualizers.push_back(new OMPropertyVisualizerInteger(mesh, propInfo, true)); + else if (propInfo.typeinfo() == proptype_uint8_t) + propertyVisualizers.push_back(new OMPropertyVisualizerInteger(mesh, propInfo, true)); else if (propInfo.typeinfo() == proptype_double) propertyVisualizers.push_back(new OMPropertyVisualizerDouble(mesh, propInfo)); else if ((propInfo.typeinfo() == proptype_Vec3d) || (propInfo.typeinfo() == proptype_Vec3f)) @@ -608,6 +610,11 @@ void OMPropertyModel:: addProperty(QString propName, QString friendlyType OpenMesh::VPropHandleT< unsigned int > prop; mesh->add_property(prop, pname.toStdString()); } + else if ( dtype == tr("uint8_t") ) + { + OpenMesh::VPropHandleT< uint8_t > prop; + mesh->add_property(prop, pname.toStdString()); + } else if ( dtype == tr("int") ) { OpenMesh::VPropHandleT< int > prop; @@ -655,6 +662,11 @@ void OMPropertyModel:: addProperty(QString propName, QString friendlyType OpenMesh::EPropHandleT< unsigned int > prop; mesh->add_property(prop, pname.toStdString()); } + else if ( dtype == tr("uint8_t") ) + { + OpenMesh::EPropHandleT< uint8_t > prop; + mesh->add_property(prop, pname.toStdString()); + } else if ( dtype == tr("int") ) { OpenMesh::EPropHandleT< int > prop; @@ -693,6 +705,11 @@ void OMPropertyModel:: addProperty(QString propName, QString friendlyType OpenMesh::FPropHandleT< unsigned int > prop; mesh->add_property(prop, pname.toStdString()); } + else if ( dtype == tr("uint8_t") ) + { + OpenMesh::FPropHandleT< uint8_t > prop; + mesh->add_property(prop, pname.toStdString()); + } else if ( dtype == tr("int") ) { OpenMesh::FPropHandleT< int > prop; @@ -721,6 +738,11 @@ void OMPropertyModel:: addProperty(QString propName, QString friendlyType OpenMesh::HPropHandleT< unsigned int > prop; mesh->add_property(prop, pname.toStdString()); } + else if ( dtype == tr("uint8_t") ) + { + OpenMesh::HPropHandleT< uint8_t > prop; + mesh->add_property(prop, pname.toStdString()); + } else if ( dtype == tr("int") ) { OpenMesh::HPropHandleT< int > prop; @@ -744,6 +766,7 @@ void OMPropertyModel::initializeSupportedPropertyTypes() supportedPropertyTypes.insert(proptype_bool); supportedPropertyTypes.insert(proptype_int); supportedPropertyTypes.insert(proptype_uint); + supportedPropertyTypes.insert(proptype_uint8_t); supportedPropertyTypes.insert(proptype_double); supportedPropertyTypes.insert(proptype_Vec3d); supportedPropertyTypes.insert(proptype_Vec3f); diff --git a/OpenMesh/OMPropertyVisualizerIntegerT.cc b/OpenMesh/OMPropertyVisualizerIntegerT.cc index 66ccc019e722ca5e0bb6320fb21f743ad3e7c818..bcfdb24c9b7f1279265b5a8b93a929c9392c1493 100644 --- a/OpenMesh/OMPropertyVisualizerIntegerT.cc +++ b/OpenMesh/OMPropertyVisualizerIntegerT.cc @@ -70,7 +70,7 @@ OMPropertyVisualizerInteger::OMPropertyVisualizerInteger(MeshT* _mesh, template QString OMPropertyVisualizerInteger::getPropertyText(unsigned int index) { - return OMPropertyVisualizer::template getPropertyText_(index); + return OMPropertyVisualizer::template getPropertyText_(index); } template diff --git a/PropertyVisualizer.hh b/PropertyVisualizer.hh index f9f045457d96f75cf9882fdd10b62759f9b3d6ae..a4b3db3e7530a4e37419ee99e8e50f0cb82da9b1 100644 --- a/PropertyVisualizer.hh +++ b/PropertyVisualizer.hh @@ -160,6 +160,7 @@ public: static inline QString toStr(bool b) { return b ? QObject::tr("True") : QObject::tr("False"); } static inline QString toStr(double d) { return QObject::tr("%1").arg(d); } static inline QString toStr(int i) { return QObject::tr("%1").arg(i); } + static inline QString toStr(uint8_t i) { return QObject::tr("%1").arg(i); } static inline QString toStr(unsigned int i) { return QObject::tr("%1").arg(i); } static QString toStr(OpenMesh::Vec3d v); static QString toStr(OpenMesh::Vec2d v);