Additional modification to obsolete ImportFile() function, to return list of GEOM::GEOM_BaseObject, instead of list of GEOM::GEOM_Object, to properly handle fields.
* file length unit will be ignored (set to 'meter') and result model will be scaled.
* \return List of GEOM_Object, containing the created shape and groups of materials.
*/
- ListOfGO ImportFile (in string theFileName, in string theFormatName);
+ ListOfGBO ImportFile (in string theFileName, in string theFormatName);
/*!
* \brief Deprecated method. Use ReadValue (from the corresponding plugin) instead.
aFile.write(aBuffer, aFileStream->length());
aFile.close();
- GEOM::ListOfGO_var aObjects = aInsOp->ImportFile(aFullPath.c_str(), "XAO");
+ GEOM::ListOfGBO_var aObjects = aInsOp->ImportFile(aFullPath.c_str(), "XAO");
if ( aObjects->length() > 0 && aInsOp->IsDone() ) {
aResult->length(aObjects->length());
#include "Utils_ExceptHandlers.hxx"
#include "GEOM_Engine.hxx"
-#include "GEOM_Object.hxx"
+#include "GEOM_BaseObject.hxx"
#include <Basics_OCCTVersion.hxx>
* ImportFile
*/
//=============================================================================
-GEOM::ListOfGO* GEOM_IInsertOperations_i::ImportFile
+GEOM::ListOfGBO* GEOM_IInsertOperations_i::ImportFile
(const char* theFileName,
const char* theFormatName)
{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+ GEOM::ListOfGBO_var aSeq = new GEOM::ListOfGBO;
//Set a not done flag
GetOperations()->SetNotDone();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+ aSeq[i-1] = GetBaseObject(Handle(GEOM_BaseObject)::DownCast(aHSeq->Value(i)));
return aSeq._retn();
}
const char* theFileName,
const char* theFormatName);
- GEOM::ListOfGO* ImportFile (const char* theFileName,
- const char* theFormatName);
+ GEOM::ListOfGBO* ImportFile (const char* theFileName,
+ const char* theFormatName);
char* ReadValue (const char* theFileName,
const char* theFormatName,
beginService( " GEOM_Superv_i::ImportFile" );
MESSAGE("GEOM_Superv_i::ImportFile");
getInsOp();
- GEOM::ListOfGO* aSeq = myInsOp->ImportFile(theFileName, theFormatName);
- GEOM::GEOM_Object_ptr anObj;
+ GEOM::ListOfGBO_var aSeq = myInsOp->ImportFile(theFileName, theFormatName);
+ GEOM::GEOM_Object_var anObj;
if (aSeq->length() > 0) {
- anObj = aSeq->operator[](0);
+ anObj = GEOM::GEOM_Object::_narrow(aSeq[0]);
}
endService( " GEOM_Superv_i::ImportFile" );
- return anObj;
+ return anObj._retn();
}
//============================= TransformOperations ===========================