msgid "VisuGUI::FLT_MED_FILES"
msgstr "MED Files (*.med)"
+msgid "VisuGUI::FLT_DISTRIBUTED_MED_FILES"
+msgstr "Distributed MED Files (*_maitre.med)"
+
msgid "VisuGUI::FLT_TABLE_FILES"
msgstr "Tables (*.xls *.txt *.tab)"
// Get file name
QStringList aFilter;
aFilter.append( tr( "FLT_MED_FILES" ) );
+ aFilter.append( tr( "FLT_DISTRIBUTED_MED_FILES" ) );
aFilter.append( tr( "FLT_ALL_FILES" ) );
bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" );
+ addPreference( tr( "Build min/max" ), importGr, LightApp_Preferences::Bool, "VISU", "build_min_max" );
addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" );
addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" );
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() );
int getNbColors();
int getNbLabels();
- void initFromPrsObject(VISU::GaussPoints_i* thePrs);
+ void initFromPrsObject(VISU::GaussPoints_i* thePrs, bool theInit);
int storeToPrsObject(VISU::GaussPoints_i* thePrs);
protected:
int myRangeMode;
bool myIsStoreTextProp;
+ bool UseFieldRange( bool theInit = true );
+
private slots:
void onGlobalScalarBar();
void onLocalScalarBar();
connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
connect( HeightSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
connect( CBLog, SIGNAL( toggled( bool ) ), this, SLOT( updatePreview() ));
- changeRange( 0 );
changeDefaults( 0 );
myIsStoreTextProp = false;
myBusy = false;
void VisuGUI_ScalarBarPane::changeRange( int )
{
if ( RBFrange->isChecked() ) {
+ myScalarMap->SetSourceRange();
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
} else {
+ myScalarMap->SetRange(myScalarMap->GetMin(), myScalarMap->GetMax());
MinEdit->setEnabled( true );
MaxEdit->setEnabled( true );
}
*/
void VisuGUI_ScalarBarPane::changeScalarMode( int theMode )
{
- if ( myScalarMap ) {
- if ( RBFrange->isChecked() ) {
- MinEdit->setText( QString::number( myScalarMap->GetComponentMin(theMode) ) );
- MaxEdit->setText( QString::number( myScalarMap->GetComponentMax(theMode) ) );
- }
+ if ( RBFrange->isChecked() ) {
+ MinEdit->setText( QString::number( myScalarMap->GetComponentMin(theMode) ) );
+ MaxEdit->setText( QString::number( myScalarMap->GetComponentMax(theMode) ) );
}
+
+ myScalarMap->SetScalarMode(theMode);
+
updatePreview();
}
else
RBFrange->setChecked( true );
- changeRange( 0 );
+ changeRange( sbRange );
}
GetSpecificPL()->Init();
// To update scalar range according to the new input
- if(!IsRangeFixed() || theReInit)
+ if(!IsRangeFixed() && theReInit)
SetSourceRange();
GetCResult()->ConnectObserver(this, myResultConnection);
{
VISU::TSetModified aModified(this);
- if(IsTimeStampFixed() || GetIsActiveLocalScalarBar())
- ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
- (GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
- else{
- TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
- vtkFloatingPointType aScalarRange[2] = {aTMinMax.first, aTMinMax.second};
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
- (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
- }
+ vtkFloatingPointType aScalarRange[2] = {GetSourceMin(), GetSourceMax()};
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
+
UseFixedRange(false);
}
{
QFileInfo aFileInfo(theFileName);
QString aTargetFileName = aFileInfo.filePath();
- if(aTargetFileName.endsWith("_grains_maitre.med")){
+ if(aTargetFileName.endsWith("_maitre.med")){
myMultiprObj.create(theFileName);
if (myMultiprObj.isValidDistributedMEDFile()) {
aTargetFileName = myMultiprObj.getSequentialMEDFilename();
VISU::TSubString(aPrefix, aSuffix) = "";
BEGMSG(MYDEBUG, "aPrefix = '"<<aPrefix<<"'\n");
- std::string aMultiFileName(aPrefix + "_grains_maitre.med" + aSuffix);
+ std::string aMultiFileName(aPrefix + "_maitre.med" + aSuffix);
BEGMSG(MYDEBUG, "aMultiFileName = '"<<aMultiFileName<<"'\n");
{
aRestoringMap["myName"] = thePartName;
const VISU::TMeshMap& aMeshMap = Result_i::GetInput()->GetMeshMap();
- VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName);
+ //VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName);
+ VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.begin();
if(aMeshIter == aMeshMap.end())
return;
int aRes = false;
std::string anErrorMessage("empty mesh");
try {
- INITMSG(MYDEBUG, "theMeshName = '"<<aFileName<<"'; theFieldName = '"<<theFieldName<<"'\n");
+ INITMSG(MYDEBUG, "theMeshName = '"<<theMeshName<<"'; theFieldName = '"<<theFieldName<<"'\n");
aRes = multipr::merge(aFileNames, theMeshName.c_str(), theFieldName.c_str(), aFileName.c_str());
}catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());