mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-14 02:30:33 +05:00
untabify
This commit is contained in:
parent
8d44be39e6
commit
c613a3b5c2
@ -770,47 +770,47 @@
|
|||||||
if ( selected.Extent() == 1 ) {
|
if ( selected.Extent() == 1 ) {
|
||||||
Handle(SALOME_InteractiveObject) anIO = selected.First();
|
Handle(SALOME_InteractiveObject) anIO = selected.First();
|
||||||
if ( anIO->hasEntry() ) {
|
if ( anIO->hasEntry() ) {
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() );
|
SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() );
|
||||||
if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
|
if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
|
||||||
vtkScalarBarActor* aScalarBarActor = anActor->GetScalarBarActor();
|
vtkScalarBarActor* aScalarBarActor = anActor->GetScalarBarActor();
|
||||||
SMESH::Controls::FunctorPtr aFunctor = anActor->GetFunctor();
|
SMESH::Controls::FunctorPtr aFunctor = anActor->GetFunctor();
|
||||||
if ( aScalarBarActor && aFunctor ) {
|
if ( aScalarBarActor && aFunctor ) {
|
||||||
SMESH::Controls::NumericalFunctor* aNumFun = dynamic_cast<SMESH::Controls::NumericalFunctor*>( aFunctor.get() );
|
SMESH::Controls::NumericalFunctor* aNumFun = dynamic_cast<SMESH::Controls::NumericalFunctor*>( aFunctor.get() );
|
||||||
if ( aNumFun ) {
|
if ( aNumFun ) {
|
||||||
int nbRanges = aScalarBarActor->GetMaximumNumberOfColors();
|
int nbRanges = aScalarBarActor->GetMaximumNumberOfColors();
|
||||||
std::vector<int> nbEvents;
|
std::vector<int> nbEvents;
|
||||||
std::vector<double> funValues;
|
std::vector<double> funValues;
|
||||||
aNumFun->GetHistogram( nbRanges, nbEvents, funValues );
|
aNumFun->GetHistogram( nbRanges, nbEvents, funValues );
|
||||||
QString anInitialPath = "";
|
QString anInitialPath = "";
|
||||||
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
|
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
|
||||||
anInitialPath = QDir::currentPath();
|
anInitialPath = QDir::currentPath();
|
||||||
QString aMeshName = anIO->getName();
|
QString aMeshName = anIO->getName();
|
||||||
QStringList filter;
|
QStringList filter;
|
||||||
filter.append( QObject::tr( "TEXT_FILES_FILTER" ) + " (*.txt)" );
|
filter.append( QObject::tr( "TEXT_FILES_FILTER" ) + " (*.txt)" );
|
||||||
filter.append( QObject::tr( "ALL_FILES_FILTER" ) + " (*)" );
|
filter.append( QObject::tr( "ALL_FILES_FILTER" ) + " (*)" );
|
||||||
QString aFilename = anInitialPath + "/" + aMeshName + "_" +
|
QString aFilename = anInitialPath + "/" + aMeshName + "_" +
|
||||||
functorToString( aFunctor ).toLower().simplified().replace( QRegExp( " |-" ), "_" ) + ".txt";
|
functorToString( aFunctor ).toLower().simplified().replace( QRegExp( " |-" ), "_" ) + ".txt";
|
||||||
aFilename = SUIT_FileDlg::getFileName( SMESHGUI::desktop(),
|
aFilename = SUIT_FileDlg::getFileName( SMESHGUI::desktop(),
|
||||||
aFilename,
|
aFilename,
|
||||||
filter,
|
filter,
|
||||||
QObject::tr( "SMESH_SAVE_DISTRIBUTION" ),
|
QObject::tr( "SMESH_SAVE_DISTRIBUTION" ),
|
||||||
false );
|
false );
|
||||||
if ( !aFilename.isEmpty() ) {
|
if ( !aFilename.isEmpty() ) {
|
||||||
QFile f( aFilename );
|
QFile f( aFilename );
|
||||||
if ( f.open( QFile::WriteOnly | QFile::Truncate ) ) {
|
if ( f.open( QFile::WriteOnly | QFile::Truncate ) ) {
|
||||||
QTextStream out( &f );
|
QTextStream out( &f );
|
||||||
out << "# Mesh: " << aMeshName << endl;
|
out << "# Mesh: " << aMeshName << endl;
|
||||||
out << "# Control: " << functorToString( aFunctor ) << endl;
|
out << "# Control: " << functorToString( aFunctor ) << endl;
|
||||||
out << "#" << endl;
|
out << "#" << endl;
|
||||||
out.setFieldWidth( 10 );
|
out.setFieldWidth( 10 );
|
||||||
for ( int i = 0; i < qMin( nbEvents.size(), funValues.size()-1 ); i++ )
|
for ( int i = 0; i < qMin( nbEvents.size(), funValues.size()-1 ); i++ )
|
||||||
out << funValues[i] << "\t" << funValues[i+1] << "\t" << nbEvents[i] << endl;
|
out << funValues[i] << "\t" << funValues[i+1] << "\t" << nbEvents[i] << endl;
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2387,14 +2387,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
if ( selected.Extent() > 1 ) { // a dlg for each IO
|
if ( selected.Extent() > 1 ) { // a dlg for each IO
|
||||||
SALOME_ListIteratorOfListIO It( selected );
|
SALOME_ListIteratorOfListIO It( selected );
|
||||||
for ( ; It.More(); It.Next() ) {
|
for ( ; It.More(); It.Next() ) {
|
||||||
SMESHGUI_MeshInfoDlg* dlg = new SMESHGUI_MeshInfoDlg( SMESHGUI::desktop(), page );
|
SMESHGUI_MeshInfoDlg* dlg = new SMESHGUI_MeshInfoDlg( SMESHGUI::desktop(), page );
|
||||||
dlg->showInfo( It.Value() );
|
dlg->showInfo( It.Value() );
|
||||||
dlg->show();
|
dlg->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SMESHGUI_MeshInfoDlg* dlg = new SMESHGUI_MeshInfoDlg( SMESHGUI::desktop(), page );
|
SMESHGUI_MeshInfoDlg* dlg = new SMESHGUI_MeshInfoDlg( SMESHGUI::desktop(), page );
|
||||||
dlg->show();
|
dlg->show();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user