44 #define OM_PROPERTY_VISUALIZER_BOOLEAN_CC 46 #include "OMPropertyVisualizerBoolean.hh" 47 #include <ACG/Utils/ColorConversion.hh> 49 template <
typename MeshT>
53 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
55 w->paramBool->setTitle(QString(
"Boolean Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
56 PropertyVisualizer::widget = w;
59 template <
typename MeshT>
65 template <
typename MeshT>
72 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
73 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
77 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
80 if ( !mesh->has_face_colors() )
83 for (
typename MeshT::FaceIter f_it = mesh->faces_begin() ; f_it != mesh->faces_end() ; ++f_it)
84 if ( mesh->property(prop, *f_it) )
85 mesh->set_color(*f_it, colorTrue);
87 mesh->set_color(*f_it, colorFalse);
94 template <
typename MeshT>
101 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
102 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
106 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
109 if ( !mesh->has_edge_colors() )
110 mesh->request_edge_colors();
112 for (
typename MeshT::EdgeIter e_it = mesh->edges_begin() ; e_it != mesh->edges_end() ; ++e_it)
113 if ( mesh->property(prop, *e_it) )
114 mesh->set_color(*e_it, colorTrue);
116 mesh->set_color(*e_it, colorFalse);
122 template <
typename MeshT>
129 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
130 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
134 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
137 if ( ! mesh->has_halfedge_colors() )
138 mesh->request_halfedge_colors();
140 for (
typename MeshT::HalfedgeIter he_it = mesh->halfedges_begin() ; he_it != mesh->halfedges_end() ; ++he_it)
141 if ( mesh->property(prop, *he_it) )
142 mesh->set_color(*he_it, colorTrue);
144 mesh->set_color(*he_it, colorFalse);
151 template <
typename MeshT>
158 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
159 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
163 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
166 if ( ! mesh->has_vertex_colors() )
167 mesh->request_vertex_colors();
169 for (
typename MeshT::VertexIter v_it = mesh->vertices_begin() ; v_it != mesh->vertices_end() ; ++v_it)
170 if ( mesh->property(prop, *v_it) )
171 mesh->set_color(*v_it, colorTrue);
173 mesh->set_color(*v_it, colorFalse);
180 template <
typename MeshT>
186 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
187 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
190 typename MeshT::FaceHandle fh = mesh->face_handle(index);
192 mesh->property(prop, fh) = this->strToBool(text);
195 template <
typename MeshT>
201 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
202 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
205 typename MeshT::EdgeHandle eh = mesh->edge_handle(index);
207 mesh->property(prop, eh) = this->strToBool(text);
210 template <
typename MeshT>
216 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
217 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
220 typename MeshT::HalfedgeHandle heh = mesh->halfedge_handle(index);
222 mesh->property(prop, heh) = this->strToBool(text);
225 template <
typename MeshT>
231 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
232 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
235 typename MeshT::VertexHandle vh = mesh->vertex_handle(index);
237 mesh->property(prop, vh) = this->strToBool(text);
240 template<
typename MeshT>
246 template<
typename MeshT>
void duplicateProperty() override
Duplicates the property.
QString getPropertyText(unsigned int index) override
Returns the value of a property in text form.
void removeProperty() override
Removes the property.
Add colors to mesh item (vertices/faces/edges)
DrawMode HALFEDGES_COLORED
draw halfedges with colors (without shading)
DrawMode SOLID_POINTS_COLORED
draw colored, but not lighted faces using interpolated vertex colors
Cellection of information about a property.
DrawMode SOLID_FACES_COLORED
draw colored, but not lighted faces using face colors
DrawMode EDGES_COLORED
draw edges with colors (without shading)