Commit bfb765d8 authored by Max Lyon's avatar Max Lyon

after updatedObject is emitted with UpdateType UPDATE_ALL or UPDATE_GEOMETRY...

after updatedObject is emitted with UpdateType UPDATE_ALL or UPDATE_GEOMETRY the property visualizer revisualizes all currently visualized properties.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16775 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4840c378
......@@ -213,7 +213,7 @@ bool OMPropertyModel<MeshT>::combinable(PropertyVisualizer* propertyVisualizer1,
template<typename MeshT>
void OMPropertyModel<MeshT>::saveProperty()
{
for (QModelIndexList::const_iterator it = currentIndices.begin(), it_end = currentIndices.end();
for (QModelIndexList::const_iterator it = currentlySelectedIndices.begin(), it_end = currentlySelectedIndices.end();
it != it_end; ++it) {
PropertyModel::saveProperty(it->row());
}
......@@ -390,7 +390,7 @@ void OMPropertyModel<MeshT>::mouseEvent(QMouseEvent* _event)
if (object->id() == objectID_)
{
OMPropertyVisualizer<MeshT>* viz = (OMPropertyVisualizer<MeshT>*) propertyVisualizers[currentIndices.first().row()];
OMPropertyVisualizer<MeshT>* viz = (OMPropertyVisualizer<MeshT>*) propertyVisualizers[currentlySelectedIndices.first().row()];
unsigned int primitiveId = viz->getClosestPrimitiveId(face_idx, hit_point);
mPickWidget.pickedHandle->setText(tr("%1").arg(primitiveId));
mPickWidget.pickedValue->setText(viz->getPropertyText(primitiveId));
......
......@@ -63,7 +63,7 @@ public:
/// Visualizes the property.
virtual void visualize();
virtual void visualize(bool _setDrawMode = true);
/**
* @brief Removes the property.
......@@ -91,10 +91,10 @@ public:
protected:
MeshT* mesh;
virtual void visualizeFaceProp();
virtual void visualizeEdgeProp();
virtual void visualizeHalfedgeProp();
virtual void visualizeVertexProp();
virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true);
virtual void visualizeHalfedgeProp(bool _setDrawMode = true);
virtual void visualizeVertexProp(bool _setDrawMode = true);
template <typename PropType>
void removeProperty_stage1();
......
......@@ -58,10 +58,10 @@ public:
protected:
virtual void visualizeFaceProp();
virtual void visualizeEdgeProp();
virtual void visualizeHalfedgeProp();
virtual void visualizeVertexProp();
virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true);
virtual void visualizeHalfedgeProp(bool _setDrawMode = true);
virtual void visualizeVertexProp(bool _setDrawMode = true);
virtual void removeProperty();
virtual void duplicateProperty();
......
......@@ -61,7 +61,7 @@ QString OMPropertyVisualizerBoolean<MeshT>::getPropertyText(unsigned int index)
}
template <typename MeshT>
void OMPropertyVisualizerBoolean<MeshT>::visualizeFaceProp()
void OMPropertyVisualizerBoolean<MeshT>::visualizeFaceProp(bool _setDrawMode)
{
BooleanWidget* booleanWidget = static_cast<BooleanWidget*>(PropertyVisualizer::widget);
MeshT* mesh = OMPropertyVisualizer<MeshT>::mesh;
......@@ -84,12 +84,13 @@ void OMPropertyVisualizerBoolean<MeshT>::visualizeFaceProp()
else
mesh->set_color(f_it, colorFalse);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerBoolean<MeshT>::visualizeEdgeProp()
void OMPropertyVisualizerBoolean<MeshT>::visualizeEdgeProp(bool _setDrawMode)
{
BooleanWidget* booleanWidget = static_cast<BooleanWidget*>(PropertyVisualizer::widget);
MeshT* mesh = OMPropertyVisualizer<MeshT>::mesh;
......@@ -112,11 +113,12 @@ void OMPropertyVisualizerBoolean<MeshT>::visualizeEdgeProp()
else
mesh->set_color(e_it, colorFalse);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerBoolean<MeshT>::visualizeHalfedgeProp()
void OMPropertyVisualizerBoolean<MeshT>::visualizeHalfedgeProp(bool _setDrawMode)
{
BooleanWidget* booleanWidget = static_cast<BooleanWidget*>(PropertyVisualizer::widget);
MeshT* mesh = OMPropertyVisualizer<MeshT>::mesh;
......@@ -139,12 +141,13 @@ void OMPropertyVisualizerBoolean<MeshT>::visualizeHalfedgeProp()
else
mesh->set_color(he_it, colorFalse);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerBoolean<MeshT>::visualizeVertexProp()
void OMPropertyVisualizerBoolean<MeshT>::visualizeVertexProp(bool _setDrawMode)
{
BooleanWidget* booleanWidget = static_cast<BooleanWidget*>(PropertyVisualizer::widget);
MeshT* mesh = OMPropertyVisualizer<MeshT>::mesh;
......@@ -167,7 +170,8 @@ void OMPropertyVisualizerBoolean<MeshT>::visualizeVertexProp()
else
mesh->set_color(v_it, colorFalse);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
}
......
......@@ -64,10 +64,10 @@ public:
protected:
virtual void visualizeFaceProp();
virtual void visualizeEdgeProp();
virtual void visualizeHalfedgeProp();
virtual void visualizeVertexProp();
virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true);
virtual void visualizeHalfedgeProp(bool _setDrawMode = true);
virtual void visualizeVertexProp(bool _setDrawMode = true);
virtual void removeProperty();
virtual void duplicateProperty();
......
......@@ -55,7 +55,7 @@ OMPropertyVisualizerDouble<MeshT>::OMPropertyVisualizerDouble(MeshT* _mesh, Prop
}
template <typename MeshT>
void OMPropertyVisualizerDouble<MeshT>::visualizeFaceProp()
void OMPropertyVisualizerDouble<MeshT>::visualizeFaceProp(bool _setDrawMode)
{
DoubleWidget* doubleWidget = static_cast<DoubleWidget*>(PropertyVisualizer::widget);
typename MeshT::Color colorMin, colorMax;
......@@ -138,11 +138,12 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeFaceProp()
}
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerDouble<MeshT>::visualizeEdgeProp()
void OMPropertyVisualizerDouble<MeshT>::visualizeEdgeProp(bool _setDrawMode)
{
DoubleWidget* doubleWidget = static_cast<DoubleWidget*>(PropertyVisualizer::widget);
typename MeshT::Color colorMin, colorMax;
......@@ -229,12 +230,14 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeEdgeProp()
}
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerDouble<MeshT>::visualizeHalfedgeProp()
void OMPropertyVisualizerDouble<MeshT>::visualizeHalfedgeProp(bool _setDrawMode)
{
DoubleWidget* doubleWidget = static_cast<DoubleWidget*>(PropertyVisualizer::widget);
typename MeshT::Color colorMin, colorMax;
......@@ -319,11 +322,12 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeHalfedgeProp()
OMPropertyVisualizer<MeshT>::mesh->set_color(he_it, color);
}
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerDouble<MeshT>::visualizeVertexProp()
void OMPropertyVisualizerDouble<MeshT>::visualizeVertexProp(bool _setDrawMode)
{
DoubleWidget* doubleWidget = static_cast<DoubleWidget*>(PropertyVisualizer::widget);
typename MeshT::Color colorMin, colorMax;
......@@ -408,7 +412,8 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeVertexProp()
}
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
}
template <typename MeshT>
......
......@@ -60,10 +60,10 @@ public:
protected:
virtual void visualizeFaceProp();
virtual void visualizeEdgeProp();
virtual void visualizeHalfedgeProp();
virtual void visualizeVertexProp();
virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true);
virtual void visualizeHalfedgeProp(bool _setDrawMode = true);
virtual void visualizeVertexProp(bool _setDrawMode = true);
virtual void removeProperty();
virtual void duplicateProperty();
......
......@@ -67,7 +67,7 @@ QString OMPropertyVisualizerInteger<MeshT, T>::getPropertyText(unsigned int inde
}
template <typename MeshT, typename T>
void OMPropertyVisualizerInteger<MeshT, T>::visualizeFaceProp()
void OMPropertyVisualizerInteger<MeshT, T>::visualizeFaceProp(bool _setDrawMode)
{
IntegerWidget* integerWidget = static_cast<IntegerWidget*>(PropertyVisualizer::widget);
typename MeshT::Color colorMin, colorMax;
......@@ -152,11 +152,12 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeFaceProp()
}
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
}
template <typename MeshT, typename T>
void OMPropertyVisualizerInteger<MeshT, T>::visualizeEdgeProp()
void OMPropertyVisualizerInteger<MeshT, T>::visualizeEdgeProp(bool _setDrawMode)
{
IntegerWidget* integerWidget = static_cast<IntegerWidget*>(PropertyVisualizer::widget);
typename MeshT::Color colorMin, colorMax;
......@@ -241,12 +242,13 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeEdgeProp()
}
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
}
template <typename MeshT, typename T>
void OMPropertyVisualizerInteger<MeshT, T>::visualizeHalfedgeProp()
void OMPropertyVisualizerInteger<MeshT, T>::visualizeHalfedgeProp(bool _setDrawMode)
{
IntegerWidget* integerWidget = static_cast<IntegerWidget*>(PropertyVisualizer::widget);
typename MeshT::Color colorMin, colorMax;
......@@ -331,11 +333,12 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeHalfedgeProp()
}
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
}
template <typename MeshT, typename T>
void OMPropertyVisualizerInteger<MeshT, T>::visualizeVertexProp()
void OMPropertyVisualizerInteger<MeshT, T>::visualizeVertexProp(bool _setDrawMode)
{
IntegerWidget* integerWidget = static_cast<IntegerWidget*>(PropertyVisualizer::widget);
typename MeshT::Color colorMin, colorMax;
......@@ -422,7 +425,8 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeVertexProp()
}
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
}
......
......@@ -62,10 +62,10 @@ public:
protected:
virtual void visualizeFaceProp();
virtual void visualizeEdgeProp();
virtual void visualizeHalfedgeProp();
virtual void visualizeVertexProp();
virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true);
virtual void visualizeHalfedgeProp(bool _setDrawMode = true);
virtual void visualizeVertexProp(bool _setDrawMode = true);
QString getPropertyText(unsigned int index);
......
......@@ -64,25 +64,25 @@ QString OMPropertyVisualizerSkinWeights<MeshT>::getPropertyText(unsigned int ind
}
template <typename MeshT>
void OMPropertyVisualizerSkinWeights<MeshT>::visualizeFaceProp()
void OMPropertyVisualizerSkinWeights<MeshT>::visualizeFaceProp(bool /*_setDrawMode*/)
{
OMPropertyVisualizer<MeshT>::log("Visualizing SkinWeights for faces not supported.");
}
template <typename MeshT>
void OMPropertyVisualizerSkinWeights<MeshT>::visualizeEdgeProp()
void OMPropertyVisualizerSkinWeights<MeshT>::visualizeEdgeProp(bool /*_setDrawMode*/)
{
OMPropertyVisualizer<MeshT>::log("Visualizing SkinWeights for edges not supported.");
}
template <typename MeshT>
void OMPropertyVisualizerSkinWeights<MeshT>::visualizeHalfedgeProp()
void OMPropertyVisualizerSkinWeights<MeshT>::visualizeHalfedgeProp(bool /*_setDrawMode*/)
{
OMPropertyVisualizer<MeshT>::log("Visualizing SkinWeights for halfedges not supported.");
}
template <typename MeshT>
void OMPropertyVisualizerSkinWeights<MeshT>::visualizeVertexProp()
void OMPropertyVisualizerSkinWeights<MeshT>::visualizeVertexProp(bool _setDrawMode)
{
SkinWeightsWidget* skinWeightsWidget = static_cast<SkinWeightsWidget*>(PropertyVisualizer::widget);
......@@ -111,7 +111,8 @@ void OMPropertyVisualizerSkinWeights<MeshT>::visualizeVertexProp()
OMPropertyVisualizer<MeshT>::mesh->set_color(v_it, color);
}
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
}
template<typename MeshT>
......
......@@ -301,16 +301,16 @@ unsigned int OMPropertyVisualizer<MeshT>::getClosestVertexId(unsigned int _face,
* type of the property.
*/
template <typename MeshT>
void OMPropertyVisualizer<MeshT>::visualize()
void OMPropertyVisualizer<MeshT>::visualize(bool _setDrawMode)
{
if (propertyInfo.isFaceProp())
visualizeFaceProp();
visualizeFaceProp(_setDrawMode);
else if (propertyInfo.isEdgeProp())
visualizeEdgeProp();
visualizeEdgeProp(_setDrawMode);
else if (propertyInfo.isHalfedgeProp())
visualizeHalfedgeProp();
visualizeHalfedgeProp(_setDrawMode);
else if (propertyInfo.isVertexProp())
visualizeVertexProp();
visualizeVertexProp(_setDrawMode);
}
/**
......@@ -348,25 +348,25 @@ OpenMesh::Vec4f OMPropertyVisualizer<MeshT>::convertColor(const QColor _color){
}
template <typename MeshT>
void OMPropertyVisualizer<MeshT>::visualizeFaceProp()
void OMPropertyVisualizer<MeshT>::visualizeFaceProp(bool /*_setDrawMode*/)
{
emit log(LOGERR, "Visualizing FaceProp not implemented");
}
template <typename MeshT>
void OMPropertyVisualizer<MeshT>::visualizeEdgeProp()
void OMPropertyVisualizer<MeshT>::visualizeEdgeProp(bool /*_setDrawMode*/)
{
emit log(LOGERR, "Visualizing EdgeProp not implemented");
}
template <typename MeshT>
void OMPropertyVisualizer<MeshT>::visualizeHalfedgeProp()
void OMPropertyVisualizer<MeshT>::visualizeHalfedgeProp(bool /*_setDrawMode*/)
{
emit log(LOGERR, "Visualizing HalfedgeProp not implemented");
}
template <typename MeshT>
void OMPropertyVisualizer<MeshT>::visualizeVertexProp()
void OMPropertyVisualizer<MeshT>::visualizeVertexProp(bool /*_setDrawMode*/)
{
emit log(LOGERR, "Visualizing VertexProp not implemented");
}
......
......@@ -66,10 +66,10 @@ public:
protected:
virtual void visualizeFaceProp();
virtual void visualizeEdgeProp();
virtual void visualizeHalfedgeProp();
virtual void visualizeVertexProp();
virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true);
virtual void visualizeHalfedgeProp(bool _setDrawMode = true);
virtual void visualizeVertexProp(bool _setDrawMode = true);
virtual void visualizeFacePropOnEdges();
......
......@@ -67,10 +67,10 @@ public:
protected:
virtual void visualizeFaceProp();
virtual void visualizeEdgeProp();
virtual void visualizeHalfedgeProp();
virtual void visualizeVertexProp();
virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true);
virtual void visualizeHalfedgeProp(bool _setDrawMode = true);
virtual void visualizeVertexProp(bool _setDrawMode = true);
virtual void removeProperty(){} //no need to delete a property
virtual void duplciateProperty(){ emit OMPropertyVisualizer<MeshT>::log("combined properties cannot be duplicated");}
......
......@@ -158,7 +158,7 @@ void colorElements(MeshT *mesh, const PropertyInfo &p1,
}
template <typename MeshT>
void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeFaceProp()
void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeFaceProp(bool _setDrawMode)
{
MeshT* mesh = OMPropertyVisualizer<MeshT>::mesh;
const PropertyInfo p1 = PropertyVisualizer::propertyInfo;
......@@ -174,11 +174,12 @@ void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeFaceProp()
if (w->vecFieldDiff_norm_diff_rb->isChecked())
OMPVVFD::colorElements<MeshT, typename MeshT::FaceIter, OpenMesh::FPropHandleT<typename MeshT::Point>, OMPVVFD::scalarFn_norm_of_diff<MeshT> >(mesh, p1, p2, mesh->faces_begin(), mesh->faces_end());
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeEdgeProp()
void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeEdgeProp(bool _setDrawMode)
{
MeshT* mesh = OMPropertyVisualizer<MeshT>::mesh;
const PropertyInfo p1 = PropertyVisualizer::propertyInfo;
......@@ -194,11 +195,12 @@ void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeEdgeProp()
if (w->vecFieldDiff_norm_diff_rb->isChecked())
OMPVVFD::colorElements<MeshT, typename MeshT::EdgeIter, OpenMesh::EPropHandleT<typename MeshT::Point>, OMPVVFD::scalarFn_norm_of_diff<MeshT> >(mesh, p1, p2, mesh->edges_begin(), mesh->edges_end());
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeHalfedgeProp()
void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeHalfedgeProp(bool _setDrawMode)
{
MeshT* mesh = OMPropertyVisualizer<MeshT>::mesh;
const PropertyInfo p1 = PropertyVisualizer::propertyInfo;
......@@ -214,11 +216,12 @@ void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeHalfedgeProp()
if (w->vecFieldDiff_norm_diff_rb->isChecked())
OMPVVFD::colorElements<MeshT, typename MeshT::HalfedgeIter, OpenMesh::HPropHandleT<typename MeshT::Point>, OMPVVFD::scalarFn_norm_of_diff<MeshT> >(mesh, p1, p2, mesh->halfedges_begin(), mesh->halfedges_end());
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
}
template <typename MeshT>
void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeVertexProp()
void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeVertexProp(bool _setDrawMode)
{
MeshT* mesh = OMPropertyVisualizer<MeshT>::mesh;
const PropertyInfo p1 = PropertyVisualizer::propertyInfo;
......@@ -234,5 +237,6 @@ void OMPropertyVisualizerVectorFieldDifference<MeshT>::visualizeVertexProp()
if (w->vecFieldDiff_norm_diff_rb->isChecked())
OMPVVFD::colorElements<MeshT, typename MeshT::VertexIter, OpenMesh::VPropHandleT<typename MeshT::Point>, OMPVVFD::scalarFn_norm_of_diff<MeshT> >(mesh, p1, p2, mesh->vertices_begin(), mesh->vertices_end());
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
}
......@@ -93,7 +93,7 @@ void visualizeVectorAsColorForEntity(MeshT *mesh, const ENTITY_IT e_begin, const
}
template <typename MeshT>
void OMPropertyVisualizerVector<MeshT>::visualizeFaceProp()
void OMPropertyVisualizerVector<MeshT>::visualizeFaceProp(bool _setDrawMode)
{
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_edges_rb->isChecked()) visualizeFacePropOnEdges();
......@@ -106,13 +106,14 @@ void OMPropertyVisualizerVector<MeshT>::visualizeFaceProp()
OMPropertyVisualizer<MeshT>::mesh->faces_begin(),
OMPropertyVisualizer<MeshT>::mesh->faces_end(),
PropertyVisualizer::propertyInfo);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED);
}
else visualizeFacePropAsStrokes();
}
template <typename MeshT>
void OMPropertyVisualizerVector<MeshT>::visualizeEdgeProp()
void OMPropertyVisualizerVector<MeshT>::visualizeEdgeProp(bool _setDrawMode)
{
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked())
......@@ -123,13 +124,14 @@ void OMPropertyVisualizerVector<MeshT>::visualizeEdgeProp()
if ( !mesh->has_edge_colors() )
mesh->request_edge_colors();
visualizeVectorAsColorForEntity<OpenMesh::EPropHandleT<typename MeshT::Point> >(mesh,mesh->edges_begin(),mesh->edges_end(), PropertyVisualizer::propertyInfo);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::EDGES_COLORED);
}
else visualizeEdgePropAsStrokes();
}
template <typename MeshT>
void OMPropertyVisualizerVector<MeshT>::visualizeHalfedgeProp()
void OMPropertyVisualizerVector<MeshT>::visualizeHalfedgeProp(bool _setDrawMode)
{
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked())
......@@ -140,13 +142,15 @@ void OMPropertyVisualizerVector<MeshT>::visualizeHalfedgeProp()
if ( ! mesh->has_halfedge_colors() )
mesh->request_halfedge_colors();
visualizeVectorAsColorForEntity<OpenMesh::HPropHandleT<typename MeshT::Point> >(mesh,mesh->halfedges_begin(),mesh->halfedges_end(),PropertyVisualizer::propertyInfo);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::HALFEDGES_COLORED);
}
else visualizeHalfedgePropAsStrokes();
}
template <typename MeshT>
void OMPropertyVisualizerVector<MeshT>::visualizeVertexProp()
void OMPropertyVisualizerVector<MeshT>::visualizeVertexProp(bool _setDrawMode)
{
VectorWidget* w = (VectorWidget*)PropertyVisualizer::widget;
if (w->vectors_colors_rb->isChecked())
......@@ -158,7 +162,8 @@ void OMPropertyVisualizerVector<MeshT>::visualizeVertexProp()
OMPropertyVisualizer<MeshT>::mesh->vertices_begin(),
OMPropertyVisualizer<MeshT>::mesh->vertices_end(),
PropertyVisualizer::propertyInfo);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
if (_setDrawMode)
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
}
else visualizeVertexPropAsStrokes();
}
......
......@@ -180,7 +180,7 @@ template <typename MeshT>
void OVMPropertyModel<MeshT>::mouseEvent(QMouseEvent* _event)
{
if (!pickModeActive) return;
if (currentIndices.size() < 1) return;
if (currentlySelectedIndices.size() < 1) return;
if (_event->type() == QEvent::MouseButtonPress)
{
......@@ -188,7 +188,7 @@ void OVMPropertyModel<MeshT>::mouseEvent(QMouseEvent* _event)
ACG::Vec3d hit_point;
OVMPropertyVisualizer<MeshT>* viz = (OVMPropertyVisualizer<MeshT>*) propertyVisualizers[currentIndices.first().row()];
OVMPropertyVisualizer<MeshT>* viz = (OVMPropertyVisualizer<MeshT>*) propertyVisualizers[currentlySelectedIndices.first().row()];
unsigned int entityId = 0;
ACG::SceneGraph::PickTarget pickTarget;
......@@ -383,7 +383,7 @@ void OVMPropertyModel<MeshT>::combine()
template<typename MeshT>
void OVMPropertyModel<MeshT>::saveProperty()
{
for (QModelIndexList::const_iterator it = currentIndices.begin(), it_end = currentIndices.end();
for (QModelIndexList::const_iterator it = currentlySelectedIndices.begin(), it_end = currentlySelectedIndices.end();
it != it_end; ++it) {
PropertyModel::saveProperty(it->row());
}
......
......@@ -69,7 +69,7 @@ public:
virtual ~OVMPropertyVisualizer(){ clear(); }
/// Visualizes a property.
virtual void visualize();
virtual void visualize(bool _setDrawMode = true);
/**
* @brief Should remove the property.
......@@ -93,12 +93,12 @@ public:
protected:
MeshT* mesh;
virtual void visualizeFaceProp();
virtual void visualizeEdgeProp();
virtual void visualizeHalfedgeProp();
virtual void visualizeVertexProp();
virtual void visualizeCellProp();
virtual void visualizeHalffaceProp();
virtual void visualizeFaceProp(bool _setDrawMode = true);
virtual void visualizeEdgeProp(bool _setDrawMode = true);
virtual void visualizeHalfedgeProp(bool _setDrawMode = true);
virtual void visualizeVertexProp(bool _setDrawMode = true);
virtual void visualizeCellProp(bool _setDrawMode = true);
virtual void visualizeHalffaceProp(bool _setDrawMode = true);
template<typename PropType>
void duplicateProperty_stage1();
......@@ -155,58 +155,76 @@ private:
#define CALLS_TO_VISUALIZE_PROP(Classname, Template, PropType) \
template <Template> \
void Classname::visualizeCellProp() \
void Classname::visualizeCellProp(bool _setDrawMode) \
{\
OpenVolumeMesh::CellPropertyT<PropType> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_cell_property<PropType>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());\
visualizeProp(prop, OVMPropertyVisualizer<MeshT>::mesh->cells_begin(), OVMPropertyVisualizer<MeshT>::mesh->cells_end());\
VolumeMeshObject<MeshT>* object;\
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);\
object->setObjectDrawMode(OVMPropertyVisualizer<MeshT>::drawModes.cellsColoredPerCell);\
if (_setDrawMode)\
{\
VolumeMeshObject<MeshT>* object;\
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);\
object->setObjectDrawMode(OVMPropertyVisualizer<MeshT>::drawModes.cellsColoredPerCell);\
}\
}\
template <Template>\
void Classname::visualizeFaceProp()\
void Classname::visualizeFaceProp(bool _setDrawMode)\
{\
OpenVolumeMesh::FacePropertyT<PropType> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_face_property<PropType>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());\
visualizeProp(prop, OVMPropertyVisualizer<MeshT>::mesh->faces_begin(), OVMPropertyVisualizer<MeshT>::mesh->faces_end());\
VolumeMeshObject<MeshT>* object;\
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);\
object->setObjectDrawMode(OVMPropertyVisualizer<MeshT>::drawModes.facesColoredPerFace);\
if (_setDrawMode)\
{\
VolumeMeshObject<MeshT>* object;\
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);\
object->setObjectDrawMode(OVMPropertyVisualizer<MeshT>::drawModes.facesColoredPerFace);\
}\
}\
template <Template>\
void Classname::visualizeHalffaceProp()\
void Classname::visualizeHalffaceProp(bool _setDrawMode)\
{\
OpenVolumeMesh::HalfFacePropertyT<PropType> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_halfface_property<PropType>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());\
visualizeProp(prop, OVMPropertyVisualizer<MeshT>::mesh->halffaces_begin(), OVMPropertyVisualizer<MeshT>::mesh->halffaces_end());\
VolumeMeshObject<MeshT>* object;\
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);\
object->setObjectDrawMode(OVMPropertyVisualizer<MeshT>::drawModes.halffacesColoredPerHalfface);\
if (_setDrawMode)\
{\
VolumeMeshObject<MeshT>* object;\
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);\
object->setObjectDrawMode(OVMPropertyVisualizer<MeshT>::drawModes.halffacesColoredPerHalfface);\
}\
}\
template <Template>\
void Classname::visualizeEdgeProp()\
void Classname::visualizeEdgeProp(bool _setDrawMode)\
{\
OpenVolumeMesh::EdgePropertyT<PropType> prop = OVMPropertyVisualizer<MeshT>::mesh->template request_edge_property<PropType>(OVMPropertyVisualizer<MeshT>::propertyInfo.propName());\
visualizeProp(prop, OVMPropertyVisualizer<MeshT>::mesh->edges_begin(), OVMPropertyVisualizer<MeshT>::mesh->edges_end());\
VolumeMeshObject<MeshT>* object;\
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);\
object->setObjectDrawMode(OVMPropertyVisualizer<MeshT>::drawModes.edgesColoredPerEdge);\
if (_setDrawMode)\
{\
VolumeMeshObject<MeshT>* object;\
PluginFunctions::getObject(OVMPropertyVisualizer<MeshT>::mObjectID, object);\
object->setObjectDrawMode(OVMPropertyVisualizer<MeshT>::drawModes.edgesColoredPerEdge);\
}\
}\
template <Template>\