mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-05-15 06:30:48 +05:00
0021840: [CEA 655] Scalar bar: using a logarithmic scale
This commit is contained in:
parent
86a9f36ce4
commit
aea880cf9e
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 32 KiB |
@ -7,8 +7,12 @@ In this dialog you can specify the properties of the scalar bar
|
|||||||
\image html scalar_bar_dlg.png
|
\image html scalar_bar_dlg.png
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Scalar Range</b> in this menu you can specify
|
<li><b>Scalar Range</b> - in this menu you can specify
|
||||||
<b>Min value</b> and <b>Max value</b> of the <b>Scalar Bar</b> </li>
|
<b>Min value</b> and <b>Max value</b> of the <b>Scalar Bar</b>, and
|
||||||
|
also you can turn on/off <b>Logarithmic</b> scaling of the scalar bar.</li>
|
||||||
|
|
||||||
|
\note <b>Logarithmic scale</b> is not applicable in case of
|
||||||
|
negative and zero values in the range. In such cases it is disabled.
|
||||||
|
|
||||||
<li><b>Font</b> - in this menu you can set type, face and color for
|
<li><b>Font</b> - in this menu you can set type, face and color for
|
||||||
the font of <b>Title</b> and <b>Labels</b> of the <b>Scalar
|
the font of <b>Title</b> and <b>Labels</b> of the <b>Scalar
|
||||||
@ -29,7 +33,7 @@ location (<b>X</b> and <b>Y</b>) and size (<b>Width</b> and
|
|||||||
side)</li>
|
side)</li>
|
||||||
<li><b>Y</b>: ordinate of the origin (from the bottom)</li>
|
<li><b>Y</b>: ordinate of the origin (from the bottom)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<li><b>Distribution</b> in this menu you can Show/Hide distribution histogram of the values of the <b>Scalar Bar</b> and specify histogram properties</li>
|
<li><b>Distribution</b> - in this menu you can Show/Hide distribution histogram of the values of the <b>Scalar Bar</b> and specify histogram properties</li>
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Multicolor</b> the histogram is colored as <b>Scalar Bar</b></li>
|
<li><b>Multicolor</b> the histogram is colored as <b>Scalar Bar</b></li>
|
||||||
<li><b>Monocolor</b> the histogram is colored as selected with <b>Distribution color</b> selector</li>
|
<li><b>Monocolor</b> the histogram is colored as selected with <b>Distribution color</b> selector</li>
|
||||||
|
@ -115,7 +115,7 @@ module SMESH
|
|||||||
{
|
{
|
||||||
double GetValue( in long theElementId );
|
double GetValue( in long theElementId );
|
||||||
|
|
||||||
Histogram GetHistogram( in short nbIntervals );
|
Histogram GetHistogram( in short nbIntervals, in boolean isLogarithmic );
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Set precision for calculation. It is a position after point which is
|
* Set precision for calculation. It is a position after point which is
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#include "SMESH_ControlsDef.hxx"
|
#include "SMESH_ControlsDef.hxx"
|
||||||
|
|
||||||
@ -322,12 +321,12 @@ double NumericalFunctor::Round( const double & aVal )
|
|||||||
* \param minmax - boundaries of diapason of values to divide into intervals
|
* \param minmax - boundaries of diapason of values to divide into intervals
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
void NumericalFunctor::GetHistogram(int nbIntervals,
|
void NumericalFunctor::GetHistogram(int nbIntervals,
|
||||||
std::vector<int>& nbEvents,
|
std::vector<int>& nbEvents,
|
||||||
std::vector<double>& funValues,
|
std::vector<double>& funValues,
|
||||||
const vector<int>& elements,
|
const vector<int>& elements,
|
||||||
const double* minmax)
|
const double* minmax,
|
||||||
|
const bool isLogarithmic)
|
||||||
{
|
{
|
||||||
if ( nbIntervals < 1 ||
|
if ( nbIntervals < 1 ||
|
||||||
!myMesh ||
|
!myMesh ||
|
||||||
@ -380,8 +379,15 @@ void NumericalFunctor::GetHistogram(int nbIntervals,
|
|||||||
for ( int i = 0; i < nbIntervals; ++i )
|
for ( int i = 0; i < nbIntervals; ++i )
|
||||||
{
|
{
|
||||||
// find end value of i-th interval
|
// find end value of i-th interval
|
||||||
double r = (i+1) / double( nbIntervals );
|
double r = (i+1) / double(nbIntervals);
|
||||||
funValues[i+1] = funValues.front() * (1-r) + funValues.back() * r;
|
if (isLogarithmic && funValues.front() > 1e-07 && funValues.back() > 1e-07) {
|
||||||
|
double logmin = log10(funValues.front());
|
||||||
|
double lval = logmin + r * (log10(funValues.back()) - logmin);
|
||||||
|
funValues[i+1] = pow(10.0, lval);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
funValues[i+1] = funValues.front() * (1-r) + funValues.back() * r;
|
||||||
|
}
|
||||||
|
|
||||||
// count values in the i-th interval if there are any
|
// count values in the i-th interval if there are any
|
||||||
if ( min != values.end() && *min <= funValues[i+1] )
|
if ( min != values.end() && *min <= funValues[i+1] )
|
||||||
|
@ -125,7 +125,8 @@ namespace SMESH{
|
|||||||
std::vector<int>& nbEvents,
|
std::vector<int>& nbEvents,
|
||||||
std::vector<double>& funValues,
|
std::vector<double>& funValues,
|
||||||
const std::vector<int>& elements,
|
const std::vector<int>& elements,
|
||||||
const double* minmax=0);
|
const double* minmax=0,
|
||||||
|
const bool isLogarithmic = false);
|
||||||
virtual SMDSAbs_ElementType GetType() const = 0;
|
virtual SMDSAbs_ElementType GetType() const = 0;
|
||||||
virtual double GetBadRate( double Value, int nbNodes ) const = 0;
|
virtual double GetBadRate( double Value, int nbNodes ) const = 0;
|
||||||
long GetPrecision() const;
|
long GetPrecision() const;
|
||||||
|
@ -18,13 +18,12 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
// SMESH OBJECT : interactive object for SMESH visualization
|
// SMESH OBJECT : interactive object for SMESH visualization
|
||||||
// File : SMESH_Actor.cxx
|
// File : SMESH_Actor.cxx
|
||||||
// Author : Nicolas REJNERI
|
// Author : Nicolas REJNERI
|
||||||
// Module : SMESH
|
// Module : SMESH
|
||||||
//
|
|
||||||
#include "SMESH_ActorDef.h"
|
#include "SMESH_ActorDef.h"
|
||||||
#include "SMESH_ActorUtils.h"
|
#include "SMESH_ActorUtils.h"
|
||||||
#include "SMESH_DeviceActor.h"
|
#include "SMESH_DeviceActor.h"
|
||||||
@ -814,6 +813,10 @@ SMESH_ActorDef::
|
|||||||
SetControlMode(eControl theMode,
|
SetControlMode(eControl theMode,
|
||||||
bool theCheckEntityMode)
|
bool theCheckEntityMode)
|
||||||
{
|
{
|
||||||
|
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
||||||
|
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
|
||||||
|
lookupTable->SetScale(VTK_SCALE_LINEAR);
|
||||||
|
|
||||||
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
|
||||||
if( !mgr )
|
if( !mgr )
|
||||||
return;
|
return;
|
||||||
@ -1080,6 +1083,13 @@ SetControlMode(eControl theMode,
|
|||||||
|
|
||||||
myTimeStamp->Modified();
|
myTimeStamp->Modified();
|
||||||
Modified();
|
Modified();
|
||||||
|
|
||||||
|
lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
||||||
|
double * range = lookupTable->GetRange();
|
||||||
|
|
||||||
|
if (isLogarithmic && range[0] > 1e-07 && range[1] > 1e-07)
|
||||||
|
lookupTable->SetScale(VTK_SCALE_LOG10);
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2340,7 +2350,8 @@ void SMESH_ActorDef::UpdateDistribution()
|
|||||||
elemIds.push_back( (*e)->GetID());
|
elemIds.push_back( (*e)->GetID());
|
||||||
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
||||||
double * range = lookupTable->GetRange();
|
double * range = lookupTable->GetRange();
|
||||||
fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range);
|
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
|
||||||
|
fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range, isLogarithmic);
|
||||||
myScalarBarActor->SetDistribution(nbEvents);
|
myScalarBarActor->SetDistribution(nbEvents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2418,7 +2429,8 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() {
|
|||||||
|
|
||||||
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
||||||
double * range = lookupTable->GetRange();
|
double * range = lookupTable->GetRange();
|
||||||
fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range);
|
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
|
||||||
|
fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range, isLogarithmic);
|
||||||
|
|
||||||
for ( int i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ )
|
for ( int i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ )
|
||||||
my2dHistogram->addPoint(funValues[i] + (funValues[i+1] - funValues[i])/2.0, static_cast<double>(nbEvents[i]));
|
my2dHistogram->addPoint(funValues[i] + (funValues[i+1] - funValues[i])/2.0, static_cast<double>(nbEvents[i]));
|
||||||
|
@ -1108,9 +1108,10 @@
|
|||||||
vtkLookupTable* lookupTable =
|
vtkLookupTable* lookupTable =
|
||||||
static_cast<vtkLookupTable*>(aScalarBarActor->GetLookupTable());
|
static_cast<vtkLookupTable*>(aScalarBarActor->GetLookupTable());
|
||||||
double * minmax = lookupTable->GetRange();
|
double * minmax = lookupTable->GetRange();
|
||||||
|
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
|
||||||
std::vector<int> nbEvents;
|
std::vector<int> nbEvents;
|
||||||
std::vector<double> funValues;
|
std::vector<double> funValues;
|
||||||
aNumFun->GetHistogram( nbIntervals, nbEvents, funValues, elements, minmax );
|
aNumFun->GetHistogram( nbIntervals, nbEvents, funValues, elements, minmax, isLogarithmic );
|
||||||
QString anInitialPath = "";
|
QString anInitialPath = "";
|
||||||
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
|
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
|
||||||
anInitialPath = QDir::currentPath();
|
anInitialPath = QDir::currentPath();
|
||||||
|
@ -18,13 +18,12 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
// SMESH SMESHGUI : GUI for SMESH component
|
// SMESH SMESHGUI : GUI for SMESH component
|
||||||
// File : SMESHGUI_Preferences_ScalarBarDlg.cxx
|
// File : SMESHGUI_Preferences_ScalarBarDlg.cxx
|
||||||
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
|
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
|
||||||
// SMESH includes
|
// SMESH includes
|
||||||
//
|
|
||||||
#include "SMESHGUI_Preferences_ScalarBarDlg.h"
|
#include "SMESHGUI_Preferences_ScalarBarDlg.h"
|
||||||
|
|
||||||
#include "SMESHGUI.h"
|
#include "SMESHGUI.h"
|
||||||
@ -130,7 +129,8 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
// Scalar range
|
// Scalar range
|
||||||
myRangeGrp = new QGroupBox ( tr( "SMESH_RANGE_SCALARBAR" ), this );
|
myRangeGrp = new QGroupBox ( tr( "SMESH_RANGE_SCALARBAR" ), this );
|
||||||
QHBoxLayout* myRangeGrpLayout = new QHBoxLayout( myRangeGrp );
|
//QHBoxLayout* myRangeGrpLayout = new QHBoxLayout( myRangeGrp );
|
||||||
|
QGridLayout* myRangeGrpLayout = new QGridLayout( myRangeGrp );
|
||||||
myRangeGrpLayout->setSpacing( SPACING_SIZE ); myRangeGrpLayout->setMargin( MARGIN_SIZE );
|
myRangeGrpLayout->setSpacing( SPACING_SIZE ); myRangeGrpLayout->setMargin( MARGIN_SIZE );
|
||||||
|
|
||||||
myMinEdit = new QLineEdit( myRangeGrp );
|
myMinEdit = new QLineEdit( myRangeGrp );
|
||||||
@ -141,10 +141,15 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
|
|||||||
myMaxEdit->setMinimumWidth( MINIMUM_WIDTH );
|
myMaxEdit->setMinimumWidth( MINIMUM_WIDTH );
|
||||||
myMaxEdit->setValidator( new QDoubleValidator( this ) );
|
myMaxEdit->setValidator( new QDoubleValidator( this ) );
|
||||||
|
|
||||||
myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MIN" ), myRangeGrp ) );
|
myLogarithmicCheck = new QCheckBox (myRangeGrp);
|
||||||
myRangeGrpLayout->addWidget( myMinEdit );
|
myLogarithmicCheck->setText(tr("SMESH_LOGARITHMIC_SCALARBAR"));
|
||||||
myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MAX" ), myRangeGrp ) );
|
myLogarithmicCheck->setChecked(false);
|
||||||
myRangeGrpLayout->addWidget( myMaxEdit );
|
|
||||||
|
myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MIN" ), myRangeGrp ), 0, 0, 1, 1 );
|
||||||
|
myRangeGrpLayout->addWidget( myMinEdit, 0, 1, 1, 1 );
|
||||||
|
myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MAX" ), myRangeGrp ), 0, 2, 1, 1 );
|
||||||
|
myRangeGrpLayout->addWidget( myMaxEdit, 0, 3, 1, 1 );
|
||||||
|
myRangeGrpLayout->addWidget( myLogarithmicCheck, 1, 0, 1, 4 );
|
||||||
|
|
||||||
aTopLayout->addWidget( myRangeGrp );
|
aTopLayout->addWidget( myRangeGrp );
|
||||||
|
|
||||||
@ -423,8 +428,6 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
|
|||||||
QColor(255, 255, 255));
|
QColor(255, 255, 255));
|
||||||
myMonoColorBtn->setColor(distributionColor);
|
myMonoColorBtn->setColor(distributionColor);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --> then init from selection if necessary
|
// --> then init from selection if necessary
|
||||||
onSelectionChanged();
|
onSelectionChanged();
|
||||||
|
|
||||||
@ -434,6 +437,8 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
|
|||||||
connect( myApplyBtn, SIGNAL( clicked() ), this, SLOT( onApply() ) );
|
connect( myApplyBtn, SIGNAL( clicked() ), this, SLOT( onApply() ) );
|
||||||
connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( onCancel() ) );
|
connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( onCancel() ) );
|
||||||
connect( myHelpBtn, SIGNAL(clicked()), this, SLOT( onHelp() ) );
|
connect( myHelpBtn, SIGNAL(clicked()), this, SLOT( onHelp() ) );
|
||||||
|
connect( myMinEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) );
|
||||||
|
connect( myMaxEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) );
|
||||||
connect( myXSpin, SIGNAL( valueChanged( double ) ), this, SLOT( onXYChanged() ) );
|
connect( myXSpin, SIGNAL( valueChanged( double ) ), this, SLOT( onXYChanged() ) );
|
||||||
connect( myYSpin, SIGNAL( valueChanged( double ) ), this, SLOT( onXYChanged() ) );
|
connect( myYSpin, SIGNAL( valueChanged( double ) ), this, SLOT( onXYChanged() ) );
|
||||||
connect( aOrientationGrp, SIGNAL( buttonClicked( int ) ), this, SLOT( onOrientationChanged() ) );
|
connect( aOrientationGrp, SIGNAL( buttonClicked( int ) ), this, SLOT( onOrientationChanged() ) );
|
||||||
@ -528,7 +533,7 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
|
|||||||
if( myDistributionGrp->isChecked() ) {
|
if( myDistributionGrp->isChecked() ) {
|
||||||
int ColoringType = myDMultiColor->isChecked() ? SMESH_MULTICOLOR_TYPE : SMESH_MONOCOLOR_TYPE;
|
int ColoringType = myDMultiColor->isChecked() ? SMESH_MULTICOLOR_TYPE : SMESH_MONOCOLOR_TYPE;
|
||||||
distributionTypeChanged = (ColoringType != myScalarBarActor->GetDistributionColoringType());
|
distributionTypeChanged = (ColoringType != myScalarBarActor->GetDistributionColoringType());
|
||||||
if(distributionTypeChanged)
|
if (distributionTypeChanged)
|
||||||
myScalarBarActor->SetDistributionColoringType(ColoringType);
|
myScalarBarActor->SetDistributionColoringType(ColoringType);
|
||||||
|
|
||||||
if( !myDMultiColor->isChecked() ) {
|
if( !myDMultiColor->isChecked() ) {
|
||||||
@ -556,12 +561,16 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
|
|||||||
if(nbColorsChanged)
|
if(nbColorsChanged)
|
||||||
myScalarBarActor->SetMaximumNumberOfColors(myColorsSpin->value());
|
myScalarBarActor->SetMaximumNumberOfColors(myColorsSpin->value());
|
||||||
|
|
||||||
|
|
||||||
myLookupTable->SetRange( aMin, aMax );
|
myLookupTable->SetRange( aMin, aMax );
|
||||||
myLookupTable->SetNumberOfTableValues(myColorsSpin->value());
|
myLookupTable->SetNumberOfTableValues(myColorsSpin->value());
|
||||||
|
|
||||||
|
bool scaleChanged = (myLogarithmicCheck->isChecked() != (myLookupTable->GetScale() == VTK_SCALE_LOG10));
|
||||||
|
if (scaleChanged)
|
||||||
|
myLookupTable->SetScale(myLogarithmicCheck->isChecked() ? VTK_SCALE_LOG10 : VTK_SCALE_LINEAR);
|
||||||
|
|
||||||
myLookupTable->Build();
|
myLookupTable->Build();
|
||||||
|
|
||||||
if( nbColorsChanged || rangeChanges)
|
if (nbColorsChanged || rangeChanges || scaleChanged)
|
||||||
myActor->UpdateDistribution();
|
myActor->UpdateDistribution();
|
||||||
|
|
||||||
#ifndef DISABLE_PLOT2DVIEWER
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
@ -573,8 +582,6 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
|
|||||||
SMESH::ProcessIn2DViewers(myActor);
|
SMESH::ProcessIn2DViewers(myActor);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SMESH::RepaintCurrentView();
|
SMESH::RepaintCurrentView();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -639,9 +646,13 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
|
|||||||
SMESH_ScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
|
SMESH_ScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
|
||||||
|
|
||||||
if ( myScalarBarActor->GetLookupTable() ) {
|
if ( myScalarBarActor->GetLookupTable() ) {
|
||||||
vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
|
vtkLookupTable* aLookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
||||||
|
|
||||||
|
vtkFloatingPointType *range = aLookupTable->GetRange();
|
||||||
myMinEdit->setText( QString::number( range[0],'g',12 ) );
|
myMinEdit->setText( QString::number( range[0],'g',12 ) );
|
||||||
myMaxEdit->setText( QString::number( range[1],'g',12 ) );
|
myMaxEdit->setText( QString::number( range[1],'g',12 ) );
|
||||||
|
myLogarithmicCheck->setChecked(aLookupTable->GetScale() == VTK_SCALE_LOG10);
|
||||||
|
myLogarithmicCheck->setEnabled(range[0] > 1e-07 && range[1] > 1e-07);
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
|
vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
|
||||||
@ -690,7 +701,6 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
|
|||||||
myDistributionGrp->setChecked((bool)myScalarBarActor->GetDistributionVisibility());
|
myDistributionGrp->setChecked((bool)myScalarBarActor->GetDistributionVisibility());
|
||||||
onDistributionActivated(myScalarBarActor->GetDistributionVisibility());
|
onDistributionActivated(myScalarBarActor->GetDistributionVisibility());
|
||||||
|
|
||||||
|
|
||||||
myRangeGrp->setEnabled( true );
|
myRangeGrp->setEnabled( true );
|
||||||
myFontGrp->setEnabled( true );
|
myFontGrp->setEnabled( true );
|
||||||
myLabColorGrp->setEnabled( true );
|
myLabColorGrp->setEnabled( true );
|
||||||
@ -727,6 +737,22 @@ void SMESHGUI_Preferences_ScalarBarDlg::closeEvent( QCloseEvent* e )
|
|||||||
QDialog::closeEvent( e );
|
QDialog::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================================
|
||||||
|
/*!
|
||||||
|
* SMESHGUI_Preferences_ScalarBarDlg::onMinMaxChanged
|
||||||
|
*
|
||||||
|
* Called when Scalar Range values are changed
|
||||||
|
*/
|
||||||
|
//=================================================================================================
|
||||||
|
void SMESHGUI_Preferences_ScalarBarDlg::onMinMaxChanged()
|
||||||
|
{
|
||||||
|
double aMin = myMinEdit->text().toDouble();
|
||||||
|
double aMax = myMaxEdit->text().toDouble();
|
||||||
|
bool isLogarithmicEnabled = (aMin > 1e-07 && aMax > 1e-07);
|
||||||
|
myLogarithmicCheck->setChecked(isLogarithmicEnabled);
|
||||||
|
myLogarithmicCheck->setEnabled(isLogarithmicEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================================
|
//=================================================================================================
|
||||||
/*!
|
/*!
|
||||||
* SMESHGUI_Preferences_ScalarBarDlg::onXYChanged
|
* SMESHGUI_Preferences_ScalarBarDlg::onXYChanged
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
// SMESH SMESHGUI : GUI for SMESH component
|
// SMESH SMESHGUI : GUI for SMESH component
|
||||||
// File : SMESHGUI_Preferences_ScalarBarDlg.h
|
// File : SMESHGUI_Preferences_ScalarBarDlg.h
|
||||||
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
|
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
|
||||||
//
|
|
||||||
#ifndef SMESHGUI_PREFERENCES_SCALARBARDLG_H
|
#ifndef SMESHGUI_PREFERENCES_SCALARBARDLG_H
|
||||||
#define SMESHGUI_PREFERENCES_SCALARBARDLG_H
|
#define SMESHGUI_PREFERENCES_SCALARBARDLG_H
|
||||||
|
|
||||||
@ -78,6 +78,7 @@ protected slots:
|
|||||||
void onHelp();
|
void onHelp();
|
||||||
void onSelectionChanged();
|
void onSelectionChanged();
|
||||||
void onXYChanged();
|
void onXYChanged();
|
||||||
|
void onMinMaxChanged();
|
||||||
void onOrientationChanged();
|
void onOrientationChanged();
|
||||||
void onDistributionChanged( int );
|
void onDistributionChanged( int );
|
||||||
void onDistributionActivated( bool );
|
void onDistributionActivated( bool );
|
||||||
@ -94,6 +95,7 @@ private:
|
|||||||
QGroupBox* myRangeGrp;
|
QGroupBox* myRangeGrp;
|
||||||
QLineEdit* myMinEdit;
|
QLineEdit* myMinEdit;
|
||||||
QLineEdit* myMaxEdit;
|
QLineEdit* myMaxEdit;
|
||||||
|
QCheckBox* myLogarithmicCheck;
|
||||||
|
|
||||||
QGroupBox* myFontGrp;
|
QGroupBox* myFontGrp;
|
||||||
QtxColorButton* myTitleColorBtn;
|
QtxColorButton* myTitleColorBtn;
|
||||||
|
@ -1828,6 +1828,10 @@ Check algorithm documentation for supported geometry</translation>
|
|||||||
<source>SMESH_LENGTH</source>
|
<source>SMESH_LENGTH</source>
|
||||||
<translation>Length</translation>
|
<translation>Length</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_LOGARITHMIC_SCALARBAR</source>
|
||||||
|
<translation>Logarithmic</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MAKE_GROUPS</source>
|
<source>SMESH_MAKE_GROUPS</source>
|
||||||
<translation>Generate groups</translation>
|
<translation>Generate groups</translation>
|
||||||
|
@ -1800,6 +1800,10 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo
|
|||||||
<source>SMESH_LENGTH</source>
|
<source>SMESH_LENGTH</source>
|
||||||
<translation>Longueur</translation>
|
<translation>Longueur</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_LOGARITHMIC_SCALARBAR</source>
|
||||||
|
<translation type="unfinished">Logarithmic</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MAKE_GROUPS</source>
|
<source>SMESH_MAKE_GROUPS</source>
|
||||||
<translation>Générer les groupes</translation>
|
<translation>Générer les groupes</translation>
|
||||||
|
@ -18,13 +18,12 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
|
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
|
||||||
// File : SMESH_Filter_i.cxx
|
// File : SMESH_Filter_i.cxx
|
||||||
// Author : Alexey Petrov, OCC
|
// Author : Alexey Petrov, OCC
|
||||||
// Module : SMESH
|
// Module : SMESH
|
||||||
//
|
|
||||||
#include "SMESH_Filter_i.hxx"
|
#include "SMESH_Filter_i.hxx"
|
||||||
|
|
||||||
#include "SMDS_ElemIterator.hxx"
|
#include "SMDS_ElemIterator.hxx"
|
||||||
@ -580,12 +579,12 @@ CORBA::Double NumericalFunctor_i::GetValue( CORBA::Long theId )
|
|||||||
return myNumericalFunctorPtr->GetValue( theId );
|
return myNumericalFunctorPtr->GetValue( theId );
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::Histogram* NumericalFunctor_i::GetHistogram(CORBA::Short nbIntervals)
|
SMESH::Histogram* NumericalFunctor_i::GetHistogram(CORBA::Short nbIntervals, CORBA::Boolean isLogarithmic)
|
||||||
{
|
{
|
||||||
std::vector<int> nbEvents;
|
std::vector<int> nbEvents;
|
||||||
std::vector<double> funValues;
|
std::vector<double> funValues;
|
||||||
std::vector<int> elements;
|
std::vector<int> elements;
|
||||||
myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues,elements);
|
myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues,elements,0,isLogarithmic);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
nbIntervals = CORBA::Short( min( nbEvents.size(), funValues.size() - 1));
|
nbIntervals = CORBA::Short( min( nbEvents.size(), funValues.size() - 1));
|
||||||
|
@ -18,13 +18,12 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
|
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
|
||||||
// File : SMESH_Filter_i.hxx
|
// File : SMESH_Filter_i.hxx
|
||||||
// Author : Alexey Petrov, OCC
|
// Author : Alexey Petrov, OCC
|
||||||
// Module : SMESH
|
// Module : SMESH
|
||||||
//
|
|
||||||
#ifndef _SMESH_FILTER_I_HXX_
|
#ifndef _SMESH_FILTER_I_HXX_
|
||||||
#define _SMESH_FILTER_I_HXX_
|
#define _SMESH_FILTER_I_HXX_
|
||||||
|
|
||||||
@ -162,7 +161,7 @@ namespace SMESH
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CORBA::Double GetValue( CORBA::Long theElementId );
|
CORBA::Double GetValue( CORBA::Long theElementId );
|
||||||
SMESH::Histogram* GetHistogram(CORBA::Short nbIntervals);
|
SMESH::Histogram* GetHistogram(CORBA::Short nbIntervals, CORBA::Boolean isLogarithmic);
|
||||||
void SetPrecision( CORBA::Long thePrecision );
|
void SetPrecision( CORBA::Long thePrecision );
|
||||||
CORBA::Long GetPrecision();
|
CORBA::Long GetPrecision();
|
||||||
Controls::NumericalFunctorPtr GetNumericalFunctor();
|
Controls::NumericalFunctorPtr GetNumericalFunctor();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user