]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0020230: Memory performance improvement.
authorjfa <jfa@opencascade.com>
Tue, 14 Apr 2009 08:51:51 +0000 (08:51 +0000)
committerjfa <jfa@opencascade.com>
Tue, 14 Apr 2009 08:51:51 +0000 (08:51 +0000)
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_I/GEOM_IBlocksOperations_i.cc
src/GEOM_I/GEOM_IBooleanOperations_i.cc
src/GEOM_I/GEOM_ICurvesOperations_i.cc
src/GEOM_I/GEOM_IGroupOperations_i.cc
src/GEOM_I/GEOM_IHealingOperations_i.cc
src/GEOM_I/GEOM_IInsertOperations_i.cc
src/GEOM_I/GEOM_ILocalOperations_i.cc
src/GEOM_I/GEOM_IOperations_i.cc
src/GEOM_I/GEOM_IShapesOperations_i.cc
src/GEOM_I/GEOM_ITransformOperations_i.cc

index 9a0ee0d63d1119e1e7fbd5a97b30d72997ed2f7d..7dd05a5f74285b73598200e59e9dc1781e72e133 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #ifdef WNT
 #pragma warning( disable:4786 )
 #endif
@@ -1245,8 +1245,10 @@ GEOM::GEOM_IGroupOperations_ptr GEOM_Gen_i::GetIGroupOperations(CORBA::Long theS
 GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape (GEOM::GEOM_Object_ptr theMainShape,
                                               const GEOM::ListOfLong& theIndices)
 {
-  if(theMainShape == NULL || theIndices.length() < 1) return GEOM::GEOM_Object::_nil();
-  Handle(GEOM_Object) aMainsShape = _impl->GetObject(theMainShape->GetStudyID(), theMainShape->GetEntry());
+  if (CORBA::is_nil(theMainShape) || theIndices.length() < 1)
+    return GEOM::GEOM_Object::_nil();
+  CORBA::String_var entry = theMainShape->GetEntry();
+  Handle(GEOM_Object) aMainsShape = _impl->GetObject(theMainShape->GetStudyID(), entry);
   if (aMainsShape.IsNull()) return GEOM::GEOM_Object::_nil();
 
   Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1, theIndices.length());
@@ -1306,7 +1308,7 @@ GEOM::GEOM_Object_ptr GEOM_Gen_i::GetObject (CORBA::Long theStudyID, const char*
 {
   GEOM::GEOM_Object_var obj;
   Handle(GEOM_Object) handle_object = _impl->GetObject(theStudyID, (char*)theEntry);
-  if (handle_object.IsNull()) return NULL;
+  if (handle_object.IsNull()) return obj._retn();
 
   TCollection_AsciiString stringIOR = handle_object->GetIOR();
   if (stringIOR.Length() > 1) {
index 093df705a393a052fb8027c449650a8143b106a7..9372c6698996f930c01d1b151d5e2fc029622ce1 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include <Standard_Stream.hxx>
 
 #include "GEOM_IBlocksOperations_i.hh"
@@ -39,8 +39,8 @@
  */
 //=============================================================================
 GEOM_IBlocksOperations_i::GEOM_IBlocksOperations_i (PortableServer::POA_ptr thePOA,
-                                                   GEOM::GEOM_Gen_ptr theEngine,
-                                                   ::GEOMImpl_IBlocksOperations* theImpl)
+                                                    GEOM::GEOM_Gen_ptr theEngine,
+                                                    ::GEOMImpl_IBlocksOperations* theImpl)
 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_IBlocksOperations_i::GEOM_IBlocksOperations_i");
@@ -64,25 +64,18 @@ GEOM_IBlocksOperations_i::~GEOM_IBlocksOperations_i()
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeQuad
                (GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
-               GEOM::GEOM_Object_ptr theEdge3, GEOM::GEOM_Object_ptr theEdge4)
+                GEOM::GEOM_Object_ptr theEdge3, GEOM::GEOM_Object_ptr theEdge4)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theEdge1 == NULL || theEdge2 == NULL ||
-      theEdge3 == NULL || theEdge4 == NULL) return aGEOMObject._retn();
-
   //Get the reference edges
-  Handle(GEOM_Object) anEdge1 = GetOperations()->GetEngine()->GetObject
-    (theEdge1->GetStudyID(), theEdge1->GetEntry());
-  Handle(GEOM_Object) anEdge2 = GetOperations()->GetEngine()->GetObject
-    (theEdge2->GetStudyID(), theEdge2->GetEntry());
-  Handle(GEOM_Object) anEdge3 = GetOperations()->GetEngine()->GetObject
-    (theEdge3->GetStudyID(), theEdge3->GetEntry());
-  Handle(GEOM_Object) anEdge4 = GetOperations()->GetEngine()->GetObject
-    (theEdge4->GetStudyID(), theEdge4->GetEntry());
+  Handle(GEOM_Object) anEdge1 = GetObjectImpl(theEdge1);
+  Handle(GEOM_Object) anEdge2 = GetObjectImpl(theEdge2);
+  Handle(GEOM_Object) anEdge3 = GetObjectImpl(theEdge3);
+  Handle(GEOM_Object) anEdge4 = GetObjectImpl(theEdge4);
 
   if (anEdge1.IsNull() || anEdge2.IsNull() ||
       anEdge3.IsNull() || anEdge4.IsNull()) return aGEOMObject._retn();
@@ -109,13 +102,9 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeQuad2Edges
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theEdge1 == NULL || theEdge2 == NULL) return aGEOMObject._retn();
-
   //Get the reference edges
-  Handle(GEOM_Object) anEdge1 = GetOperations()->GetEngine()->GetObject
-    (theEdge1->GetStudyID(), theEdge1->GetEntry());
-  Handle(GEOM_Object) anEdge2 = GetOperations()->GetEngine()->GetObject
-    (theEdge2->GetStudyID(), theEdge2->GetEntry());
+  Handle(GEOM_Object) anEdge1 = GetObjectImpl(theEdge1);
+  Handle(GEOM_Object) anEdge2 = GetObjectImpl(theEdge2);
 
   if (anEdge1.IsNull() || anEdge2.IsNull()) return aGEOMObject._retn();
 
@@ -135,25 +124,18 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeQuad2Edges
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeQuad4Vertices
                       (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
-                      GEOM::GEOM_Object_ptr thePnt3, GEOM::GEOM_Object_ptr thePnt4)
+                       GEOM::GEOM_Object_ptr thePnt3, GEOM::GEOM_Object_ptr thePnt4)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (thePnt1 == NULL || thePnt2 == NULL ||
-      thePnt3 == NULL || thePnt4 == NULL) return aGEOMObject._retn();
-
   //Get the reference points
-  Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
-    (thePnt1->GetStudyID(), thePnt1->GetEntry());
-  Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
-    (thePnt2->GetStudyID(), thePnt2->GetEntry());
-  Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
-    (thePnt3->GetStudyID(), thePnt3->GetEntry());
-  Handle(GEOM_Object) aPnt4 = GetOperations()->GetEngine()->GetObject
-    (thePnt4->GetStudyID(), thePnt4->GetEntry());
+  Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
+  Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
+  Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
+  Handle(GEOM_Object) aPnt4 = GetObjectImpl(thePnt4);
 
   if (aPnt1.IsNull() || aPnt2.IsNull() ||
       aPnt3.IsNull() || aPnt4.IsNull()) return aGEOMObject._retn();
@@ -174,31 +156,21 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeQuad4Vertices
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeHexa
                (GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
-               GEOM::GEOM_Object_ptr theFace3, GEOM::GEOM_Object_ptr theFace4,
-               GEOM::GEOM_Object_ptr theFace5, GEOM::GEOM_Object_ptr theFace6)
+                GEOM::GEOM_Object_ptr theFace3, GEOM::GEOM_Object_ptr theFace4,
+                GEOM::GEOM_Object_ptr theFace5, GEOM::GEOM_Object_ptr theFace6)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theFace1 == NULL || theFace2 == NULL ||
-      theFace3 == NULL || theFace4 == NULL ||
-      theFace5 == NULL || theFace6 == NULL) return aGEOMObject._retn();
-
   //Get the reference Faces
-  Handle(GEOM_Object) anFace1 = GetOperations()->GetEngine()->GetObject
-    (theFace1->GetStudyID(), theFace1->GetEntry());
-  Handle(GEOM_Object) anFace2 = GetOperations()->GetEngine()->GetObject
-    (theFace2->GetStudyID(), theFace2->GetEntry());
-  Handle(GEOM_Object) anFace3 = GetOperations()->GetEngine()->GetObject
-    (theFace3->GetStudyID(), theFace3->GetEntry());
-  Handle(GEOM_Object) anFace4 = GetOperations()->GetEngine()->GetObject
-    (theFace4->GetStudyID(), theFace4->GetEntry());
-  Handle(GEOM_Object) anFace5 = GetOperations()->GetEngine()->GetObject
-    (theFace5->GetStudyID(), theFace5->GetEntry());
-  Handle(GEOM_Object) anFace6 = GetOperations()->GetEngine()->GetObject
-    (theFace6->GetStudyID(), theFace6->GetEntry());
+  Handle(GEOM_Object) anFace1 = GetObjectImpl(theFace1);
+  Handle(GEOM_Object) anFace2 = GetObjectImpl(theFace2);
+  Handle(GEOM_Object) anFace3 = GetObjectImpl(theFace3);
+  Handle(GEOM_Object) anFace4 = GetObjectImpl(theFace4);
+  Handle(GEOM_Object) anFace5 = GetObjectImpl(theFace5);
+  Handle(GEOM_Object) anFace6 = GetObjectImpl(theFace6);
 
   if (anFace1.IsNull() || anFace2.IsNull() ||
       anFace3.IsNull() || anFace4.IsNull() ||
@@ -226,13 +198,9 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeHexa2Faces
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theFace1 == NULL || theFace2 == NULL) return aGEOMObject._retn();
-
   //Get the reference Faces
-  Handle(GEOM_Object) anFace1 = GetOperations()->GetEngine()->GetObject
-    (theFace1->GetStudyID(), theFace1->GetEntry());
-  Handle(GEOM_Object) anFace2 = GetOperations()->GetEngine()->GetObject
-    (theFace2->GetStudyID(), theFace2->GetEntry());
+  Handle(GEOM_Object) anFace1 = GetObjectImpl(theFace1);
+  Handle(GEOM_Object) anFace2 = GetObjectImpl(theFace2);
 
   if (anFace1.IsNull() || anFace2.IsNull()) return aGEOMObject._retn();
 
@@ -258,12 +226,8 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeBlockCompound
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCompound == NULL) return aGEOMObject._retn();
-
   //Get the reference Compound
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
-
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return aGEOMObject._retn();
 
   //Create the Blocks Compound
@@ -281,22 +245,18 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeBlockCompound
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetPoint (GEOM::GEOM_Object_ptr theShape,
-                                                         const CORBA::Double   theX,
-                                                         const CORBA::Double   theY,
-                                                         const CORBA::Double   theZ,
-                                                         const CORBA::Double   theEpsilon)
+                                                          const CORBA::Double   theX,
+                                                          const CORBA::Double   theY,
+                                                          const CORBA::Double   theZ,
+                                                          const CORBA::Double   theEpsilon)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
   if (aShape.IsNull()) return aGEOMObject._retn();
 
   //Create the Point
@@ -314,24 +274,18 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetPoint (GEOM::GEOM_Object_ptr
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetEdge (GEOM::GEOM_Object_ptr theShape,
-                                                        GEOM::GEOM_Object_ptr thePoint1,
-                                                        GEOM::GEOM_Object_ptr thePoint2)
+                                                         GEOM::GEOM_Object_ptr thePoint1,
+                                                         GEOM::GEOM_Object_ptr thePoint2)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL ||
-      thePoint1 == NULL || thePoint2 == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aPoint1 = GetOperations()->GetEngine()->GetObject
-    (thePoint1->GetStudyID(), thePoint1->GetEntry());
-  Handle(GEOM_Object) aPoint2 = GetOperations()->GetEngine()->GetObject
-    (thePoint2->GetStudyID(), thePoint2->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
+  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
 
   if (aShape.IsNull() ||
       aPoint1.IsNull() || aPoint2.IsNull()) return aGEOMObject._retn();
@@ -351,20 +305,16 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetEdge (GEOM::GEOM_Object_ptr t
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
-                                                                 GEOM::GEOM_Object_ptr thePoint)
+                                                                  GEOM::GEOM_Object_ptr thePoint)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || thePoint == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
-    (thePoint->GetStudyID(), thePoint->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
 
   if (aShape.IsNull() || aPoint.IsNull()) return aGEOMObject._retn();
 
@@ -384,31 +334,22 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetEdgeNearPoint (GEOM::GEOM_Obj
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByPoints
                                               (GEOM::GEOM_Object_ptr theShape,
-                                              GEOM::GEOM_Object_ptr thePoint1,
-                                              GEOM::GEOM_Object_ptr thePoint2,
-                                              GEOM::GEOM_Object_ptr thePoint3,
-                                              GEOM::GEOM_Object_ptr thePoint4)
+                                               GEOM::GEOM_Object_ptr thePoint1,
+                                               GEOM::GEOM_Object_ptr thePoint2,
+                                               GEOM::GEOM_Object_ptr thePoint3,
+                                               GEOM::GEOM_Object_ptr thePoint4)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL ||
-      thePoint1 == NULL || thePoint2 == NULL ||
-      thePoint3 == NULL || thePoint4 == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aPoint1 = GetOperations()->GetEngine()->GetObject
-    (thePoint1->GetStudyID(), thePoint1->GetEntry());
-  Handle(GEOM_Object) aPoint2 = GetOperations()->GetEngine()->GetObject
-    (thePoint2->GetStudyID(), thePoint2->GetEntry());
-  Handle(GEOM_Object) aPoint3 = GetOperations()->GetEngine()->GetObject
-    (thePoint3->GetStudyID(), thePoint3->GetEntry());
-  Handle(GEOM_Object) aPoint4 = GetOperations()->GetEngine()->GetObject
-    (thePoint4->GetStudyID(), thePoint4->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
+  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
+  Handle(GEOM_Object) aPoint3 = GetObjectImpl(thePoint3);
+  Handle(GEOM_Object) aPoint4 = GetObjectImpl(thePoint4);
 
   if (aShape.IsNull() ||
       aPoint1.IsNull() || aPoint2.IsNull() ||
@@ -430,24 +371,18 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByPoints
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByEdges
                                                (GEOM::GEOM_Object_ptr theShape,
-                                               GEOM::GEOM_Object_ptr theEdge1,
-                                               GEOM::GEOM_Object_ptr theEdge2)
+                                                GEOM::GEOM_Object_ptr theEdge1,
+                                                GEOM::GEOM_Object_ptr theEdge2)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL ||
-      theEdge1 == NULL || theEdge2 == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) anEdge1 = GetOperations()->GetEngine()->GetObject
-    (theEdge1->GetStudyID(), theEdge1->GetEntry());
-  Handle(GEOM_Object) anEdge2 = GetOperations()->GetEngine()->GetObject
-    (theEdge2->GetStudyID(), theEdge2->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) anEdge1 = GetObjectImpl(theEdge1);
+  Handle(GEOM_Object) anEdge2 = GetObjectImpl(theEdge2);
 
   if (aShape.IsNull() ||
       anEdge1.IsNull() || anEdge2.IsNull()) return aGEOMObject._retn();
@@ -467,20 +402,16 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByEdges
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetOppositeFace (GEOM::GEOM_Object_ptr theShape,
-                                                                GEOM::GEOM_Object_ptr theFace)
+                                                                 GEOM::GEOM_Object_ptr theFace)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theFace == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aFace = GetOperations()->GetEngine()->GetObject
-    (theFace->GetStudyID(), theFace->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
 
   if (aShape.IsNull() || aFace.IsNull()) return aGEOMObject._retn();
 
@@ -499,20 +430,16 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetOppositeFace (GEOM::GEOM_Obje
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
-                                                                 GEOM::GEOM_Object_ptr thePoint)
+                                                                  GEOM::GEOM_Object_ptr thePoint)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || thePoint == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
-    (thePoint->GetStudyID(), thePoint->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
 
   if (aShape.IsNull() || aPoint.IsNull()) return aGEOMObject._retn();
 
@@ -531,20 +458,16 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceNearPoint (GEOM::GEOM_Obj
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByNormale (GEOM::GEOM_Object_ptr theShape,
-                                                                 GEOM::GEOM_Object_ptr theVector)
+                                                                  GEOM::GEOM_Object_ptr theVector)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theVector == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject
-    (theVector->GetStudyID(), theVector->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
 
   if (aShape.IsNull() || aVector.IsNull()) return aGEOMObject._retn();
 
@@ -564,20 +487,16 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByNormale (GEOM::GEOM_Obj
 //=============================================================================
 GEOM::ListOfGO* GEOM_IBlocksOperations_i::ExplodeCompoundOfBlocks
                                           (GEOM::GEOM_Object_ptr theCompound,
-                                          const CORBA::Long     theMinNbFaces,
-                                          const CORBA::Long     theMaxNbFaces)
+                                           const CORBA::Long     theMinNbFaces,
+                                           const CORBA::Long     theMaxNbFaces)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCompound == NULL) return aSeq._retn();
-
   //Get the reference Compound
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
-
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return aSeq._retn();
 
   //Explode
@@ -601,9 +520,9 @@ GEOM::ListOfGO* GEOM_IBlocksOperations_i::ExplodeCompoundOfBlocks
 //=============================================================================
 CORBA::Boolean GEOM_IBlocksOperations_i::IsCompoundOfBlocks
                                           (GEOM::GEOM_Object_ptr theCompound,
-                                          const CORBA::Long     theMinNbFaces,
-                                          const CORBA::Long     theMaxNbFaces,
-                                          CORBA::Long&          theNbBlocks)
+                                           const CORBA::Long     theMinNbFaces,
+                                           const CORBA::Long     theMaxNbFaces,
+                                           CORBA::Long&          theNbBlocks)
 {
   theNbBlocks = 0;
   CORBA::Boolean isComp = false;
@@ -611,20 +530,16 @@ CORBA::Boolean GEOM_IBlocksOperations_i::IsCompoundOfBlocks
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCompound == NULL) return isComp;
-
   //Get the reference Compound
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
-
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return isComp;
 
   //Check
   Standard_Integer nbBlocks = 0;
   isComp = GetOperations()->IsCompoundOfBlocks(aCompound,
-                                              theMinNbFaces,
-                                              theMaxNbFaces,
-                                              nbBlocks);
+                                               theMinNbFaces,
+                                               theMaxNbFaces,
+                                               nbBlocks);
   if (!GetOperations()->IsDone())
     return isComp;
 
@@ -639,19 +554,15 @@ CORBA::Boolean GEOM_IBlocksOperations_i::IsCompoundOfBlocks
 //=============================================================================
 CORBA::Boolean GEOM_IBlocksOperations_i::CheckCompoundOfBlocks
                                           (GEOM::GEOM_Object_ptr theCompound,
-                                          GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors)
+                                           GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors)
 {
   CORBA::Boolean isComp = false;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCompound == NULL) return isComp;
-
   //Get the reference Compound
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
-
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return isComp;
 
   //Check
@@ -722,12 +633,10 @@ CORBA::Boolean GEOM_IBlocksOperations_i::CheckCompoundOfBlocks
 //=============================================================================
 char* GEOM_IBlocksOperations_i::PrintBCErrors
                       (GEOM::GEOM_Object_ptr theCompound,
-                      const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors)
+                       const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors)
 {
   //Get the reference Compound
-  if (theCompound == NULL) return NULL;
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return NULL;
 
   // Convert the errors sequence
@@ -770,7 +679,7 @@ char* GEOM_IBlocksOperations_i::PrintBCErrors
   }
 
   TCollection_AsciiString aDescr = GetOperations()->PrintBCErrors(aCompound, anErrors);
-  return CORBA::string_dup(aDescr.ToCString());    
+  return CORBA::string_dup(aDescr.ToCString());
 }
 
 //=============================================================================
@@ -785,12 +694,8 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::RemoveExtraEdges (GEOM::GEOM_Obj
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
   if (aShape.IsNull()) return aGEOMObject._retn();
 
   //Get the result
@@ -814,12 +719,8 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::CheckAndImprove (GEOM::GEOM_Obje
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCompound == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
-
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return aGEOMObject._retn();
 
   //Get the result
@@ -837,20 +738,16 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::CheckAndImprove (GEOM::GEOM_Obje
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
-                                                                  GEOM::GEOM_Object_ptr thePoint)
+                                                                   GEOM::GEOM_Object_ptr thePoint)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCompound == NULL || thePoint == NULL) return aGEOMObject._retn();
-
   //Get the reference Objects
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
-  Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
-    (thePoint->GetStudyID(), thePoint->GetEntry());
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
+  Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
 
   if (aCompound.IsNull() || aPoint.IsNull()) return aGEOMObject._retn();
 
@@ -869,19 +766,15 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetBlockNearPoint (GEOM::GEOM_Ob
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
-                                                                const GEOM::ListOfGO& theParts)
+                                                                 const GEOM::ListOfGO& theParts)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCompound == NULL) return aGEOMObject._retn();
-
   //Get the reference Compound
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
-
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return aGEOMObject._retn();
 
   //Get the parts
@@ -890,9 +783,7 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetBlockByParts (GEOM::GEOM_Obje
 
   aLen = theParts.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theParts[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theParts[ind]->GetStudyID(), theParts[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theParts[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aParts->Append(aSh);
   }
@@ -912,19 +803,15 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetBlockByParts (GEOM::GEOM_Obje
  */
 //=============================================================================
 GEOM::ListOfGO* GEOM_IBlocksOperations_i::GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
-                                                           const GEOM::ListOfGO& theParts)
+                                                            const GEOM::ListOfGO& theParts)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCompound == NULL) return aSeq._retn();
-
   //Get the reference Compound
-  Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
-    (theCompound->GetStudyID(), theCompound->GetEntry());
-
+  Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return aSeq._retn();
 
   //Get the parts
@@ -933,9 +820,7 @@ GEOM::ListOfGO* GEOM_IBlocksOperations_i::GetBlocksByParts (GEOM::GEOM_Object_pt
 
   aLen = theParts.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theParts[ind] == NULL) return aSeq._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theParts[ind]->GetStudyID(), theParts[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theParts[ind]);
     if (aSh.IsNull()) return aSeq._retn();
     aParts->Append(aSh);
   }
@@ -961,29 +846,25 @@ GEOM::ListOfGO* GEOM_IBlocksOperations_i::GetBlocksByParts (GEOM::GEOM_Object_pt
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeMultiTransformation1D
                                               (GEOM::GEOM_Object_ptr theBlock,
-                                              const CORBA::Long     theDirFace1,
-                                              const CORBA::Long     theDirFace2,
-                                              const CORBA::Long     theNbTimes)
+                                               const CORBA::Long     theDirFace1,
+                                               const CORBA::Long     theDirFace2,
+                                               const CORBA::Long     theNbTimes)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-   //Set a not done flag
+  //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theBlock == NULL) return aGEOMObject._retn();
-
-   //Get the object itself and the vector of translation
-   Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject
-     (theBlock->GetStudyID(), theBlock->GetEntry());
-
-   if (aBasicObject.IsNull()) return aGEOMObject._retn();
+  //Get the object itself and the vector of translation
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theBlock);
+  if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
-   //Perform the transformation
-   Handle(GEOM_Object) anObject = GetOperations()->MakeMultiTransformation1D
-     (aBasicObject, theDirFace1, theDirFace2, theNbTimes);
-   if (!GetOperations()->IsDone() || anObject.IsNull())  return aGEOMObject._retn();
+  //Perform the transformation
+  Handle(GEOM_Object) anObject = GetOperations()->MakeMultiTransformation1D
+    (aBasicObject, theDirFace1, theDirFace2, theNbTimes);
+  if (!GetOperations()->IsDone() || anObject.IsNull())  return aGEOMObject._retn();
 
-   return GetObject(anObject);
+  return GetObject(anObject);
 }
 
 //=============================================================================
@@ -993,24 +874,20 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeMultiTransformation1D
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeMultiTransformation2D
                                            (GEOM::GEOM_Object_ptr theBlock,
-                                           const CORBA::Long     theDirFace1U,
-                                           const CORBA::Long     theDirFace2U,
-                                           const CORBA::Long     theNbTimesU,
-                                           const CORBA::Long     theDirFace1V,
-                                           const CORBA::Long     theDirFace2V,
-                                           const CORBA::Long     theNbTimesV)
+                                            const CORBA::Long     theDirFace1U,
+                                            const CORBA::Long     theDirFace2U,
+                                            const CORBA::Long     theNbTimesU,
+                                            const CORBA::Long     theDirFace1V,
+                                            const CORBA::Long     theDirFace2V,
+                                            const CORBA::Long     theNbTimesV)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theBlock == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject
-    (theBlock->GetStudyID(), theBlock->GetEntry());
-
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theBlock);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Perform the transformation
@@ -1035,12 +912,8 @@ GEOM::ListOfGO* GEOM_IBlocksOperations_i::Propagate (GEOM::GEOM_Object_ptr theSh
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL) return aSeq._retn();
-
   //Get the reference Shape
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
   if (aShape.IsNull()) return aSeq._retn();
 
   //Get the Propagation chains
index cceef3727226aa55577f05f58f1f5ab3c65b82bf..7012ffa3bb4e3bfe69b0b40c54ef719f598a56e8 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include <Standard_Stream.hxx>
 
 #include "GEOM_IBooleanOperations_i.hh"
@@ -37,8 +37,8 @@
  */
 //=============================================================================
 GEOM_IBooleanOperations_i::GEOM_IBooleanOperations_i (PortableServer::POA_ptr thePOA,
-                                                     GEOM::GEOM_Gen_ptr theEngine,
-                                                     ::GEOMImpl_IBooleanOperations* theImpl)
+                                                      GEOM::GEOM_Gen_ptr theEngine,
+                                                      ::GEOMImpl_IBooleanOperations* theImpl)
 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_IBooleanOperations_i::GEOM_IBooleanOperations_i");
@@ -62,23 +62,17 @@ GEOM_IBooleanOperations_i::~GEOM_IBooleanOperations_i()
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeBoolean
                                                  (GEOM::GEOM_Object_ptr theShape1,
-                                                 GEOM::GEOM_Object_ptr theShape2,
-                                                 CORBA::Long           theOp)
+                                                  GEOM::GEOM_Object_ptr theShape2,
+                                                  CORBA::Long           theOp)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape1 == NULL || theShape2 == NULL) return aGEOMObject._retn();
-
   //Get the reference shapes
-  CORBA::String_var entry=theShape1->GetEntry();
-  Handle(GEOM_Object) aSh1 = GetOperations()->GetEngine()->GetObject
-    (theShape1->GetStudyID(), entry);
-  entry=theShape2->GetEntry();
-  Handle(GEOM_Object) aSh2 = GetOperations()->GetEngine()->GetObject
-    (theShape2->GetStudyID(), entry);
+  Handle(GEOM_Object) aSh1 = GetObjectImpl(theShape1);
+  Handle(GEOM_Object) aSh2 = GetObjectImpl(theShape2);
 
   if (aSh1.IsNull() || aSh2.IsNull()) return aGEOMObject._retn();
 
@@ -97,13 +91,13 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeBoolean
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
                                       (const GEOM::ListOfGO&   theShapes,
-                                      const GEOM::ListOfGO&   theTools,
-                                      const GEOM::ListOfGO&   theKeepIns,
-                                      const GEOM::ListOfGO&   theRemoveIns,
-                                      CORBA::Short            theLimit,
-                                      CORBA::Boolean          theRemoveWebs,
-                                      const GEOM::ListOfLong& theMaterials,
-                                      CORBA::Short theKeepNonlimitShapes)
+                                       const GEOM::ListOfGO&   theTools,
+                                       const GEOM::ListOfGO&   theKeepIns,
+                                       const GEOM::ListOfGO&   theRemoveIns,
+                                       CORBA::Short            theLimit,
+                                       CORBA::Boolean          theRemoveWebs,
+                                       const GEOM::ListOfLong& theMaterials,
+                                       CORBA::Short theKeepNonlimitShapes)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -120,9 +114,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
   //Get the shapes
   aLen = theShapes.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theShapes[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theShapes[ind]->GetStudyID(), theShapes[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aShapes->Append(aSh);
   }
@@ -130,9 +122,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
   //Get the tools
   aLen = theTools.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theTools[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theTools[ind]->GetStudyID(), theTools[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theTools[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aTools->Append(aSh);
   }
@@ -140,9 +130,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
   //Get the keep inside shapes
   aLen = theKeepIns.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theKeepIns[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theKeepIns[ind]->GetStudyID(), theKeepIns[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theKeepIns[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aKeepIns->Append(aSh);
   }
@@ -150,9 +138,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
   //Get the remove inside shapes
   aLen = theRemoveIns.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theRemoveIns[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theRemoveIns[ind]->GetStudyID(), theRemoveIns[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theRemoveIns[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aRemIns->Append(aSh);
   }
@@ -169,9 +155,9 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
   // Make Partition
   Handle(GEOM_Object) anObject =
     GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
-                                  theLimit, theRemoveWebs, aMaterials,
-                                  theKeepNonlimitShapes,
-                                  /*PerformSelfIntersections*/Standard_True);
+                                   theLimit, theRemoveWebs, aMaterials,
+                                   theKeepNonlimitShapes,
+                                   /*PerformSelfIntersections*/Standard_True);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -185,13 +171,13 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersectedShape
                                       (const GEOM::ListOfGO&   theShapes,
-                                      const GEOM::ListOfGO&   theTools,
-                                      const GEOM::ListOfGO&   theKeepIns,
-                                      const GEOM::ListOfGO&   theRemoveIns,
-                                      CORBA::Short            theLimit,
-                                      CORBA::Boolean          theRemoveWebs,
-                                      const GEOM::ListOfLong& theMaterials,
-                                      CORBA::Short theKeepNonlimitShapes)
+                                       const GEOM::ListOfGO&   theTools,
+                                       const GEOM::ListOfGO&   theKeepIns,
+                                       const GEOM::ListOfGO&   theRemoveIns,
+                                       CORBA::Short            theLimit,
+                                       CORBA::Boolean          theRemoveWebs,
+                                       const GEOM::ListOfLong& theMaterials,
+                                       CORBA::Short theKeepNonlimitShapes)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -208,9 +194,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
   //Get the shapes
   aLen = theShapes.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theShapes[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theShapes[ind]->GetStudyID(), theShapes[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aShapes->Append(aSh);
   }
@@ -218,9 +202,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
   //Get the tools
   aLen = theTools.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theTools[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theTools[ind]->GetStudyID(), theTools[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theTools[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aTools->Append(aSh);
   }
@@ -228,9 +210,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
   //Get the keep inside shapes
   aLen = theKeepIns.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theKeepIns[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theKeepIns[ind]->GetStudyID(), theKeepIns[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theKeepIns[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aKeepIns->Append(aSh);
   }
@@ -238,9 +218,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
   //Get the remove inside shapes
   aLen = theRemoveIns.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theRemoveIns[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theRemoveIns[ind]->GetStudyID(), theRemoveIns[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theRemoveIns[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aRemIns->Append(aSh);
   }
@@ -257,9 +235,9 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
   // Make Partition
   Handle(GEOM_Object) anObject =
     GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
-                                  theLimit, theRemoveWebs, aMaterials,
-                                  theKeepNonlimitShapes,
-                                  /*PerformSelfIntersections*/Standard_False);
+                                   theLimit, theRemoveWebs, aMaterials,
+                                   theKeepNonlimitShapes,
+                                   /*PerformSelfIntersections*/Standard_False);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -273,20 +251,16 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeHalfPartition
                                                  (GEOM::GEOM_Object_ptr theShape,
-                                                 GEOM::GEOM_Object_ptr thePlane)
+                                                  GEOM::GEOM_Object_ptr thePlane)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || thePlane == NULL) return aGEOMObject._retn();
-
   //Get the reference shapes
-  Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aPl = GetOperations()->GetEngine()->GetObject
-    (thePlane->GetStudyID(), thePlane->GetEntry());
+  Handle(GEOM_Object) aSh = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aPl = GetObjectImpl(thePlane);
 
   if (aSh.IsNull() || aPl.IsNull()) return aGEOMObject._retn();
 
index 572a2918b97f2eb0533ab090f012ccc29915623d..5d47fcdf9259f2d4e516a9e52ca5da342beeffb7 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include <Standard_Stream.hxx>
 
 #include "GEOM_ICurvesOperations_i.hh"
@@ -35,8 +35,8 @@
  */
 //=============================================================================
 GEOM_ICurvesOperations_i::GEOM_ICurvesOperations_i (PortableServer::POA_ptr thePOA,
-                                                   GEOM::GEOM_Gen_ptr theEngine,
-                                                   ::GEOMImpl_ICurvesOperations* theImpl)
+                                                    GEOM::GEOM_Gen_ptr theEngine,
+                                                    ::GEOMImpl_ICurvesOperations* theImpl)
 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_ICurvesOperations_i::GEOM_ICurvesOperations_i");
@@ -60,7 +60,7 @@ GEOM_ICurvesOperations_i::~GEOM_ICurvesOperations_i()
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCirclePntVecR
                       (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
-                      CORBA::Double theR)
+                       CORBA::Double theR)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -74,13 +74,11 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCirclePntVecR
   //Get the arguments
   Handle(GEOM_Object) aPnt, aVec;
   if (!CORBA::is_nil(thePnt)) {
-    aPnt = GetOperations()->GetEngine()->GetObject
-      (thePnt->GetStudyID(), thePnt->GetEntry());
+    aPnt = GetObjectImpl(thePnt);
     if (aPnt.IsNull()) return aGEOMObject._retn();
   }
   if (!CORBA::is_nil(theVec)) {
-    aVec = GetOperations()->GetEngine()->GetObject
-      (theVec->GetStudyID(), theVec->GetEntry());
+    aVec = GetObjectImpl(theVec);
     if (aVec.IsNull()) return aGEOMObject._retn();
   }
 
@@ -100,22 +98,17 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCirclePntVecR
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCircleThreePnt
                       (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
-                      GEOM::GEOM_Object_ptr thePnt3)
+                       GEOM::GEOM_Object_ptr thePnt3)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL) return aGEOMObject._retn();
-
   //Get the reference points
-  Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
-    (thePnt1->GetStudyID(), thePnt1->GetEntry());
-  Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
-    (thePnt2->GetStudyID(), thePnt2->GetEntry());
-  Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
-    (thePnt3->GetStudyID(), thePnt3->GetEntry());
+  Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
+  Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
+  Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
 
   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
 
@@ -135,22 +128,17 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCircleThreePnt
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCircleCenter2Pnt
                       (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
-                      GEOM::GEOM_Object_ptr thePnt3)
+                       GEOM::GEOM_Object_ptr thePnt3)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL) return aGEOMObject._retn();
-
   //Get the reference points
-  Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
-    (thePnt1->GetStudyID(), thePnt1->GetEntry());
-  Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
-    (thePnt2->GetStudyID(), thePnt2->GetEntry());
-  Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
-    (thePnt3->GetStudyID(), thePnt3->GetEntry());
+  Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
+  Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
+  Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
 
   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
 
@@ -169,7 +157,7 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeCircleCenter2Pnt
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipse
                       (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
-                      CORBA::Double theRMajor, double theRMinor)
+                       CORBA::Double theRMajor, double theRMinor)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -183,13 +171,11 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipse
   //Get the arguments
   Handle(GEOM_Object) aPnt, aVec, aVecMaj;
   if (!CORBA::is_nil(thePnt)) {
-    aPnt = GetOperations()->GetEngine()->GetObject
-      (thePnt->GetStudyID(), thePnt->GetEntry());
+    aPnt = GetObjectImpl(thePnt);
     if (aPnt.IsNull()) return aGEOMObject._retn();
   }
   if (!CORBA::is_nil(theVec)) {
-    aVec = GetOperations()->GetEngine()->GetObject
-      (theVec->GetStudyID(), theVec->GetEntry());
+    aVec = GetObjectImpl(theVec);
     if (aVec.IsNull()) return aGEOMObject._retn();
   }
 
@@ -209,8 +195,8 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipse
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipseVec
                       (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
-                      CORBA::Double theRMajor, double theRMinor,
-                      GEOM::GEOM_Object_ptr theVecMaj)
+                       CORBA::Double theRMajor, double theRMinor,
+                       GEOM::GEOM_Object_ptr theVecMaj)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -225,18 +211,15 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipseVec
   //Get the arguments
   Handle(GEOM_Object) aPnt, aVec, aVecMaj;
   if (!CORBA::is_nil(thePnt)) {
-    aPnt = GetOperations()->GetEngine()->GetObject
-      (thePnt->GetStudyID(), thePnt->GetEntry());
+    aPnt = GetObjectImpl(thePnt);
     if (aPnt.IsNull()) return aGEOMObject._retn();
   }
   if (!CORBA::is_nil(theVec)) {
-    aVec = GetOperations()->GetEngine()->GetObject
-      (theVec->GetStudyID(), theVec->GetEntry());
+    aVec = GetObjectImpl(theVec);
     if (aVec.IsNull()) return aGEOMObject._retn();
   }
   if (!CORBA::is_nil(theVecMaj)) {
-    aVecMaj = GetOperations()->GetEngine()->GetObject
-      (theVecMaj->GetStudyID(), theVecMaj->GetEntry());
+    aVecMaj = GetObjectImpl(theVecMaj);
     if (aVecMaj.IsNull()) return aGEOMObject._retn();
   }
 
@@ -256,23 +239,18 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipseVec
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArc
                                                 (GEOM::GEOM_Object_ptr thePnt1,
-                                                GEOM::GEOM_Object_ptr thePnt2,
-                                                GEOM::GEOM_Object_ptr thePnt3)
+                                                 GEOM::GEOM_Object_ptr thePnt2,
+                                                 GEOM::GEOM_Object_ptr thePnt3)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL) return aGEOMObject._retn();
-
   //Get the reference points
-  Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
-    (thePnt1->GetStudyID(), thePnt1->GetEntry());
-  Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
-    (thePnt2->GetStudyID(), thePnt2->GetEntry());
-  Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
-    (thePnt3->GetStudyID(), thePnt3->GetEntry());
+  Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
+  Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
+  Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
 
   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
 
@@ -302,15 +280,10 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArcCenter
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL) return aGEOMObject._retn();
-
   //Get the reference points
-  Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
-      (thePnt1->GetStudyID(), thePnt1->GetEntry());
-  Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
-      (thePnt2->GetStudyID(), thePnt2->GetEntry());
-  Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
-      (thePnt3->GetStudyID(), thePnt3->GetEntry());
+  Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
+  Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
+  Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
 
   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
 
@@ -330,23 +303,18 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArcCenter
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArcOfEllipse
                                                 (GEOM::GEOM_Object_ptr thePnt1,
-                                                GEOM::GEOM_Object_ptr thePnt2,
-                                                GEOM::GEOM_Object_ptr thePnt3)
+                                                 GEOM::GEOM_Object_ptr thePnt2,
+                                                 GEOM::GEOM_Object_ptr thePnt3)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL) return aGEOMObject._retn();
-
   //Get the reference points
-  Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
-    (thePnt1->GetStudyID(), thePnt1->GetEntry());
-  Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
-    (thePnt2->GetStudyID(), thePnt2->GetEntry());
-  Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
-    (thePnt3->GetStudyID(), thePnt3->GetEntry());
+  Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
+  Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
+  Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
 
   if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
 
@@ -377,11 +345,7 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakePolyline
   int aLen = thePoints.length();
   list<Handle(GEOM_Object)> aPoints;
   for (; ind < aLen; ind++) {
-    if (thePoints[ind] == NULL) return aGEOMObject._retn();
-
-    Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
-      (thePoints[ind]->GetStudyID(), thePoints[ind]->GetEntry());
-
+    Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
     if (aPnt.IsNull()) return aGEOMObject._retn();
     aPoints.push_back(aPnt);
   }
@@ -413,11 +377,7 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineBezier
   int aLen = thePoints.length();
   list<Handle(GEOM_Object)> aPoints;
   for (; ind < aLen; ind++) {
-    if (thePoints[ind] == NULL) return aGEOMObject._retn();
-
-    Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
-      (thePoints[ind]->GetStudyID(), thePoints[ind]->GetEntry());
-
+    Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
     if (aPnt.IsNull()) return aGEOMObject._retn();
     aPoints.push_back(aPnt);
   }
@@ -449,11 +409,7 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
   int aLen = thePoints.length();
   list<Handle(GEOM_Object)> aPoints;
   for (; ind < aLen; ind++) {
-    if (thePoints[ind] == NULL) return aGEOMObject._retn();
-
-    Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
-      (thePoints[ind]->GetStudyID(), thePoints[ind]->GetEntry());
-
+    Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
     if (aPnt.IsNull()) return aGEOMObject._retn();
     aPoints.push_back(aPnt);
   }
@@ -530,8 +486,7 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcherOnPlane
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  Handle(GEOM_Object) aWorkingPlane = GetOperations()->GetEngine()->GetObject
-    (theWorkingPlane->GetStudyID(), theWorkingPlane->GetEntry());
+  Handle(GEOM_Object) aWorkingPlane = GetObjectImpl(theWorkingPlane);
 
   // Make Sketcher
   Handle(GEOM_Object) anObject =
index 7f87d4ac4887bc089f8870922a18ce5d520ee355..ec64e411c63b96c1b5ba983169713bb5ab00666f 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include <Standard_Stream.hxx>
 
 #include "GEOM_IGroupOperations_i.hh"
@@ -39,8 +39,8 @@
  */
 //=============================================================================
 GEOM_IGroupOperations_i::GEOM_IGroupOperations_i (PortableServer::POA_ptr thePOA,
-                                                 GEOM::GEOM_Gen_ptr theEngine,
-                                                 ::GEOMImpl_IGroupOperations* theImpl)
+                                                  GEOM::GEOM_Gen_ptr theEngine,
+                                                  ::GEOMImpl_IGroupOperations* theImpl)
      :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_IGroupOperations_i::GEOM_IGroupOperations_i");
@@ -61,19 +61,19 @@ GEOM_IGroupOperations_i::~GEOM_IGroupOperations_i()
 /*!
  *  CreateGroup
  */
-//============================================================================= 
-GEOM::GEOM_Object_ptr GEOM_IGroupOperations_i::CreateGroup(GEOM::GEOM_Object_ptr theMainShape, CORBA::Long theShapeType)
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IGroupOperations_i::CreateGroup(GEOM::GEOM_Object_ptr theMainShape,
+                                                           CORBA::Long theShapeType)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theMainShape == NULL || theShapeType < 0) return aGEOMObject._retn();
+  if (theShapeType < 0) return aGEOMObject._retn();
 
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject(theMainShape->GetStudyID(), theMainShape->GetEntry());
-
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theMainShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Create the Fillet
@@ -89,40 +89,33 @@ GEOM::GEOM_Object_ptr GEOM_IGroupOperations_i::CreateGroup(GEOM::GEOM_Object_ptr
  *  AddObject
  */
 //=============================================================================
-void GEOM_IGroupOperations_i::AddObject(GEOM::GEOM_Object_ptr theGroup, CORBA::Long theSubShapeId) 
+void GEOM_IGroupOperations_i::AddObject(GEOM::GEOM_Object_ptr theGroup, CORBA::Long theSubShapeId)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return;
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject(theGroup->GetStudyID(), theGroup->GetEntry());
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return;
 
   GetOperations()->AddObject(aGroupRef, theSubShapeId);
-  return;
 }
 
 //=============================================================================
 /*!
  *  RemoveObject
  */
-//============================================================================= 
-void GEOM_IGroupOperations_i::RemoveObject(GEOM::GEOM_Object_ptr theGroup, CORBA::Long theSubShapeId) 
+//=============================================================================
+void GEOM_IGroupOperations_i::RemoveObject(GEOM::GEOM_Object_ptr theGroup, CORBA::Long theSubShapeId)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return;
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject(theGroup->GetStudyID(), theGroup->GetEntry());
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return;
 
   GetOperations()->RemoveObject(aGroupRef, theSubShapeId);
-
-  return;
 }
 
 //=============================================================================
@@ -131,16 +124,13 @@ void GEOM_IGroupOperations_i::RemoveObject(GEOM::GEOM_Object_ptr theGroup, CORBA
  */
 //=============================================================================
 void GEOM_IGroupOperations_i::UnionList (GEOM::GEOM_Object_ptr theGroup,
-                                        const GEOM::ListOfGO& theSubShapes) 
+                                         const GEOM::ListOfGO& theSubShapes)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return;
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject
-    (theGroup->GetStudyID(), theGroup->GetEntry());
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return;
 
   //Get sub-shape to add
@@ -148,16 +138,13 @@ void GEOM_IGroupOperations_i::UnionList (GEOM::GEOM_Object_ptr theGroup,
 
   int ind, aLen = theSubShapes.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theSubShapes[ind] == NULL) return;
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theSubShapes[ind]->GetStudyID(), theSubShapes[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theSubShapes[ind]);
     if (aSh.IsNull()) return;
     aSubShapes->Append(aSh);
   }
 
   //Perform the operation
   GetOperations()->UnionList(aGroupRef, aSubShapes);
-  return;
 }
 
 //=============================================================================
@@ -166,16 +153,13 @@ void GEOM_IGroupOperations_i::UnionList (GEOM::GEOM_Object_ptr theGroup,
  */
 //=============================================================================
 void GEOM_IGroupOperations_i::DifferenceList (GEOM::GEOM_Object_ptr theGroup,
-                                             const GEOM::ListOfGO& theSubShapes) 
+                                              const GEOM::ListOfGO& theSubShapes)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return;
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject
-    (theGroup->GetStudyID(), theGroup->GetEntry());
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return;
 
   //Get sub-shape to remove
@@ -183,16 +167,13 @@ void GEOM_IGroupOperations_i::DifferenceList (GEOM::GEOM_Object_ptr theGroup,
 
   int ind, aLen = theSubShapes.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theSubShapes[ind] == NULL) return;
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theSubShapes[ind]->GetStudyID(), theSubShapes[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theSubShapes[ind]);
     if (aSh.IsNull()) return;
     aSubShapes->Append(aSh);
   }
 
   //Perform the operation
   GetOperations()->DifferenceList(aGroupRef, aSubShapes);
-  return;
 }
 
 //=============================================================================
@@ -201,16 +182,13 @@ void GEOM_IGroupOperations_i::DifferenceList (GEOM::GEOM_Object_ptr theGroup,
  */
 //=============================================================================
 void GEOM_IGroupOperations_i::UnionIDs (GEOM::GEOM_Object_ptr   theGroup,
-                                       const GEOM::ListOfLong& theSubShapes) 
+                                        const GEOM::ListOfLong& theSubShapes)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return;
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject
-    (theGroup->GetStudyID(), theGroup->GetEntry());
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return;
 
   //Get sub-shape to add
@@ -232,16 +210,13 @@ void GEOM_IGroupOperations_i::UnionIDs (GEOM::GEOM_Object_ptr   theGroup,
  */
 //=============================================================================
 void GEOM_IGroupOperations_i::DifferenceIDs (GEOM::GEOM_Object_ptr   theGroup,
-                                            const GEOM::ListOfLong& theSubShapes) 
+                                             const GEOM::ListOfLong& theSubShapes)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return;
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject
-    (theGroup->GetStudyID(), theGroup->GetEntry());
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return;
 
   //Get sub-shape to remove
@@ -261,17 +236,14 @@ void GEOM_IGroupOperations_i::DifferenceIDs (GEOM::GEOM_Object_ptr   theGroup,
 /*!
  *  GetType
  */
-//============================================================================= 
+//=============================================================================
 CORBA::Long GEOM_IGroupOperations_i::GetType(GEOM::GEOM_Object_ptr theGroup)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return -1;
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject(theGroup->GetStudyID(), theGroup->GetEntry());
-
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return -1;
 
   return GetOperations()->GetType(aGroupRef);
@@ -281,7 +253,7 @@ CORBA::Long GEOM_IGroupOperations_i::GetType(GEOM::GEOM_Object_ptr theGroup)
 /*!
  *  GetMainShape
  */
-//============================================================================= 
+//=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IGroupOperations_i::GetMainShape(GEOM::GEOM_Object_ptr theGroup)
 {
   GEOM::GEOM_Object_var aGEOMObject;
@@ -289,10 +261,8 @@ GEOM::GEOM_Object_ptr GEOM_IGroupOperations_i::GetMainShape(GEOM::GEOM_Object_pt
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return aGEOMObject._retn();
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject(theGroup->GetStudyID(), theGroup->GetEntry());
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return aGEOMObject._retn();
 
   Handle(GEOM_Object) anObject = GetOperations()->GetMainShape(aGroupRef);
@@ -305,7 +275,7 @@ GEOM::GEOM_Object_ptr GEOM_IGroupOperations_i::GetMainShape(GEOM::GEOM_Object_pt
 /*!
  *  GetObjects
  */
-//============================================================================= 
+//=============================================================================
 GEOM::ListOfLong* GEOM_IGroupOperations_i::GetObjects(GEOM::GEOM_Object_ptr theGroup)
 {
   GEOM::ListOfLong_var aList;
@@ -313,20 +283,17 @@ GEOM::ListOfLong* GEOM_IGroupOperations_i::GetObjects(GEOM::GEOM_Object_ptr theG
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theGroup == NULL) return aList._retn();
-
   //Get the reference group
-  Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject(theGroup->GetStudyID(), theGroup->GetEntry());
+  Handle(GEOM_Object) aGroupRef = GetObjectImpl(theGroup);
   if (aGroupRef.IsNull()) return aList._retn();
 
-  aList = new GEOM::ListOfLong;    
+  aList = new GEOM::ListOfLong;
 
   Handle(TColStd_HArray1OfInteger) aSeq = GetOperations()->GetObjects(aGroupRef);
   if (!GetOperations()->IsDone() || aSeq.IsNull()) return aList._retn();
-    
+
   aList->length(aSeq->Length());
   for(int i = 1; i<=aSeq->Length(); i++) aList[i-1] = aSeq->Value(i);
 
   return aList._retn();
 }
-
index a529c1cfe23570e43fd370fe7b969a2159f86a9c..36f3587c5385861c7796c328f912aa50da6b7028 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include <Standard_Stream.hxx>
 
 #include <list>
@@ -40,8 +40,8 @@
 //=============================================================================
 
 GEOM_IHealingOperations_i::GEOM_IHealingOperations_i (PortableServer::POA_ptr thePOA,
-                                                     GEOM::GEOM_Gen_ptr theEngine,
-                                                     ::GEOMImpl_IHealingOperations* theImpl)
+                                                      GEOM::GEOM_Gen_ptr theEngine,
+                                                      ::GEOMImpl_IHealingOperations* theImpl)
 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_IHealingOperations_i::GEOM_IHealingOperations_i");
@@ -104,27 +104,22 @@ Handle(TColStd_HArray1OfExtendedString) GEOM_IHealingOperations_i::Convert
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ProcessShape (GEOM::GEOM_Object_ptr theObject,
-                                                              const GEOM::string_array& theOperations,
-                                                              const GEOM::string_array& theParams,
-                                                              const GEOM::string_array& theValues)
+                                                               const GEOM::string_array& theOperations,
+                                                               const GEOM::string_array& theParams,
+                                                               const GEOM::string_array& theValues)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  // Check parameters
-  if ( CORBA::is_nil(theObject) )
-    return aGEOMObject._retn();
-
   // Check if theOperations has more than 0 elements and theParams and theValues have the same length
-//  if ( theOperations.length() <= 0 || theParams.length() != theValues.length() )
-//    return aGEOMObject._retn();
+  //if (theOperations.length() <= 0 || theParams.length() != theValues.length())
+  //  return aGEOMObject._retn();
 
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
-  if ( anObject.IsNull() )
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  if (anObject.IsNull())
     return aGEOMObject._retn();
 
   // Perform
@@ -169,7 +164,7 @@ void GEOM_IHealingOperations_i::GetShapeProcessParameters(GEOM::string_array_out
       anOpArray[i] = CORBA::string_dup( (*opIt).c_str() );
 
     for ( i = 0, parIt = paramsList.begin(), valIt = valuesList.begin();
-         parIt != paramsList.end(); i++, ++parIt,++valIt ) {
+          parIt != paramsList.end(); i++, ++parIt,++valIt ) {
       aParArray[i] = CORBA::string_dup( (*parIt).c_str() );
       aValArray[i] = CORBA::string_dup( (*valIt).c_str() );
     }
@@ -186,9 +181,9 @@ void GEOM_IHealingOperations_i::GetShapeProcessParameters(GEOM::string_array_out
  *  GetOperatorParameters
  */
 //=============================================================================
-void GEOM_IHealingOperations_i::GetOperatorParameters (const char* theOperator,  
-                                                      GEOM::string_array_out theParams, 
-                                                      GEOM::string_array_out theValues)
+void GEOM_IHealingOperations_i::GetOperatorParameters (const char* theOperator,
+                                                       GEOM::string_array_out theParams,
+                                                       GEOM::string_array_out theValues)
 {
   GEOM::string_array_var aParArray = new GEOM::string_array();
   GEOM::string_array_var aValArray = new GEOM::string_array();
@@ -207,8 +202,8 @@ void GEOM_IHealingOperations_i::GetOperatorParameters (const char* theOperator,
       int i;
       for ( i = 0, parIt = paramsList.begin(), valIt = valuesList.begin();
             parIt != paramsList.end(); i++, ++parIt,++valIt ) {
-       aParArray[i] = CORBA::string_dup( (*parIt).c_str() );
-       aValArray[i] = CORBA::string_dup( (*valIt).c_str() );
+        aParArray[i] = CORBA::string_dup( (*parIt).c_str() );
+        aValArray[i] = CORBA::string_dup( (*valIt).c_str() );
       }
     }
   }
@@ -224,23 +219,20 @@ void GEOM_IHealingOperations_i::GetOperatorParameters (const char* theOperator,
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::SuppressFaces (GEOM::GEOM_Object_ptr theObject,
-                                                               const GEOM::short_array& theFaces)
+                                                                const GEOM::short_array& theFaces)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  // Check parameters
-  if ( CORBA::is_nil(theObject) ) // if theFaces is empty - it's OK, it means that ALL faces must be removed
-    return aGEOMObject._retn();
-
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return aGEOMObject._retn();
 
+  // if theFaces is empty - it's OK, it means that ALL faces must be removed
+
   // Perform
   Handle(GEOM_Object) aNewObject =
     GetOperations()->SuppressFaces( anObject, Convert( theFaces ) );
@@ -256,21 +248,16 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::SuppressFaces (GEOM::GEOM_Objec
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::CloseContour (GEOM::GEOM_Object_ptr theObject,
-                                                              const GEOM::short_array& theWires,
-                                                              CORBA::Boolean isCommonVertex)
+                                                               const GEOM::short_array& theWires,
+                                                               CORBA::Boolean isCommonVertex)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  // Check parameters
-  if ( CORBA::is_nil(theObject) )
-    return aGEOMObject._retn();
-
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -289,23 +276,20 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::CloseContour (GEOM::GEOM_Object
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::RemoveIntWires (GEOM::GEOM_Object_ptr theObject,
-                                                                const GEOM::short_array& theWires)
+                                                                 const GEOM::short_array& theWires)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  // Check parameters
-  if ( CORBA::is_nil(theObject) ) // if theWires is empty - it's OK, it means that ALL wires should be removed
-    return aGEOMObject._retn();
-
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return aGEOMObject._retn();
 
+  // if theWires is empty - it's OK, it means that ALL wires should be removed
+
   // Perform
   Handle(GEOM_Object) aNewObject =
     GetOperations()->RemoveIntWires( anObject, Convert( theWires ) );
@@ -321,23 +305,20 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::RemoveIntWires (GEOM::GEOM_Obje
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::FillHoles (GEOM::GEOM_Object_ptr theObject,
-                                                           const GEOM::short_array& theWires)
+                                                            const GEOM::short_array& theWires)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  // Check parameters
-  if ( CORBA::is_nil(theObject) ) // if theWires is empty - it's OK, it means that ALL wires should be removed
-    return aGEOMObject._retn();
-
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return aGEOMObject._retn();
 
+  // if theWires is empty - it's OK, it means that ALL wires should be removed
+
   // Perform
   Handle(GEOM_Object) aNewObject =
     GetOperations()->FillHoles( anObject, Convert( theWires ) );
@@ -353,7 +334,7 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::FillHoles (GEOM::GEOM_Object_pt
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::Sew (GEOM::GEOM_Object_ptr theObject,
-                                                     CORBA::Double theTolerance)
+                                                      CORBA::Double theTolerance)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -361,12 +342,11 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::Sew (GEOM::GEOM_Object_ptr theO
   GetOperations()->SetNotDone();
 
   // Check parameters
-  if ( CORBA::is_nil(theObject) || theTolerance < 0 )
+  if (theTolerance < 0)
     return aGEOMObject._retn();
 
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -386,8 +366,8 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::Sew (GEOM::GEOM_Object_ptr theO
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::DivideEdge (GEOM::GEOM_Object_ptr theObject,
                                                              CORBA::Short theIndex,
-                                                            CORBA::Double theValue,
-                                                            CORBA::Boolean isByParameter)
+                                                             CORBA::Double theValue,
+                                                             CORBA::Boolean isByParameter)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -395,12 +375,11 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::DivideEdge (GEOM::GEOM_Object_p
   GetOperations()->SetNotDone();
 
   // Check parameters
-  if ( CORBA::is_nil(theObject) || theValue < 0 || theValue > 1 )
+  if (theValue < 0 || theValue > 1)
     return aGEOMObject._retn();
 
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -419,8 +398,8 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::DivideEdge (GEOM::GEOM_Object_p
  */
 //=============================================================================
 CORBA::Boolean GEOM_IHealingOperations_i::GetFreeBoundary ( GEOM::GEOM_Object_ptr theObject,
-                                                           GEOM::ListOfGO_out theClosedWires,
-                                                           GEOM::ListOfGO_out theOpenWires )
+                                                            GEOM::ListOfGO_out theClosedWires,
+                                                            GEOM::ListOfGO_out theOpenWires )
 {
   theClosedWires = new GEOM::ListOfGO;
   theOpenWires = new GEOM::ListOfGO;
@@ -428,12 +407,8 @@ CORBA::Boolean GEOM_IHealingOperations_i::GetFreeBoundary ( GEOM::GEOM_Object_pt
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  if ( CORBA::is_nil(theObject) )
-       return false;
-
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return false;
 
@@ -442,7 +417,7 @@ CORBA::Boolean GEOM_IHealingOperations_i::GetFreeBoundary ( GEOM::GEOM_Object_pt
   bool res = GetOperations()->GetFreeBoundary( anObject, aClosed, anOpen );
 
   if ( !GetOperations()->IsDone() || !res )
-       return false;
+    return false;
 
   int i, n = aClosed->Length();
   theClosedWires->length( n );
@@ -477,8 +452,7 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientation (GEOM::GEOM_O
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -489,7 +463,7 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientation (GEOM::GEOM_O
 //    return aGEOMObject._retn();
 
   //return GetObject(aNewObject);
-  return aGEOMObject._retn();  
+  return aGEOMObject._retn();
 }
 
 
@@ -505,13 +479,8 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientationCopy (GEOM::GE
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  // Check parameters
-  if ( CORBA::is_nil(theObject) )
-    return aGEOMObject._retn();
-
   // Get the object itself
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -523,4 +492,3 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientationCopy (GEOM::GE
 
   return GetObject(aNewObject);
 }
-
index a0145517c5dcec84d9466d3542749283a9fa9374..832b8df27bef26cff4f9a431d582e4f64e2ac2c5 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #ifdef WNT
 #pragma warning( disable:4786 )
 #endif
@@ -42,8 +42,8 @@
  */
 //=============================================================================
 GEOM_IInsertOperations_i::GEOM_IInsertOperations_i (PortableServer::POA_ptr thePOA,
-                                                   GEOM::GEOM_Gen_ptr theEngine,
-                                                   ::GEOMImpl_IInsertOperations* theImpl)
+                                                    GEOM::GEOM_Gen_ptr theEngine,
+                                                    ::GEOMImpl_IInsertOperations* theImpl)
      :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_IInsertOperations_i::GEOM_IInsertOperations_i");
@@ -72,13 +72,8 @@ GEOM::GEOM_Object_ptr GEOM_IInsertOperations_i::MakeCopy(GEOM::GEOM_Object_ptr t
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theOriginal == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) anOriginal =
-    GetOperations()->GetEngine()->GetObject(theOriginal->GetStudyID(),
-                                           theOriginal->GetEntry());
-
+  Handle(GEOM_Object) anOriginal = GetObjectImpl(theOriginal);
   if (anOriginal.IsNull()) return aGEOMObject._retn();
 
   //Create the copy
@@ -96,21 +91,16 @@ GEOM::GEOM_Object_ptr GEOM_IInsertOperations_i::MakeCopy(GEOM::GEOM_Object_ptr t
 //=============================================================================
 void GEOM_IInsertOperations_i::Export
                    (GEOM::GEOM_Object_ptr theOriginal,
-                   const char*           theFileName,
-                   const char*           theFormatName)
+                    const char*           theFileName,
+                    const char*           theFormatName)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theOriginal);
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theOriginal == NULL) return;
-
   //Get the reference shape
-  Handle(GEOM_Object) anOriginal =
-    GetOperations()->GetEngine()->GetObject(theOriginal->GetStudyID(),
-                                           theOriginal->GetEntry());
-
+  Handle(GEOM_Object) anOriginal = GetObjectImpl(theOriginal);
   if (anOriginal.IsNull()) return;
 
   //Export the shape to the file
@@ -119,8 +109,6 @@ void GEOM_IInsertOperations_i::Export
   GetOperations()->Export(anOriginal, aFileName, aFormatName);
   free(aFileName);
   free(aFormatName);
-
-  return;
 }
 
 //=============================================================================
@@ -130,7 +118,7 @@ void GEOM_IInsertOperations_i::Export
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IInsertOperations_i::Import
                    (const char* theFileName,
-                   const char* theFormatName)
+                    const char* theFormatName)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -174,8 +162,8 @@ void GEOM_IInsertOperations_i::ImportTranslators
       // fill the local CORBA arrays with values from sequences
       CORBA::Long i = 1;
       for (; i <= formSize; i++) {
-       aFormatsArray[i-1]  = CORBA::string_dup(aFormats->Value(i).ToCString());
-       aPatternsArray[i-1] = CORBA::string_dup(aPatterns->Value(i).ToCString());
+        aFormatsArray[i-1]  = CORBA::string_dup(aFormats->Value(i).ToCString());
+        aPatternsArray[i-1] = CORBA::string_dup(aPatterns->Value(i).ToCString());
       }
     }
   }
@@ -209,8 +197,8 @@ void GEOM_IInsertOperations_i::ExportTranslators
       // fill the local CORBA arrays with values from sequences
       CORBA::Long i = 1;
       for (; i <= formSize; i++) {
-       aFormatsArray[i-1]  = CORBA::string_dup(aFormats->Value(i).ToCString());
-       aPatternsArray[i-1] = CORBA::string_dup(aPatterns->Value(i).ToCString());
+        aFormatsArray[i-1]  = CORBA::string_dup(aFormats->Value(i).ToCString());
+        aPatternsArray[i-1] = CORBA::string_dup(aPatterns->Value(i).ToCString());
       }
     }
   }
index c71a24780310ec41c406a41913376ee4388aa809..5b3289eecb53d697df31f906b66ec531d9438441 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include <Standard_Stream.hxx>
 
 #include "GEOM_ILocalOperations_i.hh"
@@ -36,8 +36,8 @@
  */
 //=============================================================================
 GEOM_ILocalOperations_i::GEOM_ILocalOperations_i (PortableServer::POA_ptr thePOA,
-                                                 GEOM::GEOM_Gen_ptr theEngine,
-                                                 ::GEOMImpl_ILocalOperations* theImpl)
+                                                  GEOM::GEOM_Gen_ptr theEngine,
+                                                  ::GEOMImpl_ILocalOperations* theImpl)
      :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_ILocalOperations_i::GEOM_ILocalOperations_i");
@@ -64,12 +64,8 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletAll
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Create the Fillet
@@ -88,15 +84,12 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletAll
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletEdges
                       (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR,
-                      const GEOM::ListOfLong& theEdges)
+                       const GEOM::ListOfLong& theEdges)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference edges
@@ -127,11 +120,8 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletEdgesR1R2
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference edges
@@ -158,15 +148,12 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletEdgesR1R2
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletFaces
                       (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR,
-                      const GEOM::ListOfLong& theFaces)
+                       const GEOM::ListOfLong& theFaces)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference faces
@@ -197,11 +184,8 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletFacesR1R2
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference faces
@@ -228,15 +212,12 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFilletFacesR1R2
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeFillet2D
                       (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR,
-                      const GEOM::ListOfLong& theVertexes)
+                       const GEOM::ListOfLong& theVertexes)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference vertex
@@ -266,12 +247,8 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferAll
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Create the Chamfer
@@ -290,16 +267,13 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferAll
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferEdge
                       (GEOM::GEOM_Object_ptr theShape,
-                      CORBA::Double theD1, CORBA::Double theD2,
-                      CORBA::Long theFace1, CORBA::Long theFace2)
+                       CORBA::Double theD1, CORBA::Double theD2,
+                       CORBA::Long theFace1, CORBA::Long theFace2)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Create the Chamfer
@@ -317,16 +291,13 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferEdge
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferEdgeAD
                       (GEOM::GEOM_Object_ptr theShape,
-                      CORBA::Double theD, CORBA::Double theAngle,
-                      CORBA::Long theFace1, CORBA::Long theFace2)
+                       CORBA::Double theD, CORBA::Double theAngle,
+                       CORBA::Long theFace1, CORBA::Long theFace2)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Create the Chamfer
@@ -345,16 +316,13 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferEdgeAD
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferFaces
                       (GEOM::GEOM_Object_ptr theShape,
-                      CORBA::Double theD1, CORBA::Double theD2,
-                      const GEOM::ListOfLong& theFaces)
+                       CORBA::Double theD1, CORBA::Double theD2,
+                       const GEOM::ListOfLong& theFaces)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference faces
@@ -380,16 +348,13 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferFaces
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferFacesAD
                       (GEOM::GEOM_Object_ptr theShape,
-                      CORBA::Double theD, CORBA::Double theAngle,
-                      const GEOM::ListOfLong& theFaces)
+                       CORBA::Double theD, CORBA::Double theAngle,
+                       const GEOM::ListOfLong& theFaces)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference faces
@@ -416,16 +381,13 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferFacesAD
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferEdges
                       (GEOM::GEOM_Object_ptr theShape,
-                      CORBA::Double theD1, CORBA::Double theD2,
-                      const GEOM::ListOfLong& theEdges)
+                       CORBA::Double theD1, CORBA::Double theD2,
+                       const GEOM::ListOfLong& theEdges)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference edges
@@ -452,16 +414,13 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferEdges
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferEdgesAD
                       (GEOM::GEOM_Object_ptr theShape,
-                      CORBA::Double theD, CORBA::Double theAngle,
-                      const GEOM::ListOfLong& theEdges)
+                       CORBA::Double theD, CORBA::Double theAngle,
+                       const GEOM::ListOfLong& theEdges)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Get the reference edges
@@ -487,17 +446,14 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeChamferEdgesAD
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeArchimede (GEOM::GEOM_Object_ptr theShape,
-                                                             CORBA::Double theWeight,
-                                                             CORBA::Double theWaterDensity,
-                                                             CORBA::Double theMeshingDeflection)
+                                                              CORBA::Double theWeight,
+                                                              CORBA::Double theWaterDensity,
+                                                              CORBA::Double theMeshingDeflection)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference shape
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
   if (aShapeRef.IsNull()) return aGEOMObject._retn();
 
   //Create the Archimede
@@ -517,13 +473,9 @@ GEOM::GEOM_Object_ptr GEOM_ILocalOperations_i::MakeArchimede (GEOM::GEOM_Object_
 CORBA::Long GEOM_ILocalOperations_i::GetSubShapeIndex
   (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr theSubShape)
 {
-  if (theShape == NULL || theSubShape == NULL) return -1;
-
   //Get the reference shapes
-  Handle(GEOM_Object) aShapeRef = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
-    (theSubShape->GetStudyID(), theSubShape->GetEntry());
+  Handle(GEOM_Object) aShapeRef = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
   if (aShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
 
   //Get the unique ID of <theSubShape> inside <theShape>
index e26172e61db143b928d8d6139c828c6aa49e1556..4114d6647a0cfdcc579a6e6f276b1e139d9ec214 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include "GEOM_IOperations_i.hh"
 
 #include "GEOM_Engine.hxx"
@@ -131,10 +131,11 @@ void GEOM_IOperations_i::AbortOperation()
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IOperations_i::GetObject(Handle(GEOM_Object) theObject)
 {
-  if(theObject.IsNull()) return NULL;
+  GEOM::GEOM_Object_var GO;
+  if (theObject.IsNull()) return GO._retn();
   TCollection_AsciiString anEntry;
   TDF_Tool::Entry(theObject->GetEntry(), anEntry);
-  GEOM::GEOM_Object_var GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
+  GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
   return GO._retn();
 }
 
index 16eb765751e2bfcdc362d7410d3b071454be57a9..504f111fa4d58cf2185ea06c21fc11688d57966e 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include <Standard_Stream.hxx>
 
 #include "GEOM_IShapesOperations_i.hh"
@@ -39,8 +39,8 @@
  */
 //=============================================================================
 GEOM_IShapesOperations_i::GEOM_IShapesOperations_i (PortableServer::POA_ptr thePOA,
-                                                   GEOM::GEOM_Gen_ptr theEngine,
-                                                   ::GEOMImpl_IShapesOperations* theImpl)
+                                                    GEOM::GEOM_Gen_ptr theEngine,
+                                                    ::GEOMImpl_IShapesOperations* theImpl)
 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_IShapesOperations_i::GEOM_IShapesOperations_i");
@@ -70,13 +70,9 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdge
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (thePnt1 == NULL || thePnt2 == NULL) return aGEOMObject._retn();
-
   //Get the reference points
-  Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
-    (thePnt1->GetStudyID(), thePnt1->GetEntry());
-  Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
-    (thePnt2->GetStudyID(), thePnt2->GetEntry());
+  Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
+  Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
 
   if (aPnt1.IsNull() || aPnt2.IsNull()) return aGEOMObject._retn();
 
@@ -107,9 +103,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire
   //Get the shapes
   aLen = theEdgesAndWires.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theEdgesAndWires[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theEdgesAndWires[ind]->GetStudyID(), theEdgesAndWires[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theEdgesAndWires[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aShapes.push_back(aSh);
   }
@@ -130,19 +124,15 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFace
                       (GEOM::GEOM_Object_ptr theWire,
-                      const CORBA::Boolean  isPlanarWanted)
+                       const CORBA::Boolean  isPlanarWanted)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theWire == NULL) return aGEOMObject._retn();
-
   //Get the reference wire
-  Handle(GEOM_Object) aWire = GetOperations()->GetEngine()->GetObject
-    (theWire->GetStudyID(), theWire->GetEntry());
-
+  Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
   if (aWire.IsNull()) return aGEOMObject._retn();
 
   //Create the Face
@@ -160,7 +150,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFace
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWires
                                          (const GEOM::ListOfGO& theWires,
-                                         const CORBA::Boolean  isPlanarWanted)
+                                          const CORBA::Boolean  isPlanarWanted)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -173,9 +163,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWires
   //Get the shapes
   aLen = theWires.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theWires[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theWires[ind]->GetStudyID(), theWires[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theWires[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aShapes.push_back(aSh);
   }
@@ -208,9 +196,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeShell
   //Get the shapes
   aLen = theFacesAndShells.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theFacesAndShells[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theFacesAndShells[ind]->GetStudyID(), theFacesAndShells[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theFacesAndShells[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aShapes.push_back(aSh);
   }
@@ -237,12 +223,8 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShell
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShell == NULL) return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShell = GetOperations()->GetEngine()->GetObject
-    (theShell->GetStudyID(), theShell->GetEntry());
-
+  Handle(GEOM_Object) aShell = GetObjectImpl(theShell);
   if (aShell.IsNull()) return aGEOMObject._retn();
 
   //Create the Solid
@@ -272,9 +254,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShells
   //Get the shapes
   aLen = theShells.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theShells[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theShells[ind]->GetStudyID(), theShells[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theShells[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aShapes.push_back(aSh);
   }
@@ -307,9 +287,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
   //Get the shapes
   aLen = theShapes.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theShapes[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theShapes[ind]->GetStudyID(), theShapes[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aShapes.push_back(aSh);
   }
@@ -330,20 +308,16 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
                                            (GEOM::GEOM_Object_ptr theShape,
-                                           CORBA::Double   theTolerance,
-                                           CORBA::Boolean  doKeepNonSolids)
+                                            CORBA::Double   theTolerance,
+                                            CORBA::Boolean  doKeepNonSolids)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
   if (aShape.IsNull()) return aGEOMObject._retn();
 
   //Perform the gluing
@@ -365,18 +339,15 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
                                            (GEOM::GEOM_Object_ptr theShape,
-                                           const CORBA::Double   theTolerance)
+                                            const CORBA::Double   theTolerance)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
   if (aShape.IsNull()) return aSeq._retn();
 
   Handle(TColStd_HSequenceOfTransient) aHSeq =
@@ -403,21 +374,17 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
                                            (GEOM::GEOM_Object_ptr theShape,
-                                           CORBA::Double   theTolerance,
-                                           const GEOM::ListOfGO& theFaces,
-                                           CORBA::Boolean  doKeepNonSolids)
+                                            CORBA::Double   theTolerance,
+                                            const GEOM::ListOfGO& theFaces,
+                                            CORBA::Boolean  doKeepNonSolids)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
   if (aShape.IsNull()) return aGEOMObject._retn();
 
   int ind, aLen;
@@ -425,9 +392,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
   //Get the shapes
   aLen = theFaces.length();
   for (ind = 0; ind < aLen; ind++) {
-    if (theFaces[ind] == NULL) return aGEOMObject._retn();
-    Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
-      (theFaces[ind]->GetStudyID(), theFaces[ind]->GetEntry());
+    Handle(GEOM_Object) aSh = GetObjectImpl(theFaces[ind]);
     if (aSh.IsNull()) return aGEOMObject._retn();
     aFaces.push_back(aSh);
   }
@@ -450,14 +415,13 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
  */
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr theShape,
-                                                      const CORBA::Long     theShapeType,
-                                                      const CORBA::Boolean  isSorted)
+                                                       const CORBA::Long     theShapeType,
+                                                       const CORBA::Boolean  isSorted)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-  if (theShape == NULL) return aSeq._retn();
 
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  if (aShape.IsNull()) return aSeq._retn();
 
   Handle(TColStd_HSequenceOfTransient) aHSeq =
     GetOperations()->MakeExplode(aShape, theShapeType, isSorted);
@@ -478,14 +442,13 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::MakeExplode (GEOM::GEOM_Object_ptr the
  */
 //=============================================================================
 GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_ptr theShape,
-                                                           const CORBA::Long     theShapeType,
-                                                           const CORBA::Boolean  isSorted)
+                                                            const CORBA::Long     theShapeType,
+                                                            const CORBA::Boolean  isSorted)
 {
   GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
-  if (theShape == NULL) return aSeq._retn();
 
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  if (aShape.IsNull()) return aSeq._retn();
 
   Handle(TColStd_HSequenceOfInteger) aHSeq =
     GetOperations()->SubShapeAllIDs(aShape, theShapeType, isSorted);
@@ -506,19 +469,15 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::SubShapeAllIDs (GEOM::GEOM_Object_pt
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
                                            (GEOM::GEOM_Object_ptr theMainShape,
-                                           const CORBA::Long     theID)
+                                            const CORBA::Long     theID)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theMainShape == NULL) return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theMainShape->GetStudyID(), theMainShape->GetEntry());
-
+  Handle(GEOM_Object) aShape = GetObjectImpl(theMainShape);
   if (aShape.IsNull()) return aGEOMObject._retn();
 
   Handle(GEOM_Object) anObject = GetOperations()->GetSubShape(aShape, theID);
@@ -536,13 +495,10 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSubShape
 CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
   (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
 {
-  if (theMainShape == NULL || theSubShape == NULL) return -1;
-
   //Get the reference shapes
-  Handle(GEOM_Object) aMainShapeRef = GetOperations()->GetEngine()->GetObject
-    (theMainShape->GetStudyID(), theMainShape->GetEntry());
-  Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
-    (theSubShape->GetStudyID(), theSubShape->GetEntry());
+  Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
+  Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
+
   if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
 
   //Get the unique ID of <theSubShape> inside <theMainShape>
@@ -561,13 +517,10 @@ CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
 CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
   (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
 {
-  if (theMainShape == NULL || theSubShape == NULL) return -1;
-
   //Get the reference shapes
-  Handle(GEOM_Object) aMainShapeRef = GetOperations()->GetEngine()->GetObject
-    (theMainShape->GetStudyID(), theMainShape->GetEntry());
-  Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
-    (theSubShape->GetStudyID(), theSubShape->GetEntry());
+  Handle(GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
+  Handle(GEOM_Object) aSubShapeRef = GetObjectImpl(theSubShape);
+
   if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
 
   //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
@@ -585,12 +538,8 @@ CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
 //=============================================================================
 char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
 {
-  if (theShape == NULL) return NULL;
-
   //Get the reference shape
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
   if (aShape.IsNull()) return NULL;
 
   // Get shape parameters
@@ -605,10 +554,8 @@ char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theSha
 //=============================================================================
 CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theShape)
 {
-  if (theShape == NULL) return -1;
-
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  if (aShape.IsNull()) return -1;
 
   CORBA::Long aNb = GetOperations()->NumberOfFaces(aShape);
   if (!GetOperations()->IsDone()) return -1;
@@ -623,10 +570,8 @@ CORBA::Long GEOM_IShapesOperations_i::NumberOfFaces (GEOM::GEOM_Object_ptr theSh
 //=============================================================================
 CORBA::Long GEOM_IShapesOperations_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape)
 {
-  if (theShape == NULL) return -1;
-
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  if (aShape.IsNull()) return -1;
 
   CORBA::Long aNb = GetOperations()->NumberOfEdges(aShape);
   if (!GetOperations()->IsDone()) return -1;
@@ -647,12 +592,8 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ChangeOrientation
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL) return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
   if (aShape.IsNull()) return aGEOMObject._retn();
 
   //Create the Solid
@@ -674,10 +615,9 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_p
   GetOperations()->SetNotDone();
 
   GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
-  if (theShape == NULL) return aSeq._retn();
 
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  if (aShape.IsNull()) return aSeq._retn();
 
   Handle(TColStd_HSequenceOfInteger) aHSeq =
     GetOperations()->GetFreeFacesIDs(aShape);
@@ -698,23 +638,18 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetFreeFacesIDs (GEOM::GEOM_Object_p
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
                                           (GEOM::GEOM_Object_ptr theShape1,
-                                          GEOM::GEOM_Object_ptr theShape2,
-                                          const CORBA::Long     theShapeType)
+                                           GEOM::GEOM_Object_ptr theShape2,
+                                           const CORBA::Long     theShapeType)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-  if (theShape1 == NULL ||
-      theShape2 == NULL) return aSeq._retn();
 
-  Handle(GEOM_Object) aShape1 = GetOperations()->GetEngine()->GetObject
-    (theShape1->GetStudyID(), theShape1->GetEntry());
-  Handle(GEOM_Object) aShape2 = GetOperations()->GetEngine()->GetObject
-    (theShape2->GetStudyID(), theShape2->GetEntry());
+  Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
+  Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
 
-  if (aShape1.IsNull() ||
-      aShape2.IsNull()) return aSeq._retn();
+  if (aShape1.IsNull() || aShape2.IsNull()) return aSeq._retn();
 
   Handle(TColStd_HSequenceOfTransient) aHSeq =
     GetOperations()->GetSharedShapes(aShape1, aShape2, theShapeType);
@@ -763,22 +698,18 @@ static GEOMAlgo_State ShapeState (const GEOM::shape_state theState)
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
                                                 (GEOM::GEOM_Object_ptr   theShape,
-                                                const CORBA::Long       theShapeType,
-                                                GEOM::GEOM_Object_ptr   theAx1,
-                                                const GEOM::shape_state theState)
+                                                 const CORBA::Long       theShapeType,
+                                                 GEOM::GEOM_Object_ptr   theAx1,
+                                                 const GEOM::shape_state theState)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theAx1 == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
-    (theAx1->GetStudyID(), theAx1->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
 
   if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
 
@@ -803,25 +734,20 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlane
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
                                                 (GEOM::GEOM_Object_ptr   theShape,
-                                                const CORBA::Long       theShapeType,
-                                                GEOM::GEOM_Object_ptr   theAx1,
-                                                GEOM::GEOM_Object_ptr   thePnt,
-                                                const GEOM::shape_state theState)
+                                                 const CORBA::Long       theShapeType,
+                                                 GEOM::GEOM_Object_ptr   theAx1,
+                                                 GEOM::GEOM_Object_ptr   thePnt,
+                                                 const GEOM::shape_state theState)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theAx1 == NULL || thePnt == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
-    (theAx1->GetStudyID(), theAx1->GetEntry());
-  Handle(GEOM_Object) anPnt = GetOperations()->GetEngine()->GetObject
-    (thePnt->GetStudyID(), thePnt->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
+  Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
 
   if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
 
@@ -846,23 +772,19 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocation
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
                                                 (GEOM::GEOM_Object_ptr   theShape,
-                                                const CORBA::Long       theShapeType,
-                                                GEOM::GEOM_Object_ptr   theAxis,
-                                                const CORBA::Double     theRadius,
-                                                const GEOM::shape_state theState)
+                                                 const CORBA::Long       theShapeType,
+                                                 GEOM::GEOM_Object_ptr   theAxis,
+                                                 const CORBA::Double     theRadius,
+                                                 const GEOM::shape_state theState)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theAxis == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
-    (theAxis->GetStudyID(), theAxis->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
 
   if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
 
@@ -887,23 +809,19 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnCylinder
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
                                                 (GEOM::GEOM_Object_ptr   theShape,
-                                                const CORBA::Long       theShapeType,
-                                                GEOM::GEOM_Object_ptr   theCenter,
-                                                const CORBA::Double     theRadius,
-                                                const GEOM::shape_state theState)
+                                                 const CORBA::Long       theShapeType,
+                                                 GEOM::GEOM_Object_ptr   theCenter,
+                                                 const CORBA::Double     theRadius,
+                                                 const GEOM::shape_state theState)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theCenter == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aCenter = GetOperations()->GetEngine()->GetObject
-    (theCenter->GetStudyID(), theCenter->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
 
   if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
 
@@ -940,30 +858,18 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape            == NULL ||
-      theTopLeftPoint     == NULL ||   
-      theTopRigthPoint    == NULL || 
-      theBottomLeftPoint  == NULL ||
-      theBottomRigthPoint == NULL )
-    return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aTopLeftPoint = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theTopLeftPoint->GetEntry());
-  Handle(GEOM_Object) aTopRigthPoint = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theTopRigthPoint->GetEntry());
-  Handle(GEOM_Object) aBottomLeftPoint = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theBottomLeftPoint->GetEntry());
-  Handle(GEOM_Object) aBottomRigthPoint = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theBottomRigthPoint->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
+  Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
+  Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
+  Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
 
   if (aShape.IsNull() ||
       aTopLeftPoint.IsNull() ||
       aTopRigthPoint.IsNull() ||
       aBottomLeftPoint.IsNull() ||
-      aBottomRigthPoint.IsNull() )
+      aBottomRigthPoint.IsNull())
     return aSeq._retn();
 
   //Get Shapes On Quadrangle
@@ -989,22 +895,18 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnQuadrangle
 //=============================================================================
 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
                                                 (GEOM::GEOM_Object_ptr   theShape,
-                                                const CORBA::Long       theShapeType,
-                                                GEOM::GEOM_Object_ptr   theAx1,
-                                                const GEOM::shape_state theState)
+                                                 const CORBA::Long       theShapeType,
+                                                 GEOM::GEOM_Object_ptr   theAx1,
+                                                 const GEOM::shape_state theState)
 {
   GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theAx1 == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
-    (theAx1->GetStudyID(), theAx1->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
 
   if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
 
@@ -1029,31 +931,27 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
 //=============================================================================
 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
                                                 (GEOM::GEOM_Object_ptr   theShape,
-                                                const CORBA::Long       theShapeType,
-                                                GEOM::GEOM_Object_ptr   theAx1,
-                                                GEOM::GEOM_Object_ptr   thePnt,
-                                                const GEOM::shape_state theState)
+                                                 const CORBA::Long       theShapeType,
+                                                 GEOM::GEOM_Object_ptr   theAx1,
+                                                 GEOM::GEOM_Object_ptr   thePnt,
+                                                 const GEOM::shape_state theState)
 {
   GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theAx1 == NULL || thePnt == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
-    (theAx1->GetStudyID(), theAx1->GetEntry());
-  Handle(GEOM_Object) anPnt = GetOperations()->GetEngine()->GetObject
-    (thePnt->GetStudyID(), thePnt->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) anAx1 = GetObjectImpl(theAx1);
+  Handle(GEOM_Object) anPnt = GetObjectImpl(thePnt);
 
   if (aShape.IsNull() || anAx1.IsNull() || anPnt.IsNull()) return aSeq._retn();
 
   //Get Shapes On Plane
   Handle(TColStd_HSequenceOfInteger) aHSeq =
-    GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType, anAx1, anPnt, ShapeState(theState));
+    GetOperations()->GetShapesOnPlaneWithLocationIDs(aShape, theShapeType,
+                                                     anAx1, anPnt, ShapeState(theState));
   if (!GetOperations()->IsDone() || aHSeq.IsNull())
     return aSeq._retn();
 
@@ -1072,23 +970,19 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneWithLocationIDs
 //=============================================================================
 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
                                                 (GEOM::GEOM_Object_ptr   theShape,
-                                                const CORBA::Long       theShapeType,
-                                                GEOM::GEOM_Object_ptr   theAxis,
-                                                const CORBA::Double     theRadius,
-                                                const GEOM::shape_state theState)
+                                                 const CORBA::Long       theShapeType,
+                                                 GEOM::GEOM_Object_ptr   theAxis,
+                                                 const CORBA::Double     theRadius,
+                                                 const GEOM::shape_state theState)
 {
   GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theAxis == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
-    (theAxis->GetStudyID(), theAxis->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
 
   if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
 
@@ -1113,23 +1007,19 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
 //=============================================================================
 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
                                                 (GEOM::GEOM_Object_ptr   theShape,
-                                                const CORBA::Long       theShapeType,
-                                                GEOM::GEOM_Object_ptr   theCenter,
-                                                const CORBA::Double     theRadius,
-                                                const GEOM::shape_state theState)
+                                                 const CORBA::Long       theShapeType,
+                                                 GEOM::GEOM_Object_ptr   theCenter,
+                                                 const CORBA::Double     theRadius,
+                                                 const GEOM::shape_state theState)
 {
   GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape == NULL || theCenter == NULL) return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aCenter = GetOperations()->GetEngine()->GetObject
-    (theCenter->GetStudyID(), theCenter->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aCenter = GetObjectImpl(theCenter);
 
   if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
 
@@ -1166,24 +1056,12 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnQuadrangleIDs
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShape            == NULL ||
-      theTopLeftPoint     == NULL ||   
-      theTopRigthPoint    == NULL || 
-      theBottomLeftPoint  == NULL ||
-      theBottomRigthPoint == NULL )
-    return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aTopLeftPoint = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theTopLeftPoint->GetEntry());
-  Handle(GEOM_Object) aTopRigthPoint = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theTopRigthPoint->GetEntry());
-  Handle(GEOM_Object) aBottomLeftPoint = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theBottomLeftPoint->GetEntry());
-  Handle(GEOM_Object) aBottomRigthPoint = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theBottomRigthPoint->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aTopLeftPoint = GetObjectImpl(theTopLeftPoint);
+  Handle(GEOM_Object) aTopRigthPoint = GetObjectImpl(theTopRigthPoint);
+  Handle(GEOM_Object) aBottomLeftPoint = GetObjectImpl(theBottomLeftPoint);
+  Handle(GEOM_Object) aBottomRigthPoint = GetObjectImpl(theBottomRigthPoint);
 
   if (aShape.IsNull() ||
       aTopLeftPoint.IsNull() ||
@@ -1224,14 +1102,9 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if ( theShape == NULL ||  theBox == NULL )
-    return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aBox = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theBox->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
 
   if (aShape.IsNull() || aBox.IsNull() )
     return aSeq._retn();
@@ -1257,7 +1130,7 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnBox
 //=============================================================================
 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
                                                 (GEOM::GEOM_Object_ptr theBox,
-                                                GEOM::GEOM_Object_ptr theShape,
+                                                 GEOM::GEOM_Object_ptr theShape,
                                                  CORBA::Long           theShapeType,
                                                  GEOM::shape_state     theState)
 {
@@ -1266,14 +1139,9 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if ( theShape == NULL ||  theBox == NULL )
-    return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aBox = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theBox->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aBox = GetObjectImpl(theBox);
 
   if (aShape.IsNull() || aBox.IsNull() )
     return aSeq._retn();
@@ -1300,23 +1168,18 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnBoxIDs
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
                                            (GEOM::GEOM_Object_ptr theCheckShape,
-                                           GEOM::GEOM_Object_ptr theShape,
-                                           CORBA::Short          theShapeType,
-                                           GEOM::shape_state     theState)
+                                            GEOM::GEOM_Object_ptr theShape,
+                                            CORBA::Short          theShapeType,
+                                            GEOM::shape_state     theState)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if ( theShape == NULL ||  theCheckShape == NULL )
-    return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aCheckShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theCheckShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
 
   if (aShape.IsNull() || aCheckShape.IsNull() )
     return aSeq._retn();
@@ -1344,23 +1207,18 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
                                            (GEOM::GEOM_Object_ptr theCheckShape,
-                                           GEOM::GEOM_Object_ptr theShape,
-                                           CORBA::Short          theShapeType,
-                                           GEOM::shape_state     theState)
+                                            GEOM::GEOM_Object_ptr theShape,
+                                            CORBA::Short          theShapeType,
+                                            GEOM::shape_state     theState)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if ( theShape == NULL ||  theCheckShape == NULL )
-    return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aCheckShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theCheckShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
 
   if (aShape.IsNull() || aCheckShape.IsNull() )
     return aGEOMObject._retn();
@@ -1383,23 +1241,18 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound
 //=============================================================================
 GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
                                            (GEOM::GEOM_Object_ptr theCheckShape,
-                                           GEOM::GEOM_Object_ptr theShape,
-                                           CORBA::Short          theShapeType,
-                                           GEOM::shape_state     theState)
+                                            GEOM::GEOM_Object_ptr theShape,
+                                            CORBA::Short          theShapeType,
+                                            GEOM::shape_state     theState)
 {
   GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if ( theShape == NULL ||  theCheckShape == NULL )
-    return aSeq._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theShape->GetEntry());
-  Handle(GEOM_Object) aCheckShape = GetOperations()->GetEngine()->GetObject
-    (theShape->GetStudyID(), theCheckShape->GetEntry());
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aCheckShape = GetObjectImpl(theCheckShape);
 
   if (aShape.IsNull() || aCheckShape.IsNull() )
     return aSeq._retn();
@@ -1426,21 +1279,16 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
                                           (GEOM::GEOM_Object_ptr theShapeWhere,
-                                          GEOM::GEOM_Object_ptr theShapeWhat)
+                                           GEOM::GEOM_Object_ptr theShapeWhat)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShapeWhere == NULL ||
-      theShapeWhat == NULL) return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
-    (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
-  Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
-    (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
+  Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
+  Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
 
   if (aShapeWhere.IsNull() ||
       aShapeWhat.IsNull()) return aGEOMObject._retn();
@@ -1461,21 +1309,16 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
                                           (GEOM::GEOM_Object_ptr theShapeWhere,
-                                          GEOM::GEOM_Object_ptr theShapeWhat)
+                                           GEOM::GEOM_Object_ptr theShapeWhat)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShapeWhere == NULL ||
-      theShapeWhat == NULL) return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
-    (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
-  Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
-    (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
+  Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
+  Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
 
   if (aShapeWhere.IsNull() ||
       aShapeWhat.IsNull()) return aGEOMObject._retn();
@@ -1496,21 +1339,16 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
                                           (GEOM::GEOM_Object_ptr theShapeWhere,
-                                          GEOM::GEOM_Object_ptr theShapeWhat)
+                                           GEOM::GEOM_Object_ptr theShapeWhat)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theShapeWhere == NULL ||
-      theShapeWhat == NULL) return aGEOMObject._retn();
-
   //Get the reference objects
-  Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
-    (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
-  Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
-    (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
+  Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
+  Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
 
   if (aShapeWhere.IsNull() ||
       aShapeWhat.IsNull()) return aGEOMObject._retn();
@@ -1523,4 +1361,3 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetSame
 
   return GetObject(anObject);
 }
-
index ac359856dd5fc18dc94cd6afc9aeacfdd35e25e0..ef24cb3901d7191809c32f4c917c6b3faf9fa1c8 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include <Standard_Stream.hxx>
 
 #include "GEOM_ITransformOperations_i.hh"
@@ -42,8 +42,8 @@
 //=============================================================================
 
 GEOM_ITransformOperations_i::GEOM_ITransformOperations_i (PortableServer::POA_ptr thePOA,
-                                                         GEOM::GEOM_Gen_ptr theEngine,
-                                                         ::GEOMImpl_ITransformOperations* theImpl)
+                                                          GEOM::GEOM_Gen_ptr theEngine,
+                                                          ::GEOMImpl_ITransformOperations* theImpl)
      :GEOM_IOperations_i(thePOA, theEngine, theImpl)
 {
   MESSAGE("GEOM_ITransformOperations_i::GEOM_ITransformOperations_i");
@@ -68,17 +68,17 @@ GEOM_ITransformOperations_i::~GEOM_ITransformOperations_i()
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr thePoint1,
-                                             GEOM::GEOM_Object_ptr thePoint2)
+                                              GEOM::GEOM_Object_ptr thePoint1,
+                                              GEOM::GEOM_Object_ptr thePoint2)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (thePoint1 == NULL || thePoint2 == NULL || theObject == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
-  if(!theObject->IsMainShape()) {
+  if (!theObject->IsMainShape()) {
     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
     return aGEOMObject._retn();
   }
@@ -86,21 +86,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the first point of translation
-  CORBA::String_var aP1Entry = thePoint1->GetEntry();
-  Handle(GEOM_Object) aPoint1 =
-    GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
+  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
   if (aPoint1.IsNull()) return aGEOMObject._retn();
 
   //Get the second point of translation
-  CORBA::String_var aP2Entry = thePoint2->GetEntry();
-  Handle(GEOM_Object) aPoint2 =
-    GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
+  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
   if (aPoint2.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
@@ -116,32 +110,24 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr thePoint1,
-                                             GEOM::GEOM_Object_ptr thePoint2)
+                                              GEOM::GEOM_Object_ptr thePoint1,
+                                              GEOM::GEOM_Object_ptr thePoint2)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (thePoint1 == NULL || thePoint2 == NULL || theObject == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the first point of translation
-  CORBA::String_var aP1Entry = thePoint1->GetEntry();
-  Handle(GEOM_Object) aPoint1 =
-    GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
+  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
   if (aPoint1.IsNull()) return aGEOMObject._retn();
 
   //Get the second point of translation
-  CORBA::String_var aP2Entry = thePoint2->GetEntry();
-  Handle(GEOM_Object) aPoint2 =
-    GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
+  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
   if (aPoint2.IsNull()) return aGEOMObject._retn();
 
   //Create the translated shape
@@ -159,17 +145,17 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
-                                                   (GEOM::GEOM_Object_ptr theObject,
-                                                   CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
+                      (GEOM::GEOM_Object_ptr theObject,
+                       CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
-  GEOM::GEOM_Object_var aGEOMObject ;
+  GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theObject == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
-  if(!theObject->IsMainShape()) {
+  if (!theObject->IsMainShape()) {
     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
     return aGEOMObject._retn();
   }
@@ -177,9 +163,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
@@ -188,7 +172,6 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
   return aGEOMObject._retn();
 }
 
-
 //=============================================================================
 /*!
  *  TranslateDXDYDZCopy
@@ -196,19 +179,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
+                                              CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Create the translated shape
@@ -220,7 +199,6 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy
   return GetObject(anObject);
 }
 
-
 //=============================================================================
 /*!
  *  TranslateVector
@@ -228,16 +206,16 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr theVector)
+                                             GEOM::GEOM_Object_ptr theVector)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
-  if(!theObject->IsMainShape()) {
+  if (!theObject->IsMainShape()) {
     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
     return aGEOMObject._retn();
   }
@@ -245,15 +223,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  CORBA::String_var aVEntry = theVector->GetEntry();
-  Handle(GEOM_Object) aVector =
-    GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVEntry);
+  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
@@ -269,25 +243,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr theVector)
+                                             GEOM::GEOM_Object_ptr theVector)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  CORBA::String_var aVEntry = theVector->GetEntry();
-  Handle(GEOM_Object) aVector =
-    GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVEntry);
+  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
@@ -305,14 +273,14 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr theVector,
-                                            CORBA::Double theDistance,
-                                            CORBA::Boolean theCopy)
+                                             GEOM::GEOM_Object_ptr theVector,
+                                             CORBA::Double theDistance,
+                                             CORBA::Boolean theCopy)
 {
   GEOM::GEOM_Object_var aGEOMObject;
   GetOperations()->SetNotDone(); //Set a not done flag
 
-  if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
   if (!theCopy && !theObject->IsMainShape()) {
@@ -324,15 +292,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
     aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  CORBA::String_var aVecEntry = theVector->GetEntry();
-  Handle(GEOM_Object) aVector =
-    GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
+  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
@@ -355,17 +319,17 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr theObject,
-                                                          GEOM::GEOM_Object_ptr theAxis,
-                                                          CORBA::Double theAngle)
+                                                           GEOM::GEOM_Object_ptr theAxis,
+                                                           CORBA::Double theAngle)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
-  if(!theObject->IsMainShape()) {
+  if (!theObject->IsMainShape()) {
     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
     return aGEOMObject._retn();
   }
@@ -373,15 +337,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the axis of revolution
-  CORBA::String_var anAEntry = theAxis->GetEntry();
-  Handle(GEOM_Object) anAxis =
-    GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
+  Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
   if (anAxis.IsNull()) return aGEOMObject._retn();
 
   //Perform the rotation
@@ -396,26 +356,20 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object_ptr theObject,
-                                                              GEOM::GEOM_Object_ptr theAxis,
-                                                              CORBA::Double theAngle)
+                                                               GEOM::GEOM_Object_ptr theAxis,
+                                                               CORBA::Double theAngle)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the axis of rotation
-  CORBA::String_var anAEntry = theAxis->GetEntry();
-  Handle(GEOM_Object) anAxis =
-    GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
+  Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
   if (anAxis.IsNull()) return aGEOMObject._retn();
 
   //Perform the rotation
@@ -426,7 +380,6 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object
   return GetObject(anObject);
 }
 
-
 //=============================================================================
 /*!
  *  MirrorPlane
@@ -434,14 +387,14 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr thePlane)
+                                             GEOM::GEOM_Object_ptr thePlane)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || thePlane == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
   if (!theObject->IsMainShape()) {
@@ -450,15 +403,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
   }
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the plane
-  CORBA::String_var aPlnEntry = thePlane->GetEntry();
-  Handle(GEOM_Object) aPlane =
-    GetOperations()->GetEngine()->GetObject(thePlane->GetStudyID(), aPlnEntry);
+  Handle(GEOM_Object) aPlane = GetObjectImpl(thePlane);
   if (aPlane.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
@@ -474,25 +423,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr thePlane)
+                                             GEOM::GEOM_Object_ptr thePlane)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || thePlane == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  CORBA::String_var aPlnEntry = thePlane->GetEntry();
-  Handle(GEOM_Object) aPlane =
-    GetOperations()->GetEngine()->GetObject(thePlane->GetStudyID(), aPlnEntry);
+  Handle(GEOM_Object) aPlane = GetObjectImpl(thePlane);
   if (aPlane.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
@@ -510,31 +453,27 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr theAxis)
+                                             GEOM::GEOM_Object_ptr theAxis)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
-  if(!theObject->IsMainShape()) {
+  if (!theObject->IsMainShape()) {
     GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
     return aGEOMObject._retn();
   }
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the axis
-  CORBA::String_var anAEntry = theAxis->GetEntry();
-  Handle(GEOM_Object) aAxis =
-    GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
+  Handle(GEOM_Object) aAxis = GetObjectImpl(theAxis);
   if (aAxis.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
@@ -550,25 +489,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr theAxis)
+                                             GEOM::GEOM_Object_ptr theAxis)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || theAxis == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  CORBA::String_var anAEntry = theAxis->GetEntry();
-  Handle(GEOM_Object) aAxis =
-    GetOperations()->GetEngine()->GetObject(theAxis->GetStudyID(), anAEntry);
+  Handle(GEOM_Object) aAxis = GetObjectImpl(theAxis);
   if (aAxis.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
@@ -586,14 +519,14 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr thePoint)
+                                             GEOM::GEOM_Object_ptr thePoint)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || thePoint == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
   if (!theObject->IsMainShape()) {
@@ -602,15 +535,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
   }
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
-  CORBA::String_var aPntEntry = thePoint->GetEntry();
-  Handle(GEOM_Object) aPoint =
-    GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
+  Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
   if (aPoint.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
@@ -626,25 +555,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
                                             (GEOM::GEOM_Object_ptr theObject,
-                                            GEOM::GEOM_Object_ptr thePoint)
+                                             GEOM::GEOM_Object_ptr thePoint)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || thePoint == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  CORBA::String_var aPntEntry = thePoint->GetEntry();
-  Handle(GEOM_Object) aPoint =
-    GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
+  Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
   if (aPoint.IsNull()) return aGEOMObject._retn();
 
   //Perform the mirror
@@ -655,7 +578,6 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
   return GetObject(anObject);
 }
 
-
 //=============================================================================
 /*!
  *  OffsetShape
@@ -663,14 +585,14 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             CORBA::Double theOffset)
+                                              CORBA::Double theOffset)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL) return aGEOMObject._retn();
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   //check if the object is a subshape
   if (!theObject->IsMainShape()) {
@@ -679,9 +601,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
   }
 
   //Get the basic object
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Create the offset shape
@@ -697,19 +617,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             CORBA::Double theOffset)
+                                              CORBA::Double theOffset)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL) return aGEOMObject._retn();
-
   //Get the basic object
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Create the offset shape
@@ -720,7 +636,6 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
   return GetObject(anObject);
 }
 
-
 //=============================================================================
 /*!
  *  ScaleShape
@@ -728,8 +643,8 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr thePoint,
-                                             CORBA::Double         theFactor)
+                                              GEOM::GEOM_Object_ptr thePoint,
+                                              CORBA::Double         theFactor)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
@@ -745,16 +660,13 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
   }
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
   Handle(GEOM_Object) aPoint;
   if (!thePoint->_is_nil()) {
-    CORBA::String_var aPntEntry = thePoint->GetEntry();
-    aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
+    aPoint = GetObjectImpl(thePoint);
     if (aPoint.IsNull()) return aGEOMObject._retn();
   }
 
@@ -771,27 +683,22 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr thePoint,
-                                             CORBA::Double         theFactor)
+                                              GEOM::GEOM_Object_ptr thePoint,
+                                              CORBA::Double         theFactor)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject->_is_nil()) return aGEOMObject._retn();
-
   //Get the basic object
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
   Handle(GEOM_Object) aPoint;
   if (!thePoint->_is_nil()) {
-    CORBA::String_var aPntEntry = thePoint->GetEntry();
-    aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
+    aPoint = GetObjectImpl(thePoint);
     if (aPoint.IsNull()) return aGEOMObject._retn();
   }
 
@@ -811,10 +718,10 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr thePoint,
-                                             CORBA::Double         theFactorX,
-                                             CORBA::Double         theFactorY,
-                                             CORBA::Double         theFactorZ)
+                                              GEOM::GEOM_Object_ptr thePoint,
+                                              CORBA::Double         theFactorX,
+                                              CORBA::Double         theFactorY,
+                                              CORBA::Double         theFactorZ)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
@@ -830,16 +737,13 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
   }
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
   Handle(GEOM_Object) aPoint;
   if (!thePoint->_is_nil()) {
-    CORBA::String_var aPntEntry = thePoint->GetEntry();
-    aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
+    aPoint = GetObjectImpl(thePoint);
     if (aPoint.IsNull()) return aGEOMObject._retn();
   }
 
@@ -857,29 +761,24 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxesCopy
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr thePoint,
-                                             CORBA::Double         theFactorX,
-                                             CORBA::Double         theFactorY,
-                                             CORBA::Double         theFactorZ)
+                                              GEOM::GEOM_Object_ptr thePoint,
+                                              CORBA::Double         theFactorX,
+                                              CORBA::Double         theFactorY,
+                                              CORBA::Double         theFactorZ)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject->_is_nil()) return aGEOMObject._retn();
-
   //Get the basic object
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the point
   Handle(GEOM_Object) aPoint;
   if (!thePoint->_is_nil()) {
-    CORBA::String_var aPntEntry = thePoint->GetEntry();
-    aPoint = GetOperations()->GetEngine()->GetObject(thePoint->GetStudyID(), aPntEntry);
+    aPoint = GetObjectImpl(thePoint);
     if (aPoint.IsNull()) return aGEOMObject._retn();
   }
 
@@ -899,15 +798,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxesCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr theStartLCS,
-                                             GEOM::GEOM_Object_ptr theEndLCS)
+                                              GEOM::GEOM_Object_ptr theStartLCS,
+                                              GEOM::GEOM_Object_ptr theEndLCS)
 {
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || theEndLCS == NULL)
+  if (CORBA::is_nil(theObject) || CORBA::is_nil(theEndLCS))
     return aGEOMObject._retn();
 
   //check if the object is a subshape
@@ -917,23 +816,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
   }
 
   //Get the basic object
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the Start LCS (may be NULL for positioning from global LCS)
-  Handle(GEOM_Object) aStartLCS = NULL;
-  if (theStartLCS != NULL && !CORBA::is_nil(theStartLCS)) {
-    CORBA::String_var aStartLCSEntry = theStartLCS->GetEntry();
-    aStartLCS = GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), aStartLCSEntry);
+  Handle(GEOM_Object) aStartLCS;
+  if (!CORBA::is_nil(theStartLCS)) {
+    aStartLCS = GetObjectImpl(theStartLCS);
     if (aStartLCS.IsNull()) return aGEOMObject._retn();
   }
 
   //Get the End LCS
-  CORBA::String_var anEndLCSEntry = theEndLCS->GetEntry();
-  Handle(GEOM_Object) aEndLCS =
-    GetOperations()->GetEngine()->GetObject(theEndLCS->GetStudyID(), anEndLCSEntry);
+  Handle(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
   if (aEndLCS.IsNull()) return aGEOMObject._retn();
 
   //Perform the Position
@@ -949,35 +843,27 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr theStartLCS,
-                                             GEOM::GEOM_Object_ptr theEndLCS)
+                                              GEOM::GEOM_Object_ptr theStartLCS,
+                                              GEOM::GEOM_Object_ptr theEndLCS)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || theEndLCS == NULL)
-    return aGEOMObject._retn();
-
   //Get the basic object
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the Start LCS (may be NULL for positioning from global LCS)
-  Handle(GEOM_Object) aStartLCS = NULL;
-  if (theStartLCS != NULL && !CORBA::is_nil(theStartLCS)) {
-    CORBA::String_var aStartLCSEntry = theStartLCS->GetEntry();
-    aStartLCS = GetOperations()->GetEngine()->GetObject(theStartLCS->GetStudyID(), aStartLCSEntry);
+  Handle(GEOM_Object) aStartLCS;
+  if (!CORBA::is_nil(theStartLCS)) {
+    aStartLCS = GetObjectImpl(theStartLCS);
     if (aStartLCS.IsNull()) return aGEOMObject._retn();
   }
 
   //Get the End LCS
-  CORBA::String_var anEndLCSEntry = theEndLCS->GetEntry();
-  Handle(GEOM_Object) aEndLCS =
-    GetOperations()->GetEngine()->GetObject(theEndLCS->GetStudyID(), anEndLCSEntry);
+  Handle(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS);
   if (aEndLCS.IsNull()) return aGEOMObject._retn();
 
   //Perform the position
@@ -996,29 +882,22 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr thePath,
-                                             CORBA::Double         theDistance,
-                                             CORBA::Boolean        theCopy,
-                                             CORBA::Boolean        theReverse)
+                                              GEOM::GEOM_Object_ptr thePath,
+                                              CORBA::Double         theDistance,
+                                              CORBA::Boolean        theCopy,
+                                              CORBA::Boolean        theReverse)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theObject == NULL || thePath == NULL)
-    return aGEOMObject._retn();
-
   //Get the basic object
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the path object
-  CORBA::String_var aPathEntry = thePath->GetEntry();
-  Handle(GEOM_Object) aPathObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), aPathEntry);
+  Handle(GEOM_Object) aPathObject = GetObjectImpl(thePath);
   if (aPathObject.IsNull()) return aGEOMObject._retn();
 
   //Perform the position
@@ -1037,26 +916,20 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D
                            (GEOM::GEOM_Object_ptr theObject,
-                           GEOM::GEOM_Object_ptr theVector,
-                           CORBA::Double theStep, CORBA::Long theNbTimes)
+                            GEOM::GEOM_Object_ptr theVector,
+                            CORBA::Double theStep, CORBA::Long theNbTimes)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector of translation
-  CORBA::String_var aVecEntry = theVector->GetEntry();
-  Handle(GEOM_Object) aVector =
-    GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
+  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
@@ -1073,36 +946,28 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
-                                                                    GEOM::GEOM_Object_ptr theVector1,
-                                                                    CORBA::Double theStep1,
-                                                                    CORBA::Long theNbTimes1,
-                                                                    GEOM::GEOM_Object_ptr theVector2,
-                                                                    CORBA::Double theStep2,
-                                                                    CORBA::Long theNbTimes2)
+                                                                     GEOM::GEOM_Object_ptr theVector1,
+                                                                     CORBA::Double theStep1,
+                                                                     CORBA::Long theNbTimes1,
+                                                                     GEOM::GEOM_Object_ptr theVector2,
+                                                                     CORBA::Double theStep2,
+                                                                     CORBA::Long theNbTimes2)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theObject == NULL || theVector1 == NULL || theVector2 == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the vector1 of translation
-  CORBA::String_var aVec1Entry = theVector1->GetEntry();
-  Handle(GEOM_Object) aVector1 =
-    GetOperations()->GetEngine()->GetObject(theVector1->GetStudyID(), aVec1Entry);
+  Handle(GEOM_Object) aVector1 = GetObjectImpl(theVector1);
   if (aVector1.IsNull()) return aGEOMObject._retn();
 
   //Get the vector2 of translation
-  CORBA::String_var aVec2Entry = theVector2->GetEntry();
-  Handle(GEOM_Object) aVector2 =
-    GetOperations()->GetEngine()->GetObject(theVector2->GetStudyID(), aVec2Entry);
+  Handle(GEOM_Object) aVector2 = GetObjectImpl(theVector2);
   if (aVector2.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
@@ -1119,26 +984,20 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Object_ptr theObject,
-                                                                 GEOM::GEOM_Object_ptr theVector,
-                                                                 CORBA::Long theNbTimes)
+                                                                  GEOM::GEOM_Object_ptr theVector,
+                                                                  CORBA::Long theNbTimes)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the a directon of rotation
-  CORBA::String_var aVecEntry = theVector->GetEntry();
-  Handle(GEOM_Object) aVector =
-    GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
+  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the rotation
@@ -1154,29 +1013,23 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Obj
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Object_ptr theObject,
-                                                                 GEOM::GEOM_Object_ptr theVector,
-                                                                 CORBA::Double theAngle,
-                                                                 CORBA::Long theNbTimes1,
-                                                                 CORBA::Double theStep,
-                                                                 CORBA::Long theNbTimes2)
+                                                                  GEOM::GEOM_Object_ptr theVector,
+                                                                  CORBA::Double theAngle,
+                                                                  CORBA::Long theNbTimes1,
+                                                                  CORBA::Double theStep,
+                                                                  CORBA::Long theNbTimes2)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
 
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the a directon of rotation
-  CORBA::String_var aVecEntry = theVector->GetEntry();
-  Handle(GEOM_Object) aVector =
-    GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), aVecEntry);
+  Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
   if (aVector.IsNull()) return aGEOMObject._retn();
 
   //Perform the rotation
@@ -1194,15 +1047,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Obj
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr theCentPoint,
-                                             GEOM::GEOM_Object_ptr thePoint1,
-                                             GEOM::GEOM_Object_ptr thePoint2)
+                                              GEOM::GEOM_Object_ptr theCentPoint,
+                                              GEOM::GEOM_Object_ptr thePoint1,
+                                              GEOM::GEOM_Object_ptr thePoint2)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theCentPoint == NULL || thePoint1 == NULL || thePoint2 == NULL || theObject == NULL)
+  if (CORBA::is_nil(theObject))
     return aGEOMObject._retn();
 
   //check if the object is a subshape
@@ -1214,27 +1067,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Get the central point of rotation
-  CORBA::String_var aCPEntry = theCentPoint->GetEntry();
-  Handle(GEOM_Object) aCentPoint =
-    GetOperations()->GetEngine()->GetObject(theCentPoint->GetStudyID(), aCPEntry);
+  Handle(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
   if (aCentPoint.IsNull()) return aGEOMObject._retn();
 
   //Get the first point
-  CORBA::String_var aP1Entry = thePoint1->GetEntry();
-  Handle(GEOM_Object) aPoint1 =
-    GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
+  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
   if (aPoint1.IsNull()) return aGEOMObject._retn();
 
   //Get the second point
-  CORBA::String_var aP2Entry = thePoint2->GetEntry();
-  Handle(GEOM_Object) aPoint2 =
-    GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
+  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
   if (aPoint2.IsNull()) return aGEOMObject._retn();
 
   //Perform the translation
@@ -1250,40 +1095,29 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy
                                              (GEOM::GEOM_Object_ptr theObject,
-                                             GEOM::GEOM_Object_ptr theCentPoint,
-                                             GEOM::GEOM_Object_ptr thePoint1,
-                                             GEOM::GEOM_Object_ptr thePoint2)
+                                              GEOM::GEOM_Object_ptr theCentPoint,
+                                              GEOM::GEOM_Object_ptr thePoint1,
+                                              GEOM::GEOM_Object_ptr thePoint2)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
 
-  if (theCentPoint == NULL || thePoint1 == NULL || thePoint2 == NULL || theObject == NULL)
-    return aGEOMObject._retn();
-
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) aBasicObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
 
   //Get the central point of rotation
-  CORBA::String_var aCPEntry = theCentPoint->GetEntry();
-  Handle(GEOM_Object) aCentPoint =
-    GetOperations()->GetEngine()->GetObject(theCentPoint->GetStudyID(), aCPEntry);
+  Handle(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint);
   if (aCentPoint.IsNull()) return aGEOMObject._retn();
 
   //Get the first point
-  CORBA::String_var aP1Entry = thePoint1->GetEntry();
-  Handle(GEOM_Object) aPoint1 =
-    GetOperations()->GetEngine()->GetObject(thePoint1->GetStudyID(), aP1Entry);
+  Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
   if (aPoint1.IsNull()) return aGEOMObject._retn();
 
   //Get the second point
-  CORBA::String_var aP2Entry = thePoint2->GetEntry();
-  Handle(GEOM_Object) aPoint2 =
-    GetOperations()->GetEngine()->GetObject(thePoint2->GetStudyID(), aP2Entry);
+  Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
   if (aPoint2.IsNull()) return aGEOMObject._retn();
 
   //Perform the rotation
@@ -1307,20 +1141,12 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject
   GetOperations()->SetNotDone();
   GEOM::GEOM_Object_var aGEOMObject;
 
-  if (theObject == NULL) return aGEOMObject._retn();
-
-  //check if the object is a subshape
-  //if (!theObject->IsMainShape()) {
-  //  GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
-  //  return aGEOMObject._retn();
-  //}
+  if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
 
   aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
 
   //Get the object itself
-  CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject =
-    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
   if (anObject.IsNull()) return aGEOMObject._retn();
 
   //Perform the recomputation