+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include <Standard_Stream.hxx>
#include <GEOMImpl_IInsertOperations.hxx>
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ExportDriver::GetID()) return;
- //Set parameters
- GEOMImpl_IImportExport aCI (aFunction);
- aCI.SetOriginal(aRefFunction);
- aCI.SetFileName(theFileName);
-
Handle(TCollection_HAsciiString) aHLibName;
if (!IsSupported(Standard_False, theFormatName, aHLibName)) {
return;
}
TCollection_AsciiString aLibName = aHLibName->String();
+
+ //Set parameters
+ GEOMImpl_IImportExport aCI (aFunction);
+ aCI.SetOriginal(aRefFunction);
+ aCI.SetFileName(theFileName);
+ aCI.SetFormatName(theFormatName);
aCI.SetPluginName(aLibName);
//Perform the Export
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ImportDriver::GetID()) return result;
- //Set parameters
- GEOMImpl_IImportExport aCI (aFunction);
- aCI.SetFileName(theFileName);
-
Handle(TCollection_HAsciiString) aHLibName;
if (!IsSupported(Standard_True, theFormatName, aHLibName)) {
return result;
}
TCollection_AsciiString aLibName = aHLibName->String();
+
+ //Set parameters
+ GEOMImpl_IImportExport aCI (aFunction);
+ aCI.SetFileName(theFileName);
+ aCI.SetFormatName(theFormatName);
aCI.SetPluginName(aLibName);
//Perform the Import
// Read Patterns for each supported format
int j = 1, len = theFormats->Length();
for (; j <= len; j++) {
- TCollection_AsciiString aPattern;
- TCollection_AsciiString aKey (theFormats->Value(j));
- aKey += ".Pattern";
+ TCollection_AsciiString aKey, aPattern;
+ aKey = theFormats->Value(j) + ".ImportPattern";
if (myResMgr->Find(aKey.ToCString()))
aPattern = myResMgr->Value(aKey.ToCString());
else {
- aPattern = theFormats->Value(j);
- aPattern += " Files ( *.* )";
+ aKey = theFormats->Value(j) + ".Pattern";
+ if (myResMgr->Find(aKey.ToCString()))
+ aPattern = myResMgr->Value(aKey.ToCString());
+ else {
+ aPattern = theFormats->Value(j);
+ aPattern += " Files ( *.* )";
+ }
}
thePatterns->Append(aPattern);
}
// Read Patterns for each supported format
int j = 1, len = theFormats->Length();
for (; j <= len; j++) {
- TCollection_AsciiString aPattern;
- TCollection_AsciiString aKey (theFormats->Value(j));
- aKey += ".Pattern";
+ TCollection_AsciiString aKey, aPattern;
+ aKey = theFormats->Value(j) + ".ExportPattern";
if (myResMgr->Find(aKey.ToCString()))
aPattern = myResMgr->Value(aKey.ToCString());
else {
- aPattern = theFormats->Value(j);
- aPattern += " Files ( *.* )";
+ aKey = theFormats->Value(j) + ".Pattern";
+ if (myResMgr->Find(aKey.ToCString()))
+ aPattern = myResMgr->Value(aKey.ToCString());
+ else {
+ aPattern = theFormats->Value(j);
+ aPattern += " Files ( *.* )";
+ }
}
thePatterns->Append(aPattern);
}
#else
aResDir += "/share/salome/resources";
#endif
- TCollection_AsciiString aUserResDir (getenv("HOME"));
+ char * dir = getenv("GEOM_ENGINE_RESOURCES_DIR");
+ TCollection_AsciiString aUserResDir;
+ if ( dir )
+ {
+ aUserResDir = dir;
+ }
+ else
+ {
+ aUserResDir = getenv("HOME");
#ifdef WNT
- aUserResDir += "\\.salome\\resources";
+ aUserResDir += "\\.salome\\resources";
#else
- aUserResDir += "/.salome/resources";
+ aUserResDir += "/.salome/resources";
#endif
+ }
myResMgr = new Resource_Manager ("ImportExport", aResDir, aUserResDir, Standard_False);
if (!myResMgr->Find("Import") && !myResMgr->Find("Export")) {