-// 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
//=============================================================================
/*!
- * constructor:
+ * constructor
*/
//=============================================================================
-
GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID)
: GEOM_IOperations(theEngine, theDocID)
{
* destructor
*/
//=============================================================================
-
GEOMImpl_IInsertOperations::~GEOMImpl_IInsertOperations()
{
MESSAGE("GEOMImpl_IInsertOperations::~GEOMImpl_IInsertOperations");
}
-
-
//=============================================================================
/*!
* MakeCopy
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_IInsertOperations::MakeCopy(Handle(GEOM_Object) theOriginal)
+Handle(GEOM_Object) GEOMImpl_IInsertOperations::MakeCopy (Handle(GEOM_Object) theOriginal)
{
SetErrorCode(KO);
aCI.SetFileName(theFileName);
aCI.SetFormatName(theFormatName);
aCI.SetPluginName(aLibName);
- //cout<<"IIO: theFormatName = "<<theFormatName.ToCString()<<endl;
//Perform the Import
try {
SetErrorCode(OK);
- if( theFormatName == "IGES_UNIT" ) {
+ // OLD CODE: begin
+ if (theFormatName == "IGES_UNIT") {
TopoDS_Shape S = aFunction->GetValue();
TopoDS_Vertex V = TopoDS::Vertex(S);
gp_Pnt P = BRep_Tool::Pnt(V);
//cout<<"IIO: aUnitName = "<<aUnitName.ToCString()<<endl;
SetErrorCode(aUnitName);
}
+ // OLD CODE: end
return result;
}
+//=============================================================================
+/*!
+ * ReadValue
+ */
+//=============================================================================
+TCollection_AsciiString GEOMImpl_IInsertOperations::ReadValue
+ (const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName)
+{
+ SetErrorCode(KO);
+
+ TCollection_AsciiString aValue, anError;
+
+ if (theFileName.IsEmpty() || theFormatName.IsEmpty() || theParameterName.IsEmpty()) return aValue;
+
+ Handle(TCollection_HAsciiString) aHLibName;
+ if (!IsSupported(Standard_True, theFormatName.SubString(1,4), aHLibName)) {
+ return aValue;
+ }
+ TCollection_AsciiString aLibName = aHLibName->String();
+
+ aValue = GEOMImpl_ImportDriver::ReadValue(theFileName, aLibName, theParameterName, anError);
+ if (anError.IsEmpty())
+ SetErrorCode(OK);
+ else
+ SetErrorCode(anError.ToCString());
+
+ return aValue;
+}
+
//=============================================================================
/*!
* ImportTranslators