50 #define OM_PROPERTY_VISUALIZER_BOOLEAN_CC
52 #include "OMPropertyVisualizerBoolean.hh"
54 template <
typename MeshT>
58 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
60 w->paramBool->setTitle(QString(
"Boolean Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
61 PropertyVisualizer::widget = w;
64 template <
typename MeshT>
70 template <
typename MeshT>
82 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
85 if ( !mesh->has_face_colors() )
88 for (
typename MeshT::FaceIter f_it = mesh->faces_begin() ; f_it != mesh->faces_end() ; ++f_it)
89 if ( mesh->property(prop, *f_it) )
90 mesh->set_color(*f_it, colorTrue);
92 mesh->set_color(*f_it, colorFalse);
99 template <
typename MeshT>
111 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
114 if ( !mesh->has_edge_colors() )
115 mesh->request_edge_colors();
117 for (
typename MeshT::EdgeIter e_it = mesh->edges_begin() ; e_it != mesh->edges_end() ; ++e_it)
118 if ( mesh->property(prop, *e_it) )
119 mesh->set_color(*e_it, colorTrue);
121 mesh->set_color(*e_it, colorFalse);
127 template <
typename MeshT>
139 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
142 if ( ! mesh->has_halfedge_colors() )
143 mesh->request_halfedge_colors();
145 for (
typename MeshT::HalfedgeIter he_it = mesh->halfedges_begin() ; he_it != mesh->halfedges_end() ; ++he_it)
146 if ( mesh->property(prop, *he_it) )
147 mesh->set_color(*he_it, colorTrue);
149 mesh->set_color(*he_it, colorFalse);
156 template <
typename MeshT>
168 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
171 if ( ! mesh->has_vertex_colors() )
172 mesh->request_vertex_colors();
174 for (
typename MeshT::VertexIter v_it = mesh->vertices_begin() ; v_it != mesh->vertices_end() ; ++v_it)
175 if ( mesh->property(prop, *v_it) )
176 mesh->set_color(*v_it, colorTrue);
178 mesh->set_color(*v_it, colorFalse);
185 template <
typename MeshT>
191 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
192 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
195 typename MeshT::FaceHandle fh = mesh->face_handle(index);
197 mesh->property(prop, fh) = this->strToBool(text);
200 template <
typename MeshT>
206 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
207 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
210 typename MeshT::EdgeHandle eh = mesh->edge_handle(index);
212 mesh->property(prop, eh) = this->strToBool(text);
215 template <
typename MeshT>
221 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
222 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
225 typename MeshT::HalfedgeHandle heh = mesh->halfedge_handle(index);
227 mesh->property(prop, heh) = this->strToBool(text);
230 template <
typename MeshT>
236 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
237 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
240 typename MeshT::VertexHandle vh = mesh->vertex_handle(index);
242 mesh->property(prop, vh) = this->strToBool(text);
245 template<
typename MeshT>
251 template<
typename MeshT>
Add colors to mesh item (vertices/faces/edges)
DrawMode EDGES_COLORED
draw edges with colors (without shading)
virtual void removeProperty()
Removes the property.
void setDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, int _viewer)
Set the draw Mode of a Viewer. .
virtual QString getPropertyText(unsigned int index)
Returns the value of a property in text form.
DrawMode SOLID_POINTS_COLORED
draw colored, but not lighted faces using interpolated vertex colors
DrawMode SOLID_FACES_COLORED
draw colored, but not lighted faces using face colors
virtual void duplicateProperty()
Duplicates the property.
Cellection of information about a property.
DrawMode HALFEDGES_COLORED
draw halfedges with colors (without shading)