Commit 5a9f7311 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'OVMVec3dSupport' into 'master'

added support for OVM::Vec3d

See merge request !23
parents cc155c62 8b675e2b
...@@ -101,10 +101,14 @@ public: ...@@ -101,10 +101,14 @@ public:
static bool isUnsignedIntType(const TypeInfoWrapper& typeInfo); static bool isUnsignedIntType(const TypeInfoWrapper& typeInfo);
static bool isVec3dType(const PropertyInfo& propInfo); static bool isVec3dType(const PropertyInfo& propInfo);
static bool isVec3dType(const TypeInfoWrapper& typeInfo); static bool isVec3dType(const TypeInfoWrapper& typeInfo);
static bool isVec3dOVMType(const PropertyInfo& propInfo);
static bool isVec3dOVMType(const TypeInfoWrapper& typeInfo);
static bool isVec3fType(const PropertyInfo& propInfo); static bool isVec3fType(const PropertyInfo& propInfo);
static bool isVec3fType(const TypeInfoWrapper& typeInfo); static bool isVec3fType(const TypeInfoWrapper& typeInfo);
static bool isVectorType(const PropertyInfo& propInfo); static bool isVectorType(const PropertyInfo& propInfo);
static bool isVectorType(const TypeInfoWrapper& typeInfo); static bool isVectorType(const TypeInfoWrapper& typeInfo);
static bool isVectorOVMType(const PropertyInfo& propInfo);
static bool isVectorOVMType(const TypeInfoWrapper& typeInfo);
static bool isMatrix3x3Type(const PropertyInfo& propInfo); static bool isMatrix3x3Type(const PropertyInfo& propInfo);
static bool isMatrix3x3Type(const TypeInfoWrapper& typeInfo); static bool isMatrix3x3Type(const TypeInfoWrapper& typeInfo);
...@@ -114,6 +118,7 @@ public: ...@@ -114,6 +118,7 @@ public:
static const TypeInfoWrapper proptype_##primitive##_uint; \ static const TypeInfoWrapper proptype_##primitive##_uint; \
static const TypeInfoWrapper proptype_##primitive##_double; \ static const TypeInfoWrapper proptype_##primitive##_double; \
static const TypeInfoWrapper proptype_##primitive##_Vec3d; \ static const TypeInfoWrapper proptype_##primitive##_Vec3d; \
static const TypeInfoWrapper proptype_##primitive##_Vec3dOVM; \
static const TypeInfoWrapper proptype_##primitive##_Vec3f; \ static const TypeInfoWrapper proptype_##primitive##_Vec3f; \
static const TypeInfoWrapper proptype_##primitive##_Matrix3x3d; static const TypeInfoWrapper proptype_##primitive##_Matrix3x3d;
...@@ -209,6 +214,8 @@ template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##prim ...@@ -209,6 +214,8 @@ template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##prim
= TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<double>), "double"); \ = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<double>), "double"); \
template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3d \ template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3d \
= TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Vec3d>), "Vec3d"); \ = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Vec3d>), "Vec3d"); \
template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3dOVM \
= TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<OpenVolumeMesh::Vec3d>), "Vec3dOVM"); \
template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3f \ template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3f \
= TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Vec3f>), "Vec3f"); \ = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Vec3f>), "Vec3f"); \
template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Matrix3x3d \ template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Matrix3x3d \
......
...@@ -458,7 +458,7 @@ bool OVMPropertyModel<MeshT>::isSupported(OpenVolumeMesh::BaseProperty* const ba ...@@ -458,7 +458,7 @@ bool OVMPropertyModel<MeshT>::isSupported(OpenVolumeMesh::BaseProperty* const ba
* @return True if the property type can be visualized, False if not. * @return True if the property type can be visualized, False if not.
* *
* Currently supported are the types "bool", "int", "unsigned int", "double", "Vec3d" * Currently supported are the types "bool", "int", "unsigned int", "double", "Vec3d"
* and "Vec3f" * "Vec3dOVM" and "Vec3f"
*/ */
template<typename MeshT> template<typename MeshT>
bool OVMPropertyModel<MeshT>::isSupported(QString friendlyName) const bool OVMPropertyModel<MeshT>::isSupported(QString friendlyName) const
...@@ -622,6 +622,23 @@ bool OVMPropertyModel<MeshT>::isVec3dType(const TypeInfoWrapper& typeInfo) ...@@ -622,6 +622,23 @@ bool OVMPropertyModel<MeshT>::isVec3dType(const TypeInfoWrapper& typeInfo)
typeInfo == proptype_Vertex_Vec3d; typeInfo == proptype_Vertex_Vec3d;
} }
template<typename MeshT>
bool OVMPropertyModel<MeshT>::isVec3dOVMType(const PropertyInfo& propInfo)
{
return isVec3dOVMType(propInfo.typeinfo());
}
template<typename MeshT>
bool OVMPropertyModel<MeshT>::isVec3dOVMType(const TypeInfoWrapper& typeInfo)
{
return typeInfo == proptype_Cell_Vec3dOVM ||
typeInfo == proptype_Face_Vec3dOVM ||
typeInfo == proptype_HalfFace_Vec3dOVM ||
typeInfo == proptype_Edge_Vec3dOVM ||
typeInfo == proptype_HalfEdge_Vec3dOVM ||
typeInfo == proptype_Vertex_Vec3dOVM;
}
template<typename MeshT> template<typename MeshT>
bool OVMPropertyModel<MeshT>::isVec3fType(const PropertyInfo& propInfo) bool OVMPropertyModel<MeshT>::isVec3fType(const PropertyInfo& propInfo)
{ {
...@@ -642,7 +659,7 @@ bool OVMPropertyModel<MeshT>::isVec3fType(const TypeInfoWrapper& typeInfo) ...@@ -642,7 +659,7 @@ bool OVMPropertyModel<MeshT>::isVec3fType(const TypeInfoWrapper& typeInfo)
template<typename MeshT> template<typename MeshT>
bool OVMPropertyModel<MeshT>::isVectorType(const PropertyInfo& propInfo) bool OVMPropertyModel<MeshT>::isVectorType(const PropertyInfo& propInfo)
{ {
return isVec3fType(propInfo) || isVec3dType(propInfo); return isVec3fType(propInfo) || isVec3dType(propInfo) ;
} }
template<typename MeshT> template<typename MeshT>
...@@ -651,6 +668,18 @@ bool OVMPropertyModel<MeshT>::isVectorType(const TypeInfoWrapper& typeInfo) ...@@ -651,6 +668,18 @@ bool OVMPropertyModel<MeshT>::isVectorType(const TypeInfoWrapper& typeInfo)
return isVec3fType(typeInfo) || isVec3dType(typeInfo); return isVec3fType(typeInfo) || isVec3dType(typeInfo);
} }
template<typename MeshT>
bool OVMPropertyModel<MeshT>::isVectorOVMType(const PropertyInfo& propInfo)
{
return isVec3dOVMType(propInfo) ;
}
template<typename MeshT>
bool OVMPropertyModel<MeshT>::isVectorOVMType(const TypeInfoWrapper& typeInfo)
{
return isVec3dOVMType(typeInfo);
}
template<typename MeshT> template<typename MeshT>
bool OVMPropertyModel<MeshT>::isMatrix3x3Type(const PropertyInfo& propInfo) bool OVMPropertyModel<MeshT>::isMatrix3x3Type(const PropertyInfo& propInfo)
{ {
...@@ -679,6 +708,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop ...@@ -679,6 +708,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop
|| (typeInfo == proptype_Cell_double) || (typeInfo == proptype_Cell_double)
|| (typeInfo == proptype_Cell_uint) || (typeInfo == proptype_Cell_uint)
|| (typeInfo == proptype_Cell_Vec3d) || (typeInfo == proptype_Cell_Vec3d)
|| (typeInfo == proptype_Cell_Vec3dOVM)
|| (typeInfo == proptype_Cell_Vec3f); || (typeInfo == proptype_Cell_Vec3f);
} }
if (entity_type & PropertyInfo::EF_FACE) if (entity_type & PropertyInfo::EF_FACE)
...@@ -688,6 +718,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop ...@@ -688,6 +718,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop
|| (typeInfo == proptype_Face_double) || (typeInfo == proptype_Face_double)
|| (typeInfo == proptype_Face_uint) || (typeInfo == proptype_Face_uint)
|| (typeInfo == proptype_Face_Vec3d) || (typeInfo == proptype_Face_Vec3d)
|| (typeInfo == proptype_Face_Vec3dOVM)
|| (typeInfo == proptype_Face_Vec3f); || (typeInfo == proptype_Face_Vec3f);
} }
if (entity_type & PropertyInfo::EF_HALFFACE) if (entity_type & PropertyInfo::EF_HALFFACE)
...@@ -697,6 +728,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop ...@@ -697,6 +728,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop
|| (typeInfo == proptype_HalfFace_double) || (typeInfo == proptype_HalfFace_double)
|| (typeInfo == proptype_HalfFace_uint) || (typeInfo == proptype_HalfFace_uint)
|| (typeInfo == proptype_HalfFace_Vec3d) || (typeInfo == proptype_HalfFace_Vec3d)
|| (typeInfo == proptype_HalfFace_Vec3dOVM)
|| (typeInfo == proptype_HalfFace_Vec3f); || (typeInfo == proptype_HalfFace_Vec3f);
} }
if (entity_type & PropertyInfo::EF_EDGE) if (entity_type & PropertyInfo::EF_EDGE)
...@@ -706,6 +738,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop ...@@ -706,6 +738,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop
|| (typeInfo == proptype_Edge_double) || (typeInfo == proptype_Edge_double)
|| (typeInfo == proptype_Edge_uint) || (typeInfo == proptype_Edge_uint)
|| (typeInfo == proptype_Edge_Vec3d) || (typeInfo == proptype_Edge_Vec3d)
|| (typeInfo == proptype_Edge_Vec3dOVM)
|| (typeInfo == proptype_Edge_Vec3f); || (typeInfo == proptype_Edge_Vec3f);
} }
if (entity_type & PropertyInfo::EF_HALFEDGE) if (entity_type & PropertyInfo::EF_HALFEDGE)
...@@ -715,6 +748,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop ...@@ -715,6 +748,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop
|| (typeInfo == proptype_HalfEdge_double) || (typeInfo == proptype_HalfEdge_double)
|| (typeInfo == proptype_HalfEdge_uint) || (typeInfo == proptype_HalfEdge_uint)
|| (typeInfo == proptype_HalfEdge_Vec3d) || (typeInfo == proptype_HalfEdge_Vec3d)
|| (typeInfo == proptype_HalfEdge_Vec3dOVM)
|| (typeInfo == proptype_HalfEdge_Vec3f); || (typeInfo == proptype_HalfEdge_Vec3f);
} }
if (entity_type & PropertyInfo::EF_VERTEX) if (entity_type & PropertyInfo::EF_VERTEX)
...@@ -724,6 +758,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop ...@@ -724,6 +758,7 @@ bool OVMPropertyModel<MeshT>::isEntityType(const TypeInfoWrapper& typeInfo, Prop
|| (typeInfo == proptype_Vertex_double) || (typeInfo == proptype_Vertex_double)
|| (typeInfo == proptype_Vertex_uint) || (typeInfo == proptype_Vertex_uint)
|| (typeInfo == proptype_Vertex_Vec3d) || (typeInfo == proptype_Vertex_Vec3d)
|| (typeInfo == proptype_Vertex_Vec3dOVM)
|| (typeInfo == proptype_Vertex_Vec3f); || (typeInfo == proptype_Vertex_Vec3f);
} }
return result; return result;
...@@ -753,7 +788,9 @@ void OVMPropertyModel<MeshT>::addPropertyVisualizer(OpenVolumeMesh::BaseProperty ...@@ -753,7 +788,9 @@ void OVMPropertyModel<MeshT>::addPropertyVisualizer(OpenVolumeMesh::BaseProperty
else if (isDoubleType(propInfo)) else if (isDoubleType(propInfo))
propertyVisualizers.push_back(new OVMPropertyVisualizerDouble<MeshT>(mesh, objectID_, propInfo)); propertyVisualizers.push_back(new OVMPropertyVisualizerDouble<MeshT>(mesh, objectID_, propInfo));
else if (isVectorType(propInfo)) else if (isVectorType(propInfo))
propertyVisualizers.push_back(new OVMPropertyVisualizerVector<MeshT>(mesh, objectID_, propInfo)); propertyVisualizers.push_back(new OVMPropertyVisualizerVector<MeshT, ACG::Vec3d>(mesh, objectID_, propInfo));
else if (isVectorOVMType(propInfo))
propertyVisualizers.push_back(new OVMPropertyVisualizerVector<MeshT, OpenVolumeMesh::Vec3d>(mesh, objectID_, propInfo));
else if (isMatrix3x3Type(propInfo)) else if (isMatrix3x3Type(propInfo))
propertyVisualizers.push_back(new OVMPropertyVisualizerMatrix3x3<MeshT>(mesh, objectID_, propInfo)); propertyVisualizers.push_back(new OVMPropertyVisualizerMatrix3x3<MeshT>(mesh, objectID_, propInfo));
connectLogs(propertyVisualizers.back()); connectLogs(propertyVisualizers.back());
...@@ -959,6 +996,7 @@ supportedPropertyTypes.insert(proptype_##primitive##_int); \ ...@@ -959,6 +996,7 @@ supportedPropertyTypes.insert(proptype_##primitive##_int); \
supportedPropertyTypes.insert(proptype_##primitive##_uint); \ supportedPropertyTypes.insert(proptype_##primitive##_uint); \
supportedPropertyTypes.insert(proptype_##primitive##_double); \ supportedPropertyTypes.insert(proptype_##primitive##_double); \
supportedPropertyTypes.insert(proptype_##primitive##_Vec3d); \ supportedPropertyTypes.insert(proptype_##primitive##_Vec3d); \
supportedPropertyTypes.insert(proptype_##primitive##_Vec3dOVM); \
supportedPropertyTypes.insert(proptype_##primitive##_Vec3f); \ supportedPropertyTypes.insert(proptype_##primitive##_Vec3f); \
supportedPropertyTypes.insert(proptype_##primitive##_Matrix3x3d); \ supportedPropertyTypes.insert(proptype_##primitive##_Matrix3x3d); \
...@@ -969,7 +1007,7 @@ supportedPropertyTypes.insert(proptype_##primitive##_Matrix3x3d); \ ...@@ -969,7 +1007,7 @@ supportedPropertyTypes.insert(proptype_##primitive##_Matrix3x3d); \
INSERT_PROPTYPES(HalfEdge) INSERT_PROPTYPES(HalfEdge)
INSERT_PROPTYPES(Vertex) INSERT_PROPTYPES(Vertex)
#undef INITIALIZE_PROPTYPES #undef INSERT_PROPTYPES
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include <iostream> #include <iostream>
template <typename MeshT> template <typename MeshT, typename VectorT>
class OVMPropertyVisualizerVector: public OVMPropertyVisualizer<MeshT>{ class OVMPropertyVisualizerVector: public OVMPropertyVisualizer<MeshT>{
public: public:
...@@ -94,6 +94,8 @@ protected: ...@@ -94,6 +94,8 @@ protected:
void setHalfedgePropertyFromText(unsigned int index, QString text) override; void setHalfedgePropertyFromText(unsigned int index, QString text) override;
void setVertexPropertyFromText(unsigned int index, QString text) override; void setVertexPropertyFromText(unsigned int index, QString text) override;
inline ACG::Vec3d convert_to_acg(const VectorT& _v) { return ACG::Vec3d(_v[0], _v[1], _v[2]);}
ACG::SceneGraph::LineNode* lineNode; ACG::SceneGraph::LineNode* lineNode;
}; };
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
#include "OVMPropertyVisualizerVector.hh" #include "OVMPropertyVisualizerVector.hh"
template <typename MeshT> template <typename MeshT, typename VectorT>
OVMPropertyVisualizerVector<MeshT>::OVMPropertyVisualizerVector(MeshT* _mesh, int objectID, PropertyInfo _propertyInfo) OVMPropertyVisualizerVector<MeshT,VectorT>::OVMPropertyVisualizerVector(MeshT* _mesh, int objectID, PropertyInfo _propertyInfo)
: OVMPropertyVisualizer<MeshT>(_mesh, objectID, _propertyInfo) : OVMPropertyVisualizer<MeshT>(_mesh, objectID, _propertyInfo)
{ {
if (PropertyVisualizer::widget) delete PropertyVisualizer::widget; if (PropertyVisualizer::widget) delete PropertyVisualizer::widget;
...@@ -65,28 +65,28 @@ OVMPropertyVisualizerVector<MeshT>::OVMPropertyVisualizerVector(MeshT* _mesh, in ...@@ -65,28 +65,28 @@ OVMPropertyVisualizerVector<MeshT>::OVMPropertyVisualizerVector(MeshT* _mesh, in
[this](double value) {lineNode->set_line_width(value);}); [this](double value) {lineNode->set_line_width(value);});
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::clear() void OVMPropertyVisualizerVector<MeshT,VectorT>::clear()
{ {
lineNode->clear(); lineNode->clear();
OVMPropertyVisualizer<MeshT>::clear(); OVMPropertyVisualizer<MeshT>::clear();
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::duplicateProperty() void OVMPropertyVisualizerVector<MeshT,VectorT>::duplicateProperty()
{ {
OVMPropertyVisualizer<MeshT>::template duplicateProperty_stage1<ACG::Vec3d>(); OVMPropertyVisualizer<MeshT>::template duplicateProperty_stage1<VectorT>();
} }
template<typename MeshT> template<typename MeshT, typename VectorT>
template<typename PropType, typename EntityIterator> template<typename PropType, typename EntityIterator>
void OVMPropertyVisualizerVector<MeshT>::visualizeVectorAsColorForEntity(PropType prop, EntityIterator e_begin, EntityIterator e_end, bool normalized) { void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeVectorAsColorForEntity(PropType prop, EntityIterator e_begin, EntityIterator e_end, bool normalized) {
if (!prop) if (!prop)
throw VizException("Getting PropHandle from mesh for selected property failed."); throw VizException("Getting PropHandle from mesh for selected property failed.");
VolumeMeshObject<MeshT>* object; VolumeMeshObject<MeshT>* object;
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object); PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);
for (EntityIterator e_it = e_begin; e_it != e_end; ++e_it) { for (EntityIterator e_it = e_begin; e_it != e_end; ++e_it) {
ACG::Vec3d v = prop[*e_it]; ACG::Vec3d v = convert_to_acg(prop[*e_it]);
if (normalized) if (normalized)
v = v.normalized() * 0.5 + ACG::Vec3d(0.5); v = v.normalized() * 0.5 + ACG::Vec3d(0.5);
else else
...@@ -95,13 +95,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeVectorAsColorForEntity(PropTyp ...@@ -95,13 +95,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeVectorAsColorForEntity(PropTyp
} }
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeCellProp(bool _setDrawMode) void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeCellProp(bool _setDrawMode)
{ {
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget; VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked()) if (w->vectors_colors_rb->isChecked())
{ {
OpenVolumeMesh::CellPropertyT<ACG::Vec3d> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_cell_property<ACG::Vec3d>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName()); OpenVolumeMesh::CellPropertyT<VectorT> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_cell_property<VectorT>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());
visualizeVectorAsColorForEntity(prop, visualizeVectorAsColorForEntity(prop,
OVMPropertyVisualizer<MeshT>::mesh->cells_begin(), OVMPropertyVisualizer<MeshT>::mesh->cells_begin(),
OVMPropertyVisualizer<MeshT>::mesh->cells_end(), OVMPropertyVisualizer<MeshT>::mesh->cells_end(),
...@@ -116,13 +116,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeCellProp(bool _setDrawMode) ...@@ -116,13 +116,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeCellProp(bool _setDrawMode)
else visualizeCellPropAsStrokes(); else visualizeCellPropAsStrokes();
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeFaceProp(bool _setDrawMode) void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeFaceProp(bool _setDrawMode)
{ {
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget; VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked()) if (w->vectors_colors_rb->isChecked())
{ {
OpenVolumeMesh::FacePropertyT<ACG::Vec3d> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_face_property<ACG::Vec3d>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName()); OpenVolumeMesh::FacePropertyT<VectorT> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_face_property<VectorT>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());
visualizeVectorAsColorForEntity(prop, visualizeVectorAsColorForEntity(prop,
OVMPropertyVisualizer<MeshT>::mesh->faces_begin(), OVMPropertyVisualizer<MeshT>::mesh->faces_begin(),
OVMPropertyVisualizer<MeshT>::mesh->faces_end(), OVMPropertyVisualizer<MeshT>::mesh->faces_end(),
...@@ -138,13 +138,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFaceProp(bool _setDrawMode) ...@@ -138,13 +138,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFaceProp(bool _setDrawMode)
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeHalffaceProp(bool _setDrawMode) void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeHalffaceProp(bool _setDrawMode)
{ {
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget; VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked()) if (w->vectors_colors_rb->isChecked())
{ {
OpenVolumeMesh::HalfFacePropertyT<ACG::Vec3d> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_halfface_property<ACG::Vec3d>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName()); OpenVolumeMesh::HalfFacePropertyT<VectorT> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_halfface_property<VectorT>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());
visualizeVectorAsColorForEntity(prop, visualizeVectorAsColorForEntity(prop,
OVMPropertyVisualizer<MeshT>::mesh->halffaces_begin(), OVMPropertyVisualizer<MeshT>::mesh->halffaces_begin(),
OVMPropertyVisualizer<MeshT>::mesh->halffaces_end(), OVMPropertyVisualizer<MeshT>::mesh->halffaces_end(),
...@@ -159,13 +159,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeHalffaceProp(bool _setDrawMode ...@@ -159,13 +159,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeHalffaceProp(bool _setDrawMode
else visualizeHalffacePropAsStrokes(); else visualizeHalffacePropAsStrokes();
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeEdgeProp(bool _setDrawMode) void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeEdgeProp(bool _setDrawMode)
{ {
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget; VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked()) if (w->vectors_colors_rb->isChecked())
{ {
OpenVolumeMesh::EdgePropertyT<ACG::Vec3d> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_edge_property<ACG::Vec3d>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName()); OpenVolumeMesh::EdgePropertyT<VectorT> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_edge_property<VectorT>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());
visualizeVectorAsColorForEntity(prop, visualizeVectorAsColorForEntity(prop,
OVMPropertyVisualizer<MeshT>::mesh->edges_begin(), OVMPropertyVisualizer<MeshT>::mesh->edges_begin(),
OVMPropertyVisualizer<MeshT>::mesh->edges_end(), OVMPropertyVisualizer<MeshT>::mesh->edges_end(),
...@@ -180,13 +180,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgeProp(bool _setDrawMode) ...@@ -180,13 +180,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgeProp(bool _setDrawMode)
else visualizeEdgePropAsStrokes(); else visualizeEdgePropAsStrokes();
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeHalfedgeProp(bool _setDrawMode) void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeHalfedgeProp(bool _setDrawMode)
{ {
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget; VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked()) if (w->vectors_colors_rb->isChecked())
{ {
OpenVolumeMesh::HalfEdgePropertyT<ACG::Vec3d> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_halfedge_property<ACG::Vec3d>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName()); OpenVolumeMesh::HalfEdgePropertyT<VectorT> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_halfedge_property<VectorT>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());
visualizeVectorAsColorForEntity(prop, visualizeVectorAsColorForEntity(prop,
OVMPropertyVisualizer<MeshT>::mesh->halfedges_begin(), OVMPropertyVisualizer<MeshT>::mesh->halfedges_begin(),
OVMPropertyVisualizer<MeshT>::mesh->halfedges_end(), OVMPropertyVisualizer<MeshT>::mesh->halfedges_end(),
...@@ -201,13 +201,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeHalfedgeProp(bool _setDrawMode ...@@ -201,13 +201,13 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeHalfedgeProp(bool _setDrawMode
else visualizeHalfedgePropAsStrokes(); else visualizeHalfedgePropAsStrokes();
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeVertexProp(bool _setDrawMode) void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeVertexProp(bool _setDrawMode)
{ {
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget; VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked()) if (w->vectors_colors_rb->isChecked())
{ {
OpenVolumeMesh::VertexPropertyT<ACG::Vec3d> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_vertex_property<ACG::Vec3d>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName()); OpenVolumeMesh::VertexPropertyT<VectorT> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_vertex_property<VectorT>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());
visualizeVectorAsColorForEntity(prop, visualizeVectorAsColorForEntity(prop,
OVMPropertyVisualizer<MeshT>::mesh->vertices_begin(), OVMPropertyVisualizer<MeshT>::mesh->vertices_begin(),
OVMPropertyVisualizer<MeshT>::mesh->vertices_end(), OVMPropertyVisualizer<MeshT>::mesh->vertices_end(),
...@@ -222,8 +222,8 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeVertexProp(bool _setDrawMode) ...@@ -222,8 +222,8 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeVertexProp(bool _setDrawMode)
else visualizeVertexPropAsStrokes(); else visualizeVertexPropAsStrokes();
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeFacePropAsStrokes() void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeFacePropAsStrokes()
{ {
VectorWidget* vectorWidget = static_cast<VectorWidget*>(PropertyVisualizer::widget); VectorWidget* vectorWidget = static_cast<VectorWidget*>(PropertyVisualizer::widget);
...@@ -231,7 +231,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFacePropAsStrokes() ...@@ -231,7 +231,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFacePropAsStrokes()
ACG::Vec4f color = ACG::to_Vec4f(vectorWidget->lineColor->color()); ACG::Vec4f color = ACG::to_Vec4f(vectorWidget->lineColor->color());
OpenVolumeMesh::FacePropertyT<ACG::Vec3d> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_face_property<ACG::Vec3d>(PropertyVisualizer::propertyInfo.propName()); OpenVolumeMesh::FacePropertyT<VectorT> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_face_property<VectorT>(PropertyVisualizer::propertyInfo.propName());
if ( !prop ) if ( !prop )
return; return;
...@@ -250,7 +250,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFacePropAsStrokes() ...@@ -250,7 +250,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFacePropAsStrokes()
center /= vCount; center /= vCount;
ACG::Vec3d v = prop[*f_it]; ACG::Vec3d v = convert_to_acg(prop[*f_it]);
if (vectorWidget->normalize->isChecked() && v.sqrnorm() > 1e-12) if (vectorWidget->normalize->isChecked() && v.sqrnorm() > 1e-12)
v.normalize(); v.normalize();
...@@ -263,8 +263,8 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFacePropAsStrokes() ...@@ -263,8 +263,8 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFacePropAsStrokes()
} }
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes() void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeEdgePropAsStrokes()
{ {
VectorWidget* vectorWidget = static_cast<VectorWidget*>(PropertyVisualizer::widget); VectorWidget* vectorWidget = static_cast<VectorWidget*>(PropertyVisualizer::widget);
...@@ -272,7 +272,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes() ...@@ -272,7 +272,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes()
ACG::Vec4f color = ACG::to_Vec4f(vectorWidget->lineColor->color()); ACG::Vec4f color = ACG::to_Vec4f(vectorWidget->lineColor->color());
OpenVolumeMesh::EdgePropertyT<ACG::Vec3d> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_edge_property<ACG::Vec3d>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName()); OpenVolumeMesh::EdgePropertyT<VectorT> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_edge_property<VectorT>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());
if ( !prop ) if ( !prop )
return; return;
...@@ -284,7 +284,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes() ...@@ -284,7 +284,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes()
ACG::Vec3d v2 = OVMPropertyVisualizer<MeshT>::mesh->vertex(edge.to_vertex()); ACG::Vec3d v2 = OVMPropertyVisualizer<MeshT>::mesh->vertex(edge.to_vertex());
ACG::Vec3d start = 0.5*(v1+v2); ACG::Vec3d start = 0.5*(v1+v2);
ACG::Vec3d v = prop[*e_it]; ACG::Vec3d v = convert_to_acg(prop[*e_it]);
if (vectorWidget->normalize->isChecked() && v.sqrnorm() > 1e-12) if (vectorWidget->normalize->isChecked() && v.sqrnorm() > 1e-12)
v.normalize(); v.normalize();
...@@ -299,8 +299,8 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes() ...@@ -299,8 +299,8 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes()
} }
} }
template <typename MeshT> template <typename MeshT, typename VectorT>
void OVMPropertyVisualizerVector<MeshT>::visualizeHalfedgePropAsStrokes() void OVMPropertyVisualizerVector<MeshT,VectorT>::visualizeHalfedgePropAsStrokes()
{ {
VectorWidget* vectorWidget = static_cast<VectorWidget*>(PropertyVisualizer::widget);