-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// 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_Types.hxx>
#include <GEOM_Function.hxx>
-#include "utilities.h"
-
#include <TopoDS_Shape.hxx>
+#include <TCollection_HAsciiString.hxx>
+
+#include "utilities.h"
+
#include <Standard_Failure.hxx>
#include <StdFail_NotDone.hxx>
TCollection_AsciiString&,
const TDF_Label&);
+typedef Handle(TCollection_HAsciiString) (*pGetValue)(const TCollection_AsciiString&,
+ const TCollection_AsciiString&,
+ TCollection_AsciiString&);
+
//=======================================================================
//function : GetID
//purpose :
return aImportDriver;
}
-
//=======================================================================
//function : GEOMImpl_ImportDriver
//purpose :
// load plugin library
LibHandle anImportLib = LoadLib( aLibName.ToCString() ); //This is workaround of BUG OCC13051
+
+ // Get Import method
funcPoint fp = 0;
if ( anImportLib )
fp = (funcPoint)GetProc( anImportLib, "Import" );
return 1;
}
+//=======================================================================
+//function : ReadValue
+//purpose :
+//=======================================================================
+TCollection_AsciiString GEOMImpl_ImportDriver::ReadValue(const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theLibName,
+ const TCollection_AsciiString& theParameterName,
+ TCollection_AsciiString& theError)
+{
+ TCollection_AsciiString aValue;
+
+ if (theFileName.IsEmpty() || theLibName.IsEmpty() || theParameterName.IsEmpty())
+ return aValue;
+
+ // load plugin library
+ LibHandle anImportLib = LoadLib(theLibName.ToCString()); //This is workaround of BUG OCC13051
+ if (!anImportLib) {
+ theError = theLibName + " library was not installed";
+ return aValue;
+ }
+
+ // Get GetValue method
+ pGetValue pGV = (pGetValue)GetProc(anImportLib, "GetValue");
+
+ if (!pGV) {
+ theError = theLibName + " library doesn't support GetValue method";
+ return aValue;
+ }
+
+ Handle(TCollection_HAsciiString) aHValue = pGV(theFileName, theParameterName, theError);
+
+ if (aHValue.IsNull()) {
+ if (theError.IsEmpty())
+ theError = theFileName + " doesn't contain requested parameter";
+ return aValue;
+ }
+
+ aValue = aHValue->String();
+
+ // unload plugin library
+ // commented by enk:
+ // the bug was occured: using ACIS Import/Export plugin
+ //UnLoadLib( anImportLib ); //This is workaround of BUG OCC13051
+
+ return aValue;
+}
+
//=======================================================================
//function : GEOMImpl_ImportDriver_Type_