::max();
+ for( int i = 0; i < Quad3DTrendModelFittingAuxDefs::N_PARAMS; i++)
+ if( std::abs(mag_term[i]) > absmax ) absmax = std::abs(mag_term[i]);
+
+ //a lambda to automatize the generation of HTML to display a background color proportional to the magnitude of each model term
+ //if sign_value is negative, then value is converted to -value before retrieving the color form the color table.
+ auto lambdaMakeBGColor = [absmax](double value, double sign_value){
+ if( sign_value >= 0 )
+ return " bgcolor='" + Util::getHTMLColorFromValue( std::abs(value), ColorTable::SEISMIC, -absmax, absmax ) + "'";
+ else
+ return " bgcolor='" + Util::getHTMLColorFromValue( -std::abs(value), ColorTable::SEISMIC, -absmax, absmax ) + "'";
+ };
+
+ //a lambda to automatize the generation of HTML to render text in a contrasting color with respect to the background color
+ // scale_value: value to be used do determine color with respect to the color scale
+ // face_vale: value to be printed to screen
+ auto lambdaMakeFontColor = [absmax](double scale_value, double face_value){
+ if( face_value >= 0 )
+ return Util::fontColorTag( QString::number(face_value), Util::getColorFromValue( std::abs(scale_value), ColorTable::SEISMIC, -absmax, absmax ) );
+ else
+ return Util::fontColorTag( QString::number(face_value), Util::getColorFromValue( -std::abs(scale_value), ColorTable::SEISMIC, -absmax, absmax ) );
+ };
+
+ const QString btdSansColor = "";
+ const QString btdAvecColor = " | " + lambdaMakeFontColor(mag_term[0], model_parameters.a) + etd
+ + btdSansColor + "x2 + " + etd;
+ output += btdAvecColor + lambdaMakeBGColor( mag_term[1], model_parameters.b) + ">" + lambdaMakeFontColor(mag_term[1], model_parameters.b) + etd
+ + btdSansColor + "xy + " + etd;
+ output += btdAvecColor + lambdaMakeBGColor( mag_term[2], model_parameters.c) + ">" + lambdaMakeFontColor(mag_term[2], model_parameters.c) + etd
+ + btdSansColor + "xz + " + etd;
+ output += btdAvecColor + lambdaMakeBGColor( mag_term[3], model_parameters.d) + ">" + lambdaMakeFontColor(mag_term[3], model_parameters.d) + etd
+ + btdSansColor + "y2 + " + etd;
+ output += btdAvecColor + lambdaMakeBGColor( mag_term[4], model_parameters.e) + ">" + lambdaMakeFontColor(mag_term[4], model_parameters.e) + etd
+ + btdSansColor + "yz + " + etd;
+ output += btdAvecColor + lambdaMakeBGColor( mag_term[5], model_parameters.f) + ">" + lambdaMakeFontColor(mag_term[5], model_parameters.f) + etd
+ + btdSansColor + "z2 + " + etd;
+ output += btdAvecColor + lambdaMakeBGColor( mag_term[6], model_parameters.g) + ">" + lambdaMakeFontColor(mag_term[6], model_parameters.g) + etd
+ + btdSansColor + "x + " + etd;
+ output += btdAvecColor + lambdaMakeBGColor( mag_term[7], model_parameters.h) + ">" + lambdaMakeFontColor(mag_term[7], model_parameters.h) + etd
+ + btdSansColor + "y + " + etd;
+ output += btdAvecColor + lambdaMakeBGColor( mag_term[8], model_parameters.i) + ">" + lambdaMakeFontColor(mag_term[8], model_parameters.i) + etd
+ + btdSansColor + "z" + etd;
+ output += " |