50 #define OM_PROPERTY_VISUALIZER_DOUBLE_CC
52 #include <ACG/Utils/ColorConversion.hh>
53 #include "OMPropertyVisualizerDouble.hh"
55 template <
typename MeshT>
59 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
61 w->paramDouble->setTitle(QString(
"Double Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
62 PropertyVisualizer::widget = w;
64 this->connect(w->computeHistogramButton, &QPushButton::clicked,
65 [
this, w](){this->template showHistogram<double>(w->histogram);});
68 template <
typename MeshT>
73 typename MeshT::Color colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
85 if ( doubleWidget->doubleAbsolute->isChecked() ){
94 if ( doubleWidget->doubleAbsolute->isChecked() ){
104 if( doubleWidget->doubleFixedRange->isChecked())
106 min = doubleWidget->doubleFixedRangeMin->value();
107 max = doubleWidget->doubleFixedRangeMax->value();
111 doubleWidget->doubleFixedRangeMin->setValue(min);
112 doubleWidget->doubleFixedRangeMax->setValue(max);
115 double range = max - min;
129 if ( doubleWidget->doubleAbsolute->isChecked())
136 double t = (v-min)/range;
148 template <
typename MeshT>
154 colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
167 if ( doubleWidget->doubleAbsolute->isChecked() ){
176 if ( doubleWidget->doubleAbsolute->isChecked() ){
186 if( doubleWidget->doubleFixedRange->isChecked())
188 min = doubleWidget->doubleFixedRangeMin->value();
189 max = doubleWidget->doubleFixedRangeMax->value();
193 doubleWidget->doubleFixedRangeMin->setValue(min);
194 doubleWidget->doubleFixedRangeMax->setValue(max);
198 double range = max - min;
212 if ( doubleWidget->doubleAbsolute->isChecked())
219 double t = (v-min)/range;
232 template <
typename MeshT>
237 typename MeshT::Color colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
250 if ( doubleWidget->doubleAbsolute->isChecked() ){
259 if ( doubleWidget->doubleAbsolute->isChecked() ){
269 if( doubleWidget->doubleFixedRange->isChecked())
271 min = doubleWidget->doubleFixedRangeMin->value();
272 max = doubleWidget->doubleFixedRangeMax->value();
276 doubleWidget->doubleFixedRangeMin->setValue(min);
277 doubleWidget->doubleFixedRangeMax->setValue(max);
280 double range = max - min;
294 if ( doubleWidget->doubleAbsolute->isChecked())
301 double t = (v-min)/range;
312 template <
typename MeshT>
317 typename MeshT::Color colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
330 if ( doubleWidget->doubleAbsolute->isChecked() ){
339 if ( doubleWidget->doubleAbsolute->isChecked() ){
349 if( doubleWidget->doubleFixedRange->isChecked())
351 min = doubleWidget->doubleFixedRangeMin->value();
352 max = doubleWidget->doubleFixedRangeMax->value();
356 doubleWidget->doubleFixedRangeMin->setValue(min);
357 doubleWidget->doubleFixedRangeMax->setValue(max);
360 const double range = max - min;
374 if ( doubleWidget->doubleAbsolute->isChecked())
381 double t = (v-min)/range;
393 template <
typename MeshT>
399 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
400 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
403 typename MeshT::FaceHandle fh = mesh->face_handle(index);
405 mesh->property(prop, fh) = this->strToDouble(text);
408 template <
typename MeshT>
414 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
415 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
418 typename MeshT::EdgeHandle eh = mesh->edge_handle(index);
420 mesh->property(prop, eh) = this->strToDouble(text);
423 template <
typename MeshT>
429 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
430 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
433 typename MeshT::HalfedgeHandle heh = mesh->halfedge_handle(index);
435 mesh->property(prop, heh) = this->strToDouble(text);
438 template <
typename MeshT>
444 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
445 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
448 typename MeshT::VertexHandle vh = mesh->vertex_handle(index);
450 mesh->property(prop, vh) = this->strToDouble(text);
453 template<
typename MeshT>
461 template<
typename MeshT>
467 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)
DrawMode HALFEDGES_COLORED
draw halfedges with colors (without shading)
virtual void duplicateProperty()
Duplicates the property.
Add colors to mesh item (vertices/faces/edges)
std::unique_ptr< ACG::IColorCoder > buildColorCoder()
Builds a color coder according to UI settings.
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