Commit 5d5d48e7 authored by Martin Heistermann's avatar Martin Heistermann
Browse files

propvis: Store objectID in OM visualizers, analog to OVM visualizers (for future changes)

parent b85857e6
...@@ -183,7 +183,7 @@ void OMPropertyModel<MeshT>::combine() ...@@ -183,7 +183,7 @@ void OMPropertyModel<MeshT>::combine()
{ {
beginResetModel(); beginResetModel();
if (isVectorType(mCombineProperty1->typeinfo())) if (isVectorType(mCombineProperty1->typeinfo()))
propertyVisualizers.push_back(new OMPropertyVisualizerVectorFieldDifference<MeshT>(mesh_, *mCombineProperty1, *mCombineProperty2)); propertyVisualizers.push_back(new OMPropertyVisualizerVectorFieldDifference<MeshT>(mesh_, objectID_, *mCombineProperty1, *mCombineProperty2));
endResetModel(); endResetModel();
} }
...@@ -542,24 +542,24 @@ void OMPropertyModel<MeshT>::addPropertyVisualizer(OpenMesh::BaseProperty* const ...@@ -542,24 +542,24 @@ void OMPropertyModel<MeshT>::addPropertyVisualizer(OpenMesh::BaseProperty* const
{ {
PropertyInfo propInfo = PropertyInfo(baseProp->name(), getSupportedTypeInfoWrapper(baseProp) , filter); PropertyInfo propInfo = PropertyInfo(baseProp->name(), getSupportedTypeInfoWrapper(baseProp) , filter);
if (propInfo.typeinfo() == proptype_bool) if (propInfo.typeinfo() == proptype_bool)
propertyVisualizers.push_back(new OMPropertyVisualizerBoolean<MeshT>(mesh, propInfo)); propertyVisualizers.push_back(new OMPropertyVisualizerBoolean<MeshT>(mesh, objectID_, propInfo));
else if (propInfo.typeinfo() == proptype_int) else if (propInfo.typeinfo() == proptype_int)
propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, int>(mesh, propInfo, false)); propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, int>(mesh, objectID_, propInfo, false));
else if (propInfo.typeinfo() == proptype_uint) else if (propInfo.typeinfo() == proptype_uint)
propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, unsigned int>(mesh, propInfo, true)); propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, unsigned int>(mesh, objectID_, propInfo, true));
else if (propInfo.typeinfo() == proptype_uint8_t) else if (propInfo.typeinfo() == proptype_uint8_t)
propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, uint8_t>(mesh, propInfo, true)); propertyVisualizers.push_back(new OMPropertyVisualizerInteger<MeshT, uint8_t>(mesh, objectID_, propInfo, true));
else if (propInfo.typeinfo() == proptype_double) else if (propInfo.typeinfo() == proptype_double)
propertyVisualizers.push_back(new OMPropertyVisualizerDouble<MeshT>(mesh, propInfo)); propertyVisualizers.push_back(new OMPropertyVisualizerDouble<MeshT>(mesh, objectID_, propInfo));
else if ((propInfo.typeinfo() == proptype_Vec3d) || (propInfo.typeinfo() == proptype_Vec3f)) else if ((propInfo.typeinfo() == proptype_Vec3d) || (propInfo.typeinfo() == proptype_Vec3f))
propertyVisualizers.push_back(new OMPropertyVisualizerVector<MeshT>(mesh, propInfo)); propertyVisualizers.push_back(new OMPropertyVisualizerVector<MeshT>(mesh, objectID_, propInfo));
else if ((propInfo.typeinfo() == proptype_Vec2d)) else if ((propInfo.typeinfo() == proptype_Vec2d))
propertyVisualizers.push_back(new OMPropertyVisualizerVector2<MeshT, ACG::Vec2d>(mesh, propInfo)); propertyVisualizers.push_back(new OMPropertyVisualizerVector2<MeshT, ACG::Vec2d>(mesh, objectID_, propInfo));
else if ((propInfo.typeinfo() == proptype_Vec2f)) else if ((propInfo.typeinfo() == proptype_Vec2f))
propertyVisualizers.push_back(new OMPropertyVisualizerVector2<MeshT, ACG::Vec2f>(mesh, propInfo)); propertyVisualizers.push_back(new OMPropertyVisualizerVector2<MeshT, ACG::Vec2f>(mesh, objectID_, propInfo));
#ifdef ENABLE_SKELETON_SUPPORT #ifdef ENABLE_SKELETON_SUPPORT
else if (propInfo.typeinfo() == proptype_SkinWeights) else if (propInfo.typeinfo() == proptype_SkinWeights)
propertyVisualizers.push_back(new OMPropertyVisualizerSkinWeights<MeshT>(mesh, propInfo)); propertyVisualizers.push_back(new OMPropertyVisualizerSkinWeights<MeshT>(mesh, objectID_, propInfo));
#endif #endif
connectLogs(propertyVisualizers.back()); connectLogs(propertyVisualizers.back());
} }
......
...@@ -61,9 +61,10 @@ template <typename MeshT> ...@@ -61,9 +61,10 @@ template <typename MeshT>
class OMPropertyVisualizer: public PropertyVisualizer{ class OMPropertyVisualizer: public PropertyVisualizer{
public: public:
OMPropertyVisualizer(MeshT* _mesh, PropertyInfo _propertyInfo) OMPropertyVisualizer(MeshT* _mesh, int objectID, PropertyInfo _propertyInfo)
: PropertyVisualizer(_propertyInfo), : PropertyVisualizer(_propertyInfo),
mesh(_mesh) mesh(_mesh),
mObjectID(objectID)
{ } { }
virtual ~OMPropertyVisualizer(){clear();} virtual ~OMPropertyVisualizer(){clear();}
...@@ -97,6 +98,7 @@ public: ...@@ -97,6 +98,7 @@ public:
protected: protected:
MeshT* mesh; MeshT* mesh;
int mObjectID;
virtual void visualizeFaceProp(bool _setDrawMode = true); virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true); virtual void visualizeEdgeProp(bool _setDrawMode = true);
......
...@@ -60,7 +60,7 @@ template <typename MeshT> ...@@ -60,7 +60,7 @@ template <typename MeshT>
class OMPropertyVisualizerBoolean: public OMPropertyVisualizer<MeshT>{ class OMPropertyVisualizerBoolean: public OMPropertyVisualizer<MeshT>{
public: public:
OMPropertyVisualizerBoolean(MeshT* _mesh, PropertyInfo _propertyInfo); OMPropertyVisualizerBoolean(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo);
virtual ~OMPropertyVisualizerBoolean(){} virtual ~OMPropertyVisualizerBoolean(){}
protected: protected:
......
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
#include <ACG/Utils/ColorConversion.hh> #include <ACG/Utils/ColorConversion.hh>
template <typename MeshT> template <typename MeshT>
OMPropertyVisualizerBoolean<MeshT>::OMPropertyVisualizerBoolean(MeshT* _mesh, PropertyInfo _propertyInfo) OMPropertyVisualizerBoolean<MeshT>::OMPropertyVisualizerBoolean(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo)
: OMPropertyVisualizer<MeshT>(_mesh, _propertyInfo) : OMPropertyVisualizer<MeshT>(_mesh, _objectID, _propertyInfo)
{ {
if (PropertyVisualizer::widget) delete PropertyVisualizer::widget; if (PropertyVisualizer::widget) delete PropertyVisualizer::widget;
BooleanWidget* w = new BooleanWidget(); BooleanWidget* w = new BooleanWidget();
......
...@@ -65,7 +65,7 @@ template <typename MeshT> ...@@ -65,7 +65,7 @@ template <typename MeshT>
class OMPropertyVisualizerDouble: public OMPropertyVisualizer<MeshT>{ class OMPropertyVisualizerDouble: public OMPropertyVisualizer<MeshT>{
public: public:
OMPropertyVisualizerDouble(MeshT* _mesh, PropertyInfo _propertyInfo); OMPropertyVisualizerDouble(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo);
virtual ~OMPropertyVisualizerDouble(){} virtual ~OMPropertyVisualizerDouble(){}
protected: protected:
......
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
#include "OMPropertyVisualizerDouble.hh" #include "OMPropertyVisualizerDouble.hh"
template <typename MeshT> template <typename MeshT>
OMPropertyVisualizerDouble<MeshT>::OMPropertyVisualizerDouble(MeshT* _mesh, PropertyInfo _propertyInfo) OMPropertyVisualizerDouble<MeshT>::OMPropertyVisualizerDouble(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo)
: OMPropertyVisualizer<MeshT>(_mesh, _propertyInfo) : OMPropertyVisualizer<MeshT>(_mesh, _objectID, _propertyInfo)
{ {
if (PropertyVisualizer::widget) delete PropertyVisualizer::widget; if (PropertyVisualizer::widget) delete PropertyVisualizer::widget;
DoubleWidget* w = new DoubleWidget(); DoubleWidget* w = new DoubleWidget();
......
...@@ -62,7 +62,7 @@ template <typename MeshT, typename T> ...@@ -62,7 +62,7 @@ template <typename MeshT, typename T>
class OMPropertyVisualizerInteger: public OMPropertyVisualizer<MeshT>{ class OMPropertyVisualizerInteger: public OMPropertyVisualizer<MeshT>{
public: public:
OMPropertyVisualizerInteger(MeshT* _mesh, PropertyInfo _propertyInfo, bool isUnsigned); OMPropertyVisualizerInteger(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo, bool isUnsigned);
virtual ~OMPropertyVisualizerInteger(){} virtual ~OMPropertyVisualizerInteger(){}
protected: protected:
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
#include "OMPropertyVisualizerInteger.hh" #include "OMPropertyVisualizerInteger.hh"
template <typename MeshT, typename T> template <typename MeshT, typename T>
OMPropertyVisualizerInteger<MeshT, T>::OMPropertyVisualizerInteger(MeshT* _mesh, PropertyInfo _propertyInfo, bool isUnsigned) OMPropertyVisualizerInteger<MeshT, T>::OMPropertyVisualizerInteger(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo, bool isUnsigned)
: OMPropertyVisualizer<MeshT>(_mesh, _propertyInfo) : OMPropertyVisualizer<MeshT>(_mesh, _objectID, _propertyInfo)
{ {
if (PropertyVisualizer::widget) delete PropertyVisualizer::widget; if (PropertyVisualizer::widget) delete PropertyVisualizer::widget;
IntegerWidget* w = new IntegerWidget(); IntegerWidget* w = new IntegerWidget();
......
...@@ -64,7 +64,7 @@ template <typename MeshT> ...@@ -64,7 +64,7 @@ template <typename MeshT>
class OMPropertyVisualizerSkinWeights: public OMPropertyVisualizer<MeshT>{ class OMPropertyVisualizerSkinWeights: public OMPropertyVisualizer<MeshT>{
public: public:
OMPropertyVisualizerSkinWeights(MeshT* _mesh, PropertyInfo _propertyInfo); OMPropertyVisualizerSkinWeights(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo);
virtual ~OMPropertyVisualizerSkinWeights(){} virtual ~OMPropertyVisualizerSkinWeights(){}
protected: protected:
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
#include "OMPropertyVisualizerSkinWeights.hh" #include "OMPropertyVisualizerSkinWeights.hh"
template <typename MeshT> template <typename MeshT>
OMPropertyVisualizerSkinWeights<MeshT>::OMPropertyVisualizerSkinWeights(MeshT* _mesh, PropertyInfo _propertyInfo) OMPropertyVisualizerSkinWeights<MeshT>::OMPropertyVisualizerSkinWeights(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo)
: OMPropertyVisualizer<MeshT>(_mesh, _propertyInfo) : OMPropertyVisualizer<MeshT>(_mesh, _objectID, _propertyInfo)
{ {
if (PropertyVisualizer::widget) delete PropertyVisualizer::widget; if (PropertyVisualizer::widget) delete PropertyVisualizer::widget;
SkinWeightsWidget* w = new SkinWeightsWidget(); SkinWeightsWidget* w = new SkinWeightsWidget();
......
...@@ -66,7 +66,7 @@ template <typename MeshT> ...@@ -66,7 +66,7 @@ template <typename MeshT>
class OMPropertyVisualizerVector: public OMPropertyVisualizer<MeshT>{ class OMPropertyVisualizerVector: public OMPropertyVisualizer<MeshT>{
public: public:
OMPropertyVisualizerVector(MeshT* _mesh, PropertyInfo _propertyInfo); OMPropertyVisualizerVector(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo);
virtual ~OMPropertyVisualizerVector(){clear();} virtual ~OMPropertyVisualizerVector(){clear();}
virtual void clear(); virtual void clear();
......
...@@ -67,7 +67,7 @@ template <typename MeshT, typename VectorType> ...@@ -67,7 +67,7 @@ template <typename MeshT, typename VectorType>
class OMPropertyVisualizerVector2 : public OMPropertyVisualizer<MeshT>{ class OMPropertyVisualizerVector2 : public OMPropertyVisualizer<MeshT>{
public: public:
OMPropertyVisualizerVector2(MeshT* _mesh, PropertyInfo _propertyInfo); OMPropertyVisualizerVector2(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo);
virtual ~OMPropertyVisualizerVector2(){clear();} virtual ~OMPropertyVisualizerVector2(){clear();}
virtual void clear(); virtual void clear();
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
#include <ACG/Utils/ColorConversion.hh> #include <ACG/Utils/ColorConversion.hh>
template <typename MeshT, typename VectorType> template <typename MeshT, typename VectorType>
OMPropertyVisualizerVector2<MeshT, VectorType>::OMPropertyVisualizerVector2(MeshT* _mesh, PropertyInfo _propertyInfo) OMPropertyVisualizerVector2<MeshT, VectorType>::OMPropertyVisualizerVector2(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo)
: OMPropertyVisualizer<MeshT>(_mesh, _propertyInfo) : OMPropertyVisualizer<MeshT>(_mesh, _objectID, _propertyInfo)
{ {
if (PropertyVisualizer::widget) delete PropertyVisualizer::widget; if (PropertyVisualizer::widget) delete PropertyVisualizer::widget;
VectorWidget* w = new VectorWidget(); VectorWidget* w = new VectorWidget();
......
...@@ -66,7 +66,7 @@ template <typename MeshT> ...@@ -66,7 +66,7 @@ template <typename MeshT>
class OMPropertyVisualizerVectorFieldDifference: public OMPropertyVisualizer<MeshT>{ class OMPropertyVisualizerVectorFieldDifference: public OMPropertyVisualizer<MeshT>{
public: public:
OMPropertyVisualizerVectorFieldDifference(MeshT* _mesh, PropertyInfo _propertyInfo1, PropertyInfo _propertyInfo2); OMPropertyVisualizerVectorFieldDifference(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo1, PropertyInfo _propertyInfo2);
virtual ~OMPropertyVisualizerVectorFieldDifference(){} virtual ~OMPropertyVisualizerVectorFieldDifference(){}
virtual QString getName() { return QObject::tr("Combination of %1 and %2").arg(PropertyVisualizer::propertyInfo.propName().c_str()).arg(propertyInfo2.propName().c_str()); } virtual QString getName() { return QObject::tr("Combination of %1 and %2").arg(PropertyVisualizer::propertyInfo.propName().c_str()).arg(propertyInfo2.propName().c_str()); }
......
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
#include "OMPropertyVisualizerVectorFieldDifference.hh" #include "OMPropertyVisualizerVectorFieldDifference.hh"
template <typename MeshT> template <typename MeshT>
OMPropertyVisualizerVectorFieldDifference<MeshT>::OMPropertyVisualizerVectorFieldDifference(MeshT* _mesh, PropertyInfo _propertyInfo1, PropertyInfo _propertyInfo2) OMPropertyVisualizerVectorFieldDifference<MeshT>::OMPropertyVisualizerVectorFieldDifference(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo1, PropertyInfo _propertyInfo2)
: OMPropertyVisualizer<MeshT>(_mesh, _propertyInfo1), : OMPropertyVisualizer<MeshT>(_mesh, _objectID, _propertyInfo1),
propertyInfo2(_propertyInfo2) propertyInfo2(_propertyInfo2)
{ {
if (PropertyVisualizer::widget) delete PropertyVisualizer::widget; if (PropertyVisualizer::widget) delete PropertyVisualizer::widget;
......
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
#include <ACG/Utils/ColorConversion.hh> #include <ACG/Utils/ColorConversion.hh>
template <typename MeshT> template <typename MeshT>
OMPropertyVisualizerVector<MeshT>::OMPropertyVisualizerVector(MeshT* _mesh, PropertyInfo _propertyInfo) OMPropertyVisualizerVector<MeshT>::OMPropertyVisualizerVector(MeshT* _mesh, int _objectID, PropertyInfo _propertyInfo)
: OMPropertyVisualizer<MeshT>(_mesh, _propertyInfo) : OMPropertyVisualizer<MeshT>(_mesh, _objectID, _propertyInfo)
{ {
if (PropertyVisualizer::widget) delete PropertyVisualizer::widget; if (PropertyVisualizer::widget) delete PropertyVisualizer::widget;
VectorWidget* w = new VectorWidget(); VectorWidget* w = new VectorWidget();
......
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