//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Prs3dDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Prs3dDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
QGroupBox* aTitleGrp = new QGroupBox ( tr("LBL_TITLE"), this);
QVBoxLayout* aVBLay = new QVBoxLayout( aTitleGrp );
QGroupBox* aTitleGrp = new QGroupBox ( tr("LBL_TITLE"), this);
QVBoxLayout* aVBLay = new QVBoxLayout( aTitleGrp );
else {
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
else {
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ "application")).arg(aHelpFileName),
QGroupBox* aDimGrp = new QGroupBox( this );
QGridLayout* aDimGrpLay = new QGridLayout( aDimGrp );
aDimGrpLay->setSpacing( 5 );
aDimGrpLay->setMargin( 5 );
QGroupBox* aDimGrp = new QGroupBox( this );
QGridLayout* aDimGrpLay = new QGridLayout( aDimGrp );
aDimGrpLay->setSpacing( 5 );
aDimGrpLay->setMargin( 5 );
myTitleSizeSpin->setRange( 0, 100 );
myTitleSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myTitleSizeSpin->setMinimumWidth( 70 );
myTitleSizeSpin->setValue( 0 );
myTitleSizeSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aTitleSizeLbl = new QLabel( tr( "LBL_TITLE_W" ), aDimGrp );
myTitleSizeSpin->setRange( 0, 100 );
myTitleSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myTitleSizeSpin->setMinimumWidth( 70 );
myTitleSizeSpin->setValue( 0 );
myTitleSizeSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aTitleSizeLbl = new QLabel( tr( "LBL_TITLE_W" ), aDimGrp );
myLabelSizeSpin->setRange( 0, 100 );
myLabelSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myLabelSizeSpin->setMinimumWidth( 70 );
myLabelSizeSpin->setValue( 0 );
myLabelSizeSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aLabelSizeLbl = new QLabel( tr( "LBL_LABEL_W" ), aDimGrp );
myLabelSizeSpin->setRange( 0, 100 );
myLabelSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myLabelSizeSpin->setMinimumWidth( 70 );
myLabelSizeSpin->setValue( 0 );
myLabelSizeSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aLabelSizeLbl = new QLabel( tr( "LBL_LABEL_W" ), aDimGrp );
myBarWidthSpin->setRange( 0, 100 );
myBarWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myBarWidthSpin->setMinimumWidth( 70 );
myBarWidthSpin->setValue( 0 );
myBarWidthSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aBarWidthLbl = new QLabel( tr( "LBL_BAR_W" ), aDimGrp );
myBarWidthSpin->setRange( 0, 100 );
myBarWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myBarWidthSpin->setMinimumWidth( 70 );
myBarWidthSpin->setValue( 0 );
myBarWidthSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aBarWidthLbl = new QLabel( tr( "LBL_BAR_W" ), aDimGrp );
myBarHeightSpin->setRange( 0, 100 );
myBarHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myBarHeightSpin->setMinimumWidth( 70 );
myBarHeightSpin->setRange( 0, 100 );
myBarHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myBarHeightSpin->setMinimumWidth( 70 );
aDimGrpLay->addWidget( aTitleSizeLbl, 0, 0 );
aDimGrpLay->addWidget( myTitleSizeSpin, 0, 1 );
aDimGrpLay->addWidget( aLabelSizeLbl, 0, 2 );
aDimGrpLay->addWidget( aTitleSizeLbl, 0, 0 );
aDimGrpLay->addWidget( myTitleSizeSpin, 0, 1 );
aDimGrpLay->addWidget( aLabelSizeLbl, 0, 2 );
aDimGrpLay->addWidget( aPrecLbl, 2, 0 );
aDimGrpLay->addWidget( myPrecisionSpin, 2, 1 );
aDimGrpLay->addWidget( myUnitsChk, 2, 2, 1, 2 );
aDimGrpLay->addWidget( aPrecLbl, 2, 0 );
aDimGrpLay->addWidget( myPrecisionSpin, 2, 1 );
aDimGrpLay->addWidget( myUnitsChk, 2, 2, 1, 2 );
aMainLay->addWidget( aDimGrp );
// Common buttons ===========================================================
aMainLay->addWidget( aDimGrp );
// Common buttons ===========================================================
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::setRatios( int titleRatioSize, int labelRatioWidth,
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::setRatios( int titleRatioSize, int labelRatioWidth,
{
myTitleSizeSpin->setValue( myTitleSize = titleRatioSize );
myLabelSizeSpin->setValue( myLabelSize = labelRatioWidth );
{
myTitleSizeSpin->setValue( myTitleSize = titleRatioSize );
myLabelSizeSpin->setValue( myLabelSize = labelRatioWidth );
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::getRatios( int& titleRatioSize, int& labelRatioWidth,
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::getRatios( int& titleRatioSize, int& labelRatioWidth,
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser",
- "application" ) ).
- arg( aHelpFileName ) );
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ "application" ) ).
+ arg( aHelpFileName ) );
if ( myTitleSizeSpin->value() > 100 )
{
SUIT_MessageBox::warning( this, tr( "WRN_VISU" ), tr( "MSG_BIG_SCALE_TLT" ) );
return;
}
if ( myTitleSizeSpin->value() > 100 )
{
SUIT_MessageBox::warning( this, tr( "WRN_VISU" ), tr( "MSG_BIG_SCALE_TLT" ) );
return;
}
myTitleSize = myTitleSizeSpin->value();
myLabelSize = myLabelSizeSpin->value();
myBarWidth = myBarWidthSpin->value();
myTitleSize = myTitleSizeSpin->value();
myLabelSize = myLabelSizeSpin->value();
myBarWidth = myBarWidthSpin->value();
Constructor
*/
VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool theIsDisplayGaussMetric, bool thePreview )
Constructor
*/
VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool theIsDisplayGaussMetric, bool thePreview )
myVerLS = aResourceMgr->integerValue("VISU", propertyName + "label_size", 0);
myVerBW = aResourceMgr->integerValue("VISU", propertyName + "bar_width", 0);
myVerBH = aResourceMgr->integerValue("VISU", propertyName + "bar_height",0);
myVerLS = aResourceMgr->integerValue("VISU", propertyName + "label_size", 0);
myVerBW = aResourceMgr->integerValue("VISU", propertyName + "bar_width", 0);
myVerBH = aResourceMgr->integerValue("VISU", propertyName + "bar_height",0);
propertyName = QString("scalar_bar_horizontal_");
myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.);
myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
propertyName = QString("scalar_bar_horizontal_");
myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.);
myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
RangeGroup->addButton( RBIrange, 1 );
RBFrange->setChecked( true );
RangeGroup->addButton( RBIrange, 1 );
RBFrange->setChecked( true );
MinEdit = new QLineEdit( aGB );
MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//MinEdit->setMinimumWidth( 70 );
MinEdit = new QLineEdit( aGB );
MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//MinEdit->setMinimumWidth( 70 );
MinEdit->setText( "0.0" );
QLabel* MinLabel = new QLabel (tr("LBL_MIN"), aGB);
MinLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
MinEdit->setText( "0.0" );
QLabel* MinLabel = new QLabel (tr("LBL_MIN"), aGB);
MinLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
MaxEdit = new QLineEdit( aGB );
MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//MaxEdit->setMinimumWidth( 70 );
MaxEdit = new QLineEdit( aGB );
MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//MaxEdit->setMinimumWidth( 70 );
MaxEdit->setText( "0.0" );
QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), aGB);
MaxLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
MaxEdit->setText( "0.0" );
QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), aGB);
MaxLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
//ColLabGroupLayout->setMargin( 11 );
QLabel* ColorLabel = new QLabel (tr("LBL_NB_COLORS"), ColLabGroup);
//ColLabGroupLayout->setMargin( 11 );
QLabel* ColorLabel = new QLabel (tr("LBL_NB_COLORS"), ColLabGroup);
ColorSpin->setMinimum( 2 );
ColorSpin->setMaximum( 256 );
ColorSpin->setSingleStep( 1 );
ColorSpin->setMinimum( 2 );
ColorSpin->setMaximum( 256 );
ColorSpin->setSingleStep( 1 );
ColorSpin->setValue( 64 );
QLabel* LabelLabel = new QLabel (tr("LBL_NB_LABELS"), ColLabGroup);
ColorSpin->setValue( 64 );
QLabel* LabelLabel = new QLabel (tr("LBL_NB_LABELS"), ColLabGroup);
LabelSpin->setMinimum( 2 );
LabelSpin->setMaximum( 65 );
LabelSpin->setSingleStep( 1 );
LabelSpin->setMinimum( 2 );
LabelSpin->setMaximum( 65 );
LabelSpin->setSingleStep( 1 );
LabelSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//LabelSpin->setMinimumWidth( 70 );
LabelSpin->setValue( 5 );
LabelSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//LabelSpin->setMinimumWidth( 70 );
LabelSpin->setValue( 5 );
//OriginGroupLayout->setMargin( 11 );
QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup);
//OriginGroupLayout->setMargin( 11 );
QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup);
- XSpin = new QtxDoubleSpinBox( OriginGroup );
- VISU::initSpinBox(XSpin, 0.0, +1.0);
+ XSpin = new SalomeApp_DoubleSpinBox( OriginGroup );
+ VISU::initSpinBox( XSpin, 0.0, +1.0, .1, "parametric_precision" );
XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//XSpin->setMinimumWidth( 70 );
XSpin->setValue( 0.01 );
QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup);
XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//XSpin->setMinimumWidth( 70 );
XSpin->setValue( 0.01 );
QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup);
- YSpin = new QtxDoubleSpinBox( OriginGroup );
- VISU::initSpinBox(YSpin, 0.0, +1.0);
+ YSpin = new SalomeApp_DoubleSpinBox( OriginGroup );
+ VISU::initSpinBox( YSpin, 0.0, +1.0, .1, "parametric_precision" );
YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//YSpin->setMinimumWidth( 70 );
YSpin->setValue( 0.1 );
YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//YSpin->setMinimumWidth( 70 );
YSpin->setValue( 0.1 );
//DimGroupLayout->setMargin( 11 );
QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup);
//DimGroupLayout->setMargin( 11 );
QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup);
- WidthSpin = new QtxDoubleSpinBox( DimGroup );
- VISU::initSpinBox(WidthSpin, 0.0, +1.0);
+ WidthSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( WidthSpin, 0.0, +1.0, .1, "parametric_precision" );
WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//WidthSpin->setMinimumWidth( 70 );
WidthSpin->setValue( 0.1 );
QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup);
WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//WidthSpin->setMinimumWidth( 70 );
WidthSpin->setValue( 0.1 );
QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup);
- HeightSpin = new QtxDoubleSpinBox( DimGroup );
- VISU::initSpinBox(HeightSpin, 0.0, +1.0);
+ HeightSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( HeightSpin, 0.0, +1.0, .1, "parametric_precision" );
HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//HeightSpin->setMinimumWidth( 70 );
HeightSpin->setValue( 0.8 );
HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//HeightSpin->setMinimumWidth( 70 );
HeightSpin->setValue( 0.8 );
QHBoxLayout* aVBLay = new QHBoxLayout( aSaveBox );
aVBLay->addWidget( myTextBtn = new QPushButton("Text properties...", aSaveBox) );
aVBLay->addWidget( myBarBtn = new QPushButton("Bar properties...", aSaveBox) );
QHBoxLayout* aVBLay = new QHBoxLayout( aSaveBox );
aVBLay->addWidget( myTextBtn = new QPushButton("Text properties...", aSaveBox) );
aVBLay->addWidget( myBarBtn = new QPushButton("Bar properties...", aSaveBox) );
aMainLayout->addWidget( myTextDlg = new VisuGUI_TextPrefDlg(this) );
myTextDlg->setTitleVisible(!thePreview);
myBarDlg = new VisuGUI_BarPrefDlg(this);
aMainLayout->addWidget( myTextDlg = new VisuGUI_TextPrefDlg(this) );
myTextDlg->setTitleVisible(!thePreview);
myBarDlg = new VisuGUI_BarPrefDlg(this);
aMainLayout->addWidget( CheckGroup );
//QHBoxLayout* CheckGroupLayout = new QHBoxLayout( CheckGroup );
QGridLayout* CheckGroupLayout = new QGridLayout( CheckGroup );
aMainLayout->addWidget( CheckGroup );
//QHBoxLayout* CheckGroupLayout = new QHBoxLayout( CheckGroup );
QGridLayout* CheckGroupLayout = new QGridLayout( CheckGroup );
myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), CheckGroup);
myPreviewCheck->setChecked(false);
CheckGroupLayout->addWidget(myPreviewCheck, 0, 0);
myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), CheckGroup);
myPreviewCheck->setChecked(false);
CheckGroupLayout->addWidget(myPreviewCheck, 0, 0);
myHideBar = new QCheckBox(tr("HIDE_SCALAR_BAR"), CheckGroup);
myHideBar->setChecked(false);
CheckGroupLayout->addWidget(myHideBar, 0, 1);
myHideBar = new QCheckBox(tr("HIDE_SCALAR_BAR"), CheckGroup);
myHideBar->setChecked(false);
CheckGroupLayout->addWidget(myHideBar, 0, 1);
int lp = aResourceMgr->integerValue( "VISU", propertyName + "scalar_bar_label_precision", 3 );
myBarDlg->setLabelsPrecision( lp );
int lp = aResourceMgr->integerValue( "VISU", propertyName + "scalar_bar_label_precision", 3 );
myBarDlg->setLabelsPrecision( lp );
myBarDlg->setUnitsVisible(aResourceMgr->booleanValue("VISU", propertyName + "display_units", true));
// signals and slots connections ===========================================
myBarDlg->setUnitsVisible(aResourceMgr->booleanValue("VISU", propertyName + "display_units", true));
// signals and slots connections ===========================================
connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) );
connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) );
connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) );
connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) );
connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) );
connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) );
connect( CBDistr, SIGNAL( toggled( bool ) ), this, SLOT( onShowDistribution( bool ) )); // RKV
connect( CBDistr, SIGNAL( toggled( bool ) ), this, SLOT( onShowDistribution( bool ) )); // RKV
connect( ColorSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( LabelSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
connect( ColorSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( LabelSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
aResourceMgr->setValue("VISU", "scalar_bar_logarithmic", isLogarithmic());
aResourceMgr->setValue("VISU", "scalar_bar_show_distribution", isShowDistribution()); // RKV
aResourceMgr->setValue("VISU", "scalar_bar_logarithmic", isLogarithmic());
aResourceMgr->setValue("VISU", "scalar_bar_show_distribution", isShowDistribution()); // RKV
aTitleFont.setBold(isTitleBold);
aTitleFont.setItalic(isTitleItalic);
aTitleFont.setOverline(isTitleShadow);
aTitleFont.setBold(isTitleBold);
aTitleFont.setItalic(isTitleItalic);
aTitleFont.setOverline(isTitleShadow);
// "Label"
QColor aLabelColor (255, 255, 255);
int aLabelFontFamily = VTK_ARIAL;
// "Label"
QColor aLabelColor (255, 255, 255);
int aLabelFontFamily = VTK_ARIAL;
aLabelFont.setBold(isLabelBold);
aLabelFont.setItalic(isLabelItalic);
aLabelFont.setOverline(isLabelShadow);
aLabelFont.setBold(isLabelBold);
aLabelFont.setItalic(isLabelItalic);
aLabelFont.setOverline(isLabelShadow);
aResourceMgr->setValue("VISU", "scalar_bar_label_font", aLabelFont);
aResourceMgr->setValue("VISU", "scalar_bar_label_color", aLabelColor);
aResourceMgr->setValue("VISU", "scalar_bar_label_font", aLabelFont);
aResourceMgr->setValue("VISU", "scalar_bar_label_color", aLabelColor);
aComponent = aComponent + ", " + anUnit;
myModeCombo->addItem(aComponent);
aComponent = aComponent + ", " + anUnit;
myModeCombo->addItem(aComponent);
// of mesh values on geometry is based on multiple gauss points
bool isEnableGaussMetric = false;
if( myIsDisplayGaussMetric ) {
// of mesh values on geometry is based on multiple gauss points
bool isEnableGaussMetric = false;
if( myIsDisplayGaussMetric ) {
if ( anIter != aValField.end() ) {
VISU::PValForTime aValForTime = anIter->second;
if( aValForTime && aValForTime->GetMaxNbGauss() > 1 )
if ( anIter != aValField.end() ) {
VISU::PValForTime aValForTime = anIter->second;
if( aValForTime && aValForTime->GetMaxNbGauss() > 1 )
- myScalarMap->GetPosY(),
- myScalarMap->GetWidth(),
- myScalarMap->GetHeight(),
- myScalarMap->GetBarOrientation());
+ myScalarMap->GetPosY(),
+ myScalarMap->GetWidth(),
+ myScalarMap->GetHeight(),
+ myScalarMap->GetBarOrientation());
myScalarMapPL = VISU_ScalarMapPL::New();
if(myScalarMap->GetSpecificPL())
myScalarMapPL->ShallowCopy(myScalarMap->GetSpecificPL(), true);
myScalarMapPL = VISU_ScalarMapPL::New();
if(myScalarMap->GetSpecificPL())
myScalarMapPL->ShallowCopy(myScalarMap->GetSpecificPL(), true);
myPreviewActor->GetScalarBar()->VisibilityOn();
myPreviewActor->PickableOff();
//myPreviewActor->SetBarVisibility(!myHideBar->isChecked());
myPreviewActor->GetScalarBar()->VisibilityOn();
myPreviewActor->PickableOff();
//myPreviewActor->SetBarVisibility(!myHideBar->isChecked());
myScalarMapPL->SetScalarMode(myModeCombo->currentIndex());
if(isLogarithmic())
myScalarMapPL->SetScaling(VISU::LOGARITHMIC);
myScalarMapPL->SetScalarMode(myModeCombo->currentIndex());
if(isLogarithmic())
myScalarMapPL->SetScaling(VISU::LOGARITHMIC);
aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
aScalarBarActor->SetDistribution( myScalarMapPL->GetDistribution() );
aScalarBarActor->SetDistributionVisibility( isShowDistribution() );
aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
aScalarBarActor->SetDistribution( myScalarMapPL->GetDistribution() );
aScalarBarActor->SetDistributionVisibility( isShowDistribution() );
if (!myTextDlg->getTitleText().isEmpty()) {
VISU::PValForTime aValForTime;
const VISU::PField& aField = myScalarMap->GetScalarField();
if (!myTextDlg->getTitleText().isEmpty()) {
VISU::PValForTime aValForTime;
const VISU::PField& aField = myScalarMap->GetScalarField();
const VISU::TTime& aTime = aValForTime->myTime;
aStream<< myTextDlg->getTitleText().toLatin1().data() <<" ";
const VISU::TTime& aTime = aValForTime->myTime;
aStream<< myTextDlg->getTitleText().toLatin1().data() <<" ";
- QString aName;
- aName.sprintf("%g", aTime.first);
- aStream << aName.toLatin1().data() << std::ends;
+ QString aName;
+ aName.sprintf("%g", aTime.first);
+ aStream << aName.toLatin1().data() << std::ends;
vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty();
aTitleProp->SetFontFamily(aTitleFontFamily);
aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255.,
vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty();
aTitleProp->SetFontFamily(aTitleFontFamily);
aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255.,
- vtkFloatingPointType(aTitleColor.green())/255.,
- vtkFloatingPointType(aTitleColor.blue())/255.);
+ vtkFloatingPointType(aTitleColor.green())/255.,
+ vtkFloatingPointType(aTitleColor.blue())/255.);
(isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
(isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty();
aLabelProp->SetFontFamily(aLabelFontFamily);
aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255.,
vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty();
aLabelProp->SetFontFamily(aLabelFontFamily);
aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255.,
- vtkFloatingPointType(aLabelColor.green())/255.,
- vtkFloatingPointType(aLabelColor.blue())/255.);
+ vtkFloatingPointType(aLabelColor.green())/255.,
+ vtkFloatingPointType(aLabelColor.blue())/255.);
(isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
(isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
- int VerTS, VerTH, VerLS, VerBW, VerBH;
+ int VerTS, VerLS, VerBW, VerBH;
myBarDlg->getRatios(VerTS, VerLS, VerBW, VerBH);
aScalarBarActor->SetRatios(VerTS, VerLS, VerBW, VerBH);
myBarDlg->getRatios(VerTS, VerLS, VerBW, VerBH);
aScalarBarActor->SetRatios(VerTS, VerLS, VerBW, VerBH);
if (myPreviewActor == 0) return;
vtkRenderer* aRend = myPreviewActor->GetRenderer();
vtkRenderWindow* aWnd = aRend->GetRenderWindow();
if (myPreviewActor == 0) return;
vtkRenderer* aRend = myPreviewActor->GetRenderer();
vtkRenderWindow* aWnd = aRend->GetRenderWindow();
myScalarMap->SetShadowTitle(isTitleShadow);
myScalarMap->SetTitFontType(aTitleFontFamily);
myScalarMap->SetTitleColor(aTitColor.red()/255.,
myScalarMap->SetShadowTitle(isTitleShadow);
myScalarMap->SetTitFontType(aTitleFontFamily);
myScalarMap->SetTitleColor(aTitColor.red()/255.,
- aTitColor.green()/255.,
- aTitColor.blue()/255.);
+ aTitColor.green()/255.,
+ aTitColor.blue()/255.);
myScalarMap->SetShadowLabel(isLabelShadow);
myScalarMap->SetLblFontType(aLabelFontFamily);
myScalarMap->SetLabelColor(aLblColor.red()/255.,
myScalarMap->SetShadowLabel(isLabelShadow);
myScalarMap->SetLblFontType(aLabelFontFamily);
myScalarMap->SetLabelColor(aLblColor.red()/255.,
- aLblColor.green()/255.,
- aLblColor.blue()/255.);
+ aLblColor.green()/255.,
+ aLblColor.blue()/255.);
- MinEdit->setText( QString::number( myScalarMap->GetSourceMin() ) );
- MaxEdit->setText( QString::number( myScalarMap->GetSourceMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) );
+
+ MinEdit->setText(QString::number(myScalarMap->GetSourceMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(myScalarMap->GetSourceMax(), 'g', aPrecision));
- MinEdit->setText( QString::number( myScalarMap->GetSourceMin() ) );
- MaxEdit->setText( QString::number( myScalarMap->GetSourceMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) );
+
+ MinEdit->setText(QString::number(myScalarMap->GetSourceMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(myScalarMap->GetSourceMax(), 'g', aPrecision));
- MinEdit->setText( QString::number( imin ) );
- MaxEdit->setText( QString::number( imax ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) );
+
+ MinEdit->setText(QString::number(imin, 'g', aPrecision+1)); // VSR +1 is for 'g' format
+ MaxEdit->setText(QString::number(imax, 'g', aPrecision+1)); // VSR +1 is for 'g' format
+
if ( RBIrange->isChecked() ) {
if (minVal >= maxVal) {
SUIT_MessageBox::warning( this,tr("WRN_VISU"),
if ( RBIrange->isChecked() ) {
if (minVal >= maxVal) {
SUIT_MessageBox::warning( this,tr("WRN_VISU"),
if ( CBLog->isChecked() ) {
if ( minVal <= 0.0 || maxVal <= 0.0 ) {
if ( RBIrange->isChecked() ) {
if ( CBLog->isChecked() ) {
if ( minVal <= 0.0 || maxVal <= 0.0 ) {
if ( RBIrange->isChecked() ) {
- if ( minVal == 0 || maxVal == 0 )
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE"),
- tr("BUT_OK"));
- else
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_FIELD_RANGE"),
- tr("BUT_OK"));
- RBIrange->setChecked(true);
- changeRange(1);
+ if ( minVal == 0 || maxVal == 0 )
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE"),
+ tr("BUT_OK"));
+ else
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_FIELD_RANGE"),
+ tr("BUT_OK"));
+ RBIrange->setChecked(true);
+ changeRange(1);
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser",
- "application" ) ).
- arg( aHelpFileName ) );
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ "application" ) ).
+ arg( aHelpFileName ) );
//----------------------------------------------------------------------------
void VisuGUI_ScalarBarBaseDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
//----------------------------------------------------------------------------
void VisuGUI_ScalarBarBaseDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,