From: Sergey POKHODENKO Date: Fri, 8 May 2015 12:26:05 +0000 (+0300) Subject: Issue #539: import step - *.stp files X-Git-Tag: V_1.2.0~164 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=56a8a18ec7662acd66454b5e8b624127c0577784;p=modules%2Fshaper.git Issue #539: import step - *.stp files --- diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index f3f53a273..57a4e933a 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -87,7 +87,7 @@ bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName) TopoDS_Shape aShape; if (aFormatName == "BREP") { aShape = BREPImport::Import(aFileName, aFormatName, anError, anUnknownLabel); - } else if (aFormatName == "STEP") { + } else if (aFormatName == "STEP" || aFormatName == "STP") { aShape = STEPImport::Import(aFileName, aFormatName, anError, anUnknownLabel); } // Check if shape is valid diff --git a/src/ExchangePlugin/ExchangePlugin_Validators.cpp b/src/ExchangePlugin/ExchangePlugin_Validators.cpp index c001a0c3f..5dc974e72 100644 --- a/src/ExchangePlugin/ExchangePlugin_Validators.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Validators.cpp @@ -12,6 +12,7 @@ #include #include +#include #include bool ExchangePlugin_ImportFormatValidator::parseFormats(const std::list& theArguments, @@ -26,9 +27,12 @@ bool ExchangePlugin_ImportFormatValidator::parseFormats(const std::list& theArguments, - std::list& outFormats); + std::list& outFormats); public: /** * Returns true is the file-name attribute correctly corresponds to the set of diff --git a/src/ExchangePlugin/plugin-Exchange.xml b/src/ExchangePlugin/plugin-Exchange.xml index 76a107e82..36f2801d5 100644 --- a/src/ExchangePlugin/plugin-Exchange.xml +++ b/src/ExchangePlugin/plugin-Exchange.xml @@ -8,7 +8,7 @@ id="import_file_selector" title="Import file" path=""> - + diff --git a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp index ac79ba823..f997592d1 100644 --- a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp @@ -17,14 +17,15 @@ #include -#include #include +#include +#include #include #include #include #include +#include #include -#include #include #include @@ -131,7 +132,9 @@ QString ModuleBase_WidgetFileSelector::formatsString() const QStringList aValidatorFormats = getValidatorFormats(); foreach(QString eachFormat, aValidatorFormats) { - aResult << QString("%1 files (*.%1)").arg(eachFormat); + QStringList aFormatList = eachFormat.split("|"); + aResult << QString("%1 files (%2)").arg(aFormatList.value(0)) + .arg(QStringList(aFormatList).replaceInStrings(QRegExp("^(.*)$"), "*.\\1").join(" ")); } aResult << QString("All files (*.*)"); return aResult.join(";;");