mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-25 17:00:35 +05:00
0022616: [CEA 1038] Improve the quality of stl and vtk exports
Additional modification to obsolete ImportFile() function, to return list of GEOM::GEOM_BaseObject, instead of list of GEOM::GEOM_Object, to properly handle fields.
This commit is contained in:
parent
b5e1dcdd78
commit
a1f6e9582d
@ -3720,7 +3720,7 @@ module GEOM
|
||||
* 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.
|
||||
|
@ -2967,7 +2967,7 @@ Engines::ListOfIdentifiers* GEOM_Gen_i::importData(
|
||||
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());
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "Utils_ExceptHandlers.hxx"
|
||||
|
||||
#include "GEOM_Engine.hxx"
|
||||
#include "GEOM_Object.hxx"
|
||||
#include "GEOM_BaseObject.hxx"
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
@ -121,11 +121,11 @@ void GEOM_IInsertOperations_i::Export
|
||||
* 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();
|
||||
@ -142,7 +142,7 @@ GEOM::ListOfGO* GEOM_IInsertOperations_i::ImportFile
|
||||
|
||||
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();
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ class GEOM_I_EXPORT GEOM_IInsertOperations_i :
|
||||
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,
|
||||
|
@ -1715,15 +1715,15 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportFile (const char* theFileName,
|
||||
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 ===========================
|
||||
|
Loading…
Reference in New Issue
Block a user