44 #define OVM_PROPERTY_VISUALIZER_DOUBLE_CC 46 #include "OVMPropertyVisualizerDouble.hh" 48 #include <ACG/Utils/IColorCoder.hh> 49 #include <ACG/Utils/LinearTwoColorCoder.hh> 50 #include <ACG/Utils/ColorConversion.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;
63 this->connect(w->computeHistogramButton, &QPushButton::clicked,
64 [
this, w](){this->template showHistogram<double>(w->histogram);});
68 template <
typename MeshT>
69 template <
typename PropType,
typename EntityIterator>
75 ACG::Vec4f colorMin = ACG::to_Vec4f(doubleWidget->doubleMin->color());
80 if ( doubleWidget->doubleAbsolute->isChecked() ){
88 for (EntityIterator e_it = e_begin; e_it != e_end; ++e_it){
89 double value = prop[*e_it];
90 if ( doubleWidget->doubleAbsolute->isChecked() ){
91 min = std::min( min, fabs(value));
92 max = std::max( max, fabs(value));
94 min = std::min( min, value);
95 max = std::max( max, value);
100 if( doubleWidget->doubleFixedRange->isChecked())
102 min = doubleWidget->doubleFixedRangeMin->value();
103 max = doubleWidget->doubleFixedRangeMax->value();
107 doubleWidget->doubleFixedRangeMin->setValue(min);
108 doubleWidget->doubleFixedRangeMax->setValue(max);
111 const double range = max - min;
115 for (EntityIterator e_it = e_begin; e_it != e_end; ++e_it){
118 object->colors()[*e_it] = colorMin;
121 double value = prop[*e_it];
124 if ( doubleWidget->doubleAbsolute->isChecked())
127 double t = (value-min)/range;
128 object->colors()[*e_it] = cc->color_float4(t);
134 template <
typename MeshT>
140 template <
typename MeshT>
146 template <
typename MeshT>
154 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
160 prop[ch] = this->strToDouble(text);
163 template <
typename MeshT>
171 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
177 prop[fh] = this->strToDouble(text);
180 template <
typename MeshT>
188 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
194 prop[hfh] = this->strToDouble(text);
197 template <
typename MeshT>
205 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
211 prop[eh] = this->strToDouble(text);
214 template <
typename MeshT>
222 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
228 prop[heh] = this->strToDouble(text);
231 template <
typename MeshT>
239 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
245 prop[vh] = this->strToDouble(text);
248 template <
typename MeshT>
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
Cellection of information about a property.
QString getPropertyText(unsigned int index) override
Returns the value of a property in text form.
void duplicateProperty() override
Duplicates a property.