Salome HOME
Remove unnecessary includes
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IInsertOperations.cxx
index 578ce9e52fccb144877a73ddbfd301a62c8a0255..cc09d461388588f4d8ffdf31787afe6349a8cec9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  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
@@ -41,7 +41,6 @@
 #include "GEOM_ISubShape.hxx"
 
 #include "utilities.h"
-#include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
 
 #include <TFunction_DriverTable.hxx>
  *  constructor
  */
 //=============================================================================
-GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
 {
   MESSAGE("GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations");
-  myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
-  myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
-  myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine(), GetDocID());
+  myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine());
+  myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine());
+  myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine());
 }
 
 //=============================================================================
@@ -105,7 +104,7 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::MakeCopy (Handle(GEOM_Object) th
   if (theOriginal.IsNull()) return NULL;
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
 
   //Add a Copy function for creation a copy object
   Handle(GEOM_Function) aFunction = aCopy->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITH_REF);
@@ -154,7 +153,7 @@ void GEOMImpl_IInsertOperations::Export
 
   if (theOriginal.IsNull()) return;
 
-  if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( GetDocID(), theOriginal, theFileName, theFormatName ) )
+  if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( theOriginal, theFileName, theFormatName ) )
     return;
   SetErrorCode(OK);
 }
@@ -173,7 +172,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IInsertOperations::Import
   if (theFileName.IsEmpty() || theFormatName.IsEmpty()) return NULL;
 
   Handle(TColStd_HSequenceOfTransient) aSeq =
-    GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( GetDocID(), theFormatName, theFileName );
+    GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( theFormatName, theFileName );
   SetErrorCode(OK);
   return aSeq;
 }
@@ -192,7 +191,7 @@ TCollection_AsciiString GEOMImpl_IInsertOperations::ReadValue
   TCollection_AsciiString aValue;
   if (theFileName.IsEmpty() || theFormatName.IsEmpty() || theParameterName.IsEmpty()) return aValue;
 
-  aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( GetDocID(), theFileName, theFormatName, theParameterName );
+  aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( theFileName, theFormatName, theParameterName );
 
   SetErrorCode(OK);
   return aValue;
@@ -208,7 +207,7 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::RestoreShape (std::istringstream
   SetErrorCode(KO);
 
   //Add a new result object
-  Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+  Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_COPY);
 
   //Add a Copy function
   Handle(GEOM_Function) aFunction = result->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF);
@@ -281,8 +280,8 @@ int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTe
   std::list<std::string>::const_iterator it;
   for (it = lines.begin(); it != lines.end(); ++it) {
     std::string line = *it;
-    int lenline = (line.size()/8 + (line.size()%8 ? 1 : 0)) * 8;
-    for (int i = 0; i < lenline/8; i++) {
+    size_t lenline = (line.size()/8 + (line.size()%8 ? 1 : 0)) * 8;
+    for (size_t i = 0; i < lenline/8; i++) {
       unsigned char byte = 0;
       for (int j = 0; j < 8; j++)
         byte = (byte << 1) + ( i*8+j < line.size() && line[i*8+j] != '0' ? 1 : 0 );
@@ -302,7 +301,7 @@ int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTe
   for (i = 1, bdit = bytedata.begin(); bdit != bytedata.end(); ++bdit, ++i)
     aTexture->SetValue(i, (Standard_Byte)(*bdit));
 
-  int aTextureId = GetEngine()->addTexture(GetDocID(), lenbytes*8, lines.size(), aTexture, theTextureFile);
+  int aTextureId = GetEngine()->addTexture(lenbytes*8, lines.size(), aTexture, theTextureFile);
   if (aTextureId > 0) SetErrorCode(OK);
   return aTextureId;
 }
@@ -311,7 +310,7 @@ int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight,
                                            const Handle(TColStd_HArray1OfByte)& theTexture)
 {
   SetErrorCode(KO);
-  int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture);
+  int aTextureId = GetEngine()->addTexture(theWidth, theHeight, theTexture);
   if (aTextureId > 0) SetErrorCode(OK);
   return aTextureId;
 }
@@ -329,7 +328,7 @@ Handle(TColStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theText
   if (theTextureId <= 0)
     return aTexture;
 
-  aTexture = GetEngine()->getTexture(GetDocID(), theTextureId, theWidth, theHeight, aFileName);
+  aTexture = GetEngine()->getTexture(theTextureId, theWidth, theHeight, aFileName);
 
   if (theWidth > 0 && theHeight > 0 && aTexture->Length() > 0) SetErrorCode(OK);
 
@@ -339,7 +338,7 @@ Handle(TColStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theText
 std::list<int> GEOMImpl_IInsertOperations::GetAllTextures()
 {
   SetErrorCode(KO);
-  std::list<int> id_list = GetEngine()->getAllTextures(GetDocID());
+  std::list<int> id_list = GetEngine()->getAllTextures();
   SetErrorCode(OK);
   return id_list;
 }
@@ -363,7 +362,7 @@ bool GEOMImpl_IInsertOperations::TransferData
 
   //Add a new Transfer Data object object
   Handle(GEOM_Object) aTDObj =
-    GetEngine()->AddObject(GetDocID(), GEOM_TRANSFER_DATA);
+    GetEngine()->AddObject(GEOM_TRANSFER_DATA);
 
   //Add a Transfer Data function for created object
   Handle(GEOM_Function) aFunction =