44 #define OM_PROPERTY_VISUALIZER_DOUBLE_CC 46 #include <ACG/Utils/ColorConversion.hh> 47 #include "OMPropertyVisualizerDouble.hh" 49 template <
typename MeshT>
53 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
55 w->paramDouble->setTitle(QString(
"Double Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
56 PropertyVisualizer::widget = w;
58 this->connect(w->computeHistogramButton, &QPushButton::clicked,
59 [
this, w](){this->template showHistogram<double>(w->histogram);});
62 template <
typename MeshT>
67 typename MeshT::Color colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
79 if ( doubleWidget->doubleAbsolute->isChecked() ){
88 if ( doubleWidget->doubleAbsolute->isChecked() ){
98 if( doubleWidget->doubleFixedRange->isChecked())
100 min = doubleWidget->doubleFixedRangeMin->value();
101 max = doubleWidget->doubleFixedRangeMax->value();
105 doubleWidget->doubleFixedRangeMin->setValue(min);
106 doubleWidget->doubleFixedRangeMax->setValue(max);
109 double range = max - min;
123 if ( doubleWidget->doubleAbsolute->isChecked())
126 double t = (v-min)/range;
138 template <
typename MeshT>
144 colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
157 if ( doubleWidget->doubleAbsolute->isChecked() ){
166 if ( doubleWidget->doubleAbsolute->isChecked() ){
176 if( doubleWidget->doubleFixedRange->isChecked())
178 min = doubleWidget->doubleFixedRangeMin->value();
179 max = doubleWidget->doubleFixedRangeMax->value();
183 doubleWidget->doubleFixedRangeMin->setValue(min);
184 doubleWidget->doubleFixedRangeMax->setValue(max);
188 double range = max - min;
202 if ( doubleWidget->doubleAbsolute->isChecked())
205 double t = (v-min)/range;
218 template <
typename MeshT>
223 typename MeshT::Color colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
236 if ( doubleWidget->doubleAbsolute->isChecked() ){
245 if ( doubleWidget->doubleAbsolute->isChecked() ){
255 if( doubleWidget->doubleFixedRange->isChecked())
257 min = doubleWidget->doubleFixedRangeMin->value();
258 max = doubleWidget->doubleFixedRangeMax->value();
262 doubleWidget->doubleFixedRangeMin->setValue(min);
263 doubleWidget->doubleFixedRangeMax->setValue(max);
266 double range = max - min;
280 if ( doubleWidget->doubleAbsolute->isChecked())
283 double t = (v-min)/range;
294 template <
typename MeshT>
299 typename MeshT::Color colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
312 if ( doubleWidget->doubleAbsolute->isChecked() ){
321 if ( doubleWidget->doubleAbsolute->isChecked() ){
331 if( doubleWidget->doubleFixedRange->isChecked())
333 min = doubleWidget->doubleFixedRangeMin->value();
334 max = doubleWidget->doubleFixedRangeMax->value();
338 doubleWidget->doubleFixedRangeMin->setValue(min);
339 doubleWidget->doubleFixedRangeMax->setValue(max);
342 const double range = max - min;
356 if ( doubleWidget->doubleAbsolute->isChecked())
359 double t = (v-min)/range;
371 template <
typename MeshT>
377 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
378 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
381 typename MeshT::FaceHandle fh = mesh->face_handle(index);
383 mesh->property(prop, fh) = this->strToDouble(text);
386 template <
typename MeshT>
392 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
393 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
396 typename MeshT::EdgeHandle eh = mesh->edge_handle(index);
398 mesh->property(prop, eh) = this->strToDouble(text);
401 template <
typename MeshT>
407 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
408 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
411 typename MeshT::HalfedgeHandle heh = mesh->halfedge_handle(index);
413 mesh->property(prop, heh) = this->strToDouble(text);
416 template <
typename MeshT>
422 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
423 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
426 typename MeshT::VertexHandle vh = mesh->vertex_handle(index);
428 mesh->property(prop, vh) = this->strToDouble(text);
431 template<
typename MeshT>
439 template<
typename MeshT>
445 template<
typename MeshT>
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)
void removeProperty() override
Removes the property.
void duplicateProperty() override
Duplicates the property.