Salome HOME
0022616: [CEA 1038] Improve the quality of stl and vtk exports
authorvsr <vsr@opencascade.com>
Mon, 22 Sep 2014 07:41:20 +0000 (11:41 +0400)
committervsr <vsr@opencascade.com>
Mon, 22 Sep 2014 07:41:20 +0000 (11:41 +0400)
Additional modification to obsolete ImportFile() function, to return list of GEOM::GEOM_BaseObject, instead of list of GEOM::GEOM_Object, to properly handle fields.

idl/GEOM_Gen.idl
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_I/GEOM_IInsertOperations_i.cc
src/GEOM_I/GEOM_IInsertOperations_i.hh
src/GEOM_I_Superv/GEOM_Superv_i.cc

index 149bf96744ec5420bf3e7340c3144a141f4cb4c1..076f4fed4ce7cbf245c0547fc5105345d7af742d 100644 (file)
@@ -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.
index 8069f40fe70b09d605a5e76680a75a3adbdbaa91..e939d30f10bea24a0f4868cc1e1709a9284b23e0 100755 (executable)
@@ -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());
index 476e29ad716609daa10cdd9edb0a0f1fb9ae749e..5de4d1f23cc7fceb45880e270d95288995b34768 100644 (file)
@@ -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();
 }
index e06ffa08e34ffb88021ff1fe4e62b2e522a6a5cc..4a2b4f2ccccd00f86ae6dc33752d50569e73de0b 100644 (file)
@@ -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,
index 9070d8e9b97c8e2387d08d6c4c8472fa742185c9..867a5c6f7cea632c19746847fad64ae03b00bc4a 100644 (file)
@@ -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 ===========================