Commit 9a1e6a55 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Plugin-PropertyVis: Enable visualization of uint8_t.

parent d1a3190f
......@@ -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 <typename T> const TypeInfoWrapper OMPropertyModel<T>::proptype_int
= TypeInfoWrapper(typeid(OpenMesh::PropertyT<int>), "int");
template <typename T> const TypeInfoWrapper OMPropertyModel<T>::proptype_uint
= TypeInfoWrapper(typeid(OpenMesh::PropertyT<unsigned int>), "unsigned int");
template <typename T> const TypeInfoWrapper OMPropertyModel<T>::proptype_uint8_t
= TypeInfoWrapper(typeid(OpenMesh::PropertyT<uint8_t>), "uint8_t");
template <typename T> const TypeInfoWrapper OMPropertyModel<T>::proptype_double
= TypeInfoWrapper(typeid(OpenMesh::PropertyT<double>), "double");
template <typename T> const TypeInfoWrapper OMPropertyModel<T>::proptype_Vec3d
......
......@@ -547,6 +547,8 @@ void OMPropertyModel<MeshT>::addPropertyVisualizer(OpenMesh::BaseProperty* const
propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, int>(mesh, propInfo, false));
else if (propInfo.typeinfo() == proptype_uint)
propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, unsigned int>(mesh, propInfo, true));
else if (propInfo.typeinfo() == proptype_uint8_t)
propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, uint8_t>(mesh, propInfo, true));
else if (propInfo.typeinfo() == proptype_double)
propertyVisualizers.push_back(new OMPropertyVisualizerDouble<MeshT>(mesh, propInfo));
else if ((propInfo.typeinfo() == proptype_Vec3d) || (propInfo.typeinfo() == proptype_Vec3f))
......@@ -608,6 +610,11 @@ void OMPropertyModel<MeshT>:: 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<MeshT>:: 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<MeshT>:: 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<MeshT>:: 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<MeshT>::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);
......
......@@ -70,7 +70,7 @@ OMPropertyVisualizerInteger<MeshT, T>::OMPropertyVisualizerInteger(MeshT* _mesh,
template <typename MeshT,typename T>
QString OMPropertyVisualizerInteger<MeshT, T>::getPropertyText(unsigned int index)
{
return OMPropertyVisualizer<MeshT>::template getPropertyText_<int>(index);
return OMPropertyVisualizer<MeshT>::template getPropertyText_<T>(index);
}
template <typename MeshT, typename T>
......
......@@ -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);
......
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