50 #define OM_PROPERTY_VISUALIZER_BOOLEAN_CC
52 #include "OMPropertyVisualizerBoolean.hh"
53 #include <ACG/Utils/ColorConversion.hh>
55 template <
typename MeshT>
59 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
61 w->paramBool->setTitle(QString(
"Boolean Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
62 PropertyVisualizer::widget = w;
65 template <
typename MeshT>
71 template <
typename MeshT>
78 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
79 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
83 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
86 if ( !mesh->has_face_colors() )
89 for (
typename MeshT::FaceIter f_it = mesh->faces_begin() ; f_it != mesh->faces_end() ; ++f_it)
90 if ( mesh->property(prop, *f_it) )
91 mesh->set_color(*f_it, colorTrue);
93 mesh->set_color(*f_it, colorFalse);
100 template <
typename MeshT>
107 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
108 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
112 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
115 if ( !mesh->has_edge_colors() )
116 mesh->request_edge_colors();
118 for (
typename MeshT::EdgeIter e_it = mesh->edges_begin() ; e_it != mesh->edges_end() ; ++e_it)
119 if ( mesh->property(prop, *e_it) )
120 mesh->set_color(*e_it, colorTrue);
122 mesh->set_color(*e_it, colorFalse);
128 template <
typename MeshT>
135 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
136 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
140 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
143 if ( ! mesh->has_halfedge_colors() )
144 mesh->request_halfedge_colors();
146 for (
typename MeshT::HalfedgeIter he_it = mesh->halfedges_begin() ; he_it != mesh->halfedges_end() ; ++he_it)
147 if ( mesh->property(prop, *he_it) )
148 mesh->set_color(*he_it, colorTrue);
150 mesh->set_color(*he_it, colorFalse);
157 template <
typename MeshT>
164 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
165 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
169 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
172 if ( ! mesh->has_vertex_colors() )
173 mesh->request_vertex_colors();
175 for (
typename MeshT::VertexIter v_it = mesh->vertices_begin() ; v_it != mesh->vertices_end() ; ++v_it)
176 if ( mesh->property(prop, *v_it) )
177 mesh->set_color(*v_it, colorTrue);
179 mesh->set_color(*v_it, colorFalse);
186 template <
typename MeshT>
192 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
193 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
196 typename MeshT::FaceHandle fh = mesh->face_handle(index);
198 mesh->property(prop, fh) = this->strToBool(text);
201 template <
typename MeshT>
207 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
208 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
211 typename MeshT::EdgeHandle eh = mesh->edge_handle(index);
213 mesh->property(prop, eh) = this->strToBool(text);
216 template <
typename MeshT>
222 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
223 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
226 typename MeshT::HalfedgeHandle heh = mesh->halfedge_handle(index);
228 mesh->property(prop, heh) = this->strToBool(text);
231 template <
typename MeshT>
237 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
238 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
241 typename MeshT::VertexHandle vh = mesh->vertex_handle(index);
243 mesh->property(prop, vh) = this->strToBool(text);
246 template<
typename MeshT>
252 template<
typename MeshT>
void setDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, int _viewer)
Set the draw Mode of a Viewer. .
DrawMode SOLID_POINTS_COLORED
draw colored, but not lighted faces using interpolated vertex colors
DrawMode EDGES_COLORED
draw edges with colors (without shading)
virtual QString getPropertyText(unsigned int index)
Returns the value of a property in text form.
DrawMode HALFEDGES_COLORED
draw halfedges with colors (without shading)
virtual void duplicateProperty()
Duplicates the property.
Add colors to mesh item (vertices/faces/edges)
virtual void removeProperty()
Removes the property.
Cellection of information about a property.
DrawMode SOLID_FACES_COLORED
draw colored, but not lighted faces using face colors