50 #define OM_PROPERTY_VISUALIZER_DOUBLE_CC 52 #include "OMPropertyVisualizerDouble.hh" 54 template <
typename MeshT>
58 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
60 w->paramDouble->setTitle(QString(
"Double Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
61 PropertyVisualizer::widget = w;
64 template <
typename MeshT>
83 if ( doubleWidget->doubleAbsolute->isChecked() ){
92 if ( doubleWidget->doubleAbsolute->isChecked() ){
102 if( doubleWidget->doubleFixedRange->isChecked())
104 min = doubleWidget->doubleFixedRangeMin->value();
105 max = doubleWidget->doubleFixedRangeMax->value();
109 doubleWidget->doubleFixedRangeMin->setValue(min);
110 doubleWidget->doubleFixedRangeMax->setValue(max);
113 double range = max - min;
127 if ( doubleWidget->doubleAbsolute->isChecked())
134 double t = (v-min)/range;
138 if( doubleWidget->doubleColorCoder->isChecked())
139 color = cc.color_float4(t);
141 color = (colorMin)*(1.0-t) + (colorMax)*t;
152 template <
typename MeshT>
174 if ( doubleWidget->doubleAbsolute->isChecked() ){
183 if ( doubleWidget->doubleAbsolute->isChecked() ){
193 if( doubleWidget->doubleFixedRange->isChecked())
195 min = doubleWidget->doubleFixedRangeMin->value();
196 max = doubleWidget->doubleFixedRangeMax->value();
200 doubleWidget->doubleFixedRangeMin->setValue(min);
201 doubleWidget->doubleFixedRangeMax->setValue(max);
205 double range = max - min;
219 if ( doubleWidget->doubleAbsolute->isChecked())
226 double t = (v-min)/range;
230 if( doubleWidget->doubleColorCoder->isChecked())
231 color = cc.color_float4(t);
233 color = (colorMin)*(1.0-t) + (colorMax)*t;
246 template <
typename MeshT>
267 if ( doubleWidget->doubleAbsolute->isChecked() ){
276 if ( doubleWidget->doubleAbsolute->isChecked() ){
286 if( doubleWidget->doubleFixedRange->isChecked())
288 min = doubleWidget->doubleFixedRangeMin->value();
289 max = doubleWidget->doubleFixedRangeMax->value();
293 doubleWidget->doubleFixedRangeMin->setValue(min);
294 doubleWidget->doubleFixedRangeMax->setValue(max);
297 double range = max - min;
311 if ( doubleWidget->doubleAbsolute->isChecked())
318 double t = (v-min)/range;
322 if( doubleWidget->doubleColorCoder->isChecked())
323 color = cc.color_float4(t);
325 color = (colorMin)*(1.0-t) + (colorMax)*t;
336 template <
typename MeshT>
356 if ( doubleWidget->doubleAbsolute->isChecked() ){
365 if ( doubleWidget->doubleAbsolute->isChecked() ){
375 if( doubleWidget->doubleFixedRange->isChecked())
377 min = doubleWidget->doubleFixedRangeMin->value();
378 max = doubleWidget->doubleFixedRangeMax->value();
382 doubleWidget->doubleFixedRangeMin->setValue(min);
383 doubleWidget->doubleFixedRangeMax->setValue(max);
386 const double range = max - min;
400 if ( doubleWidget->doubleAbsolute->isChecked())
407 double t = (v-min)/range;
411 if( doubleWidget->doubleColorCoder->isChecked())
412 color = cc.color_float4(t);
414 color = (colorMin)*(1.0-t) + (colorMax)*t;
426 template <
typename MeshT>
432 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
433 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
436 typename MeshT::FaceHandle fh = mesh->face_handle(index);
438 mesh->property(prop, fh) = this->strToDouble(text);
441 template <
typename MeshT>
447 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
448 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
451 typename MeshT::EdgeHandle eh = mesh->edge_handle(index);
453 mesh->property(prop, eh) = this->strToDouble(text);
456 template <
typename MeshT>
462 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
463 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
466 typename MeshT::HalfedgeHandle heh = mesh->halfedge_handle(index);
468 mesh->property(prop, heh) = this->strToDouble(text);
471 template <
typename MeshT>
477 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
478 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
481 typename MeshT::VertexHandle vh = mesh->vertex_handle(index);
483 mesh->property(prop, vh) = this->strToDouble(text);
487 template<
typename MeshT>
493 template<
typename MeshT>
virtual void removeProperty()
Removes the property.
Cellection of information about a property.
DrawMode HALFEDGES_COLORED
draw halfedges with colors (without shading)
DrawMode SOLID_FACES_COLORED
draw colored, but not lighted faces using face colors
virtual void duplicateProperty()
Duplicates the property.
DrawMode EDGES_COLORED
draw edges with colors (without shading)
Add colors to mesh item (vertices/faces/edges)
DrawMode SOLID_POINTS_COLORED
draw colored, but not lighted faces using interpolated vertex colors
Class for generating nice colors for doubles.
void setDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, int _viewer)
Set the draw Mode of a Viewer. .