myIsStoreTextProp = false;
}
+bool VisuGUI_GaussScalarBarPane::UseFieldRange(bool theInit)
+{
+ if ( theInit )
+ return !myPrsCopy->IsRangeFixed();
+
+ return RBFieldRange->isChecked() || !myPrsCopy->GetIsActiveLocalScalarBar();
+}
+
+
void VisuGUI_GaussScalarBarPane::onGlobalScalarBar()
{
- myCBDisplayed->setChecked( true );
+ myPrsCopy->SetIsActiveLocalScalarBar(false);
+ myPrsCopy->SetSourceRange();
+
+ myCBDisplayed->setEnabled( false );
RBImposedRange->setEnabled( false );
RBFieldRange->setEnabled( false );
+
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
- myPrsCopy->SetIsActiveLocalScalarBar(false);
+ MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
+ MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
}
void VisuGUI_GaussScalarBarPane::onLocalScalarBar()
{
+ myPrsCopy->SetIsActiveLocalScalarBar(true);
+ if ( RBFieldRange->isChecked() )
+ myPrsCopy->SetSourceRange();
+ else
+ myPrsCopy->SetRange(myPrsCopy->GetMin(), myPrsCopy->GetMax());
+
myCBDisplayed->setEnabled( true );
RBImposedRange->setEnabled( true );
RBFieldRange->setEnabled( true );
- if ( RBImposedRange->isChecked() ) {
- MinEdit->setEnabled( true );
- MaxEdit->setEnabled( true );
- }
+ MinEdit->setEnabled( RBImposedRange->isChecked() );
+ MaxEdit->setEnabled( RBImposedRange->isChecked() );
- myPrsCopy->SetIsActiveLocalScalarBar(true);
+ MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
+ MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
}
*/
void VisuGUI_GaussScalarBarPane::fieldRangeClicked()
{
+ myPrsCopy->SetSourceRange();
+
+ RBFieldRange->setChecked( true );
RBImposedRange->setChecked( false );
+
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
- MinEdit->setText( QString::number( myPrsCopy->GetSourceMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetSourceMax() ) );
-
- myPrsCopy->SetSourceRange();
+ MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
+ MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
}
*/
void VisuGUI_GaussScalarBarPane::imposedRangeClicked()
{
+ myPrsCopy->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
+
+ RBImposedRange->setChecked( true );
RBFieldRange->setChecked( false );
+
MinEdit->setEnabled( true );
MaxEdit->setEnabled( true );
-
- myPrsCopy->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
}
void VisuGUI_GaussScalarBarPane::changeScalarMode( int theMode )
{
myPrsCopy->SetScalarMode( theMode );
- if ( RBFieldRange->isChecked() ) {
- CORBA::Double aRange[2] = {myPrsCopy->GetSourceMin(), myPrsCopy->GetSourceMax()};
- MinEdit->setText( QString::number( aRange[0] ) );
- MaxEdit->setText( QString::number( aRange[1] ) );
+ if ( UseFieldRange() ) {
+ MinEdit->setText( QString::number( myPrsCopy->GetSourceMin() ) );
+ MaxEdit->setText( QString::number( myPrsCopy->GetSourceMax() ) );
}
}
/**
* Initialise dialog box from presentation object
*/
-void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs) {
+void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs,
+ bool theInit )
+{
myPrsCopy = thePrs;
myModeCombo->setCurrentItem(thePrs->GetScalarMode());
bool activeLocal = thePrs->GetIsActiveLocalScalarBar();
if ( activeLocal ) {
- if ( thePrs->IsRangeFixed() ) {
- RBImposedRange->setChecked( true );
- RBFieldRange->setChecked( false );
- MinEdit->setEnabled( true );
- MaxEdit->setEnabled( true );
- } else {
- RBImposedRange->setChecked( false );
- RBFieldRange->setChecked( true );
- MinEdit->setEnabled( false );
- MaxEdit->setEnabled( false );
- }
+ RBImposedRange->setChecked( !UseFieldRange(theInit) );
+ RBFieldRange->setChecked( UseFieldRange(theInit) );
+ MinEdit->setEnabled( !UseFieldRange(theInit) );
+ MaxEdit->setEnabled( !UseFieldRange(theInit) );
} else {
RBImposedRange->setEnabled( false );
RBFieldRange->setEnabled( false );
MaxEdit->setEnabled( false );
}
- if ( RBFieldRange->isChecked() ) {
- MinEdit->setText( QString::number( thePrs->GetSourceMin() ) );
- MaxEdit->setText( QString::number( thePrs->GetSourceMax() ) );
- } else {
- MinEdit->setText( QString::number( thePrs->GetMin() ) );
- MaxEdit->setText( QString::number( thePrs->GetMax() ) );
- }
+ MinEdit->setText( QString::number( thePrs->GetMin() ) );
+ MaxEdit->setText( QString::number( thePrs->GetMax() ) );
setPosAndSize( thePrs->GetPosX(),
thePrs->GetPosY(),
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject( myPrsCopy );
+ myScalarPane->initFromPrsObject( myPrsCopy, theInit );
bool isDeformed = myPrsCopy->GetIsDeformed();
myScaleSpinBox->setValue( myPrsCopy->GetScaleFactor() );