Salome HOME
Merge branch 'V9_11_BR'
[modules/geom.git] / src / GEOM / GEOM_Object.cxx
index 2aac31bf5754fc0a847784939cd3e665cb69768f..7471cd8ea66fd365933d44b17ec72a9ac3886e16 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -46,7 +46,7 @@
  */
 //=============================================================================
 
-Handle(GEOM_Object) GEOM_Object::GetObject(TDF_Label& theLabel)
+Handle(GEOM_Object) GEOM_Object::GetObject(const TDF_Label& theLabel)
 {
   Handle(GEOM_BaseObject) base = GEOM_BaseObject::GetObject(theLabel);
   return Handle(GEOM_Object)::DownCast( base );
@@ -58,7 +58,7 @@ Handle(GEOM_Object) GEOM_Object::GetObject(TDF_Label& theLabel)
  */
 //=============================================================================
 
-Handle(GEOM_Object) GEOM_Object::GetReferencedObject(TDF_Label& theLabel)
+Handle(GEOM_Object) GEOM_Object::GetReferencedObject(const TDF_Label& theLabel)
 {
   Handle(GEOM_BaseObject) base = GEOM_BaseObject::GetReferencedObject(theLabel);
   return Handle(GEOM_Object)::DownCast( base );
@@ -93,7 +93,7 @@ GEOM_Object::GEOM_Object(TDF_Label& theEntry, int theType)
 //=============================================================================
 GEOM_Object::~GEOM_Object()
 {
-  MESSAGE("GEOM_Object::~GEOM_Object()");
+  //MESSAGE("GEOM_Object::~GEOM_Object()");
 }
 
 //=============================================================================
@@ -275,5 +275,26 @@ bool GEOM_Object::IsMainShape()
   return false;
 }
 
-IMPLEMENT_STANDARD_HANDLE (GEOM_Object, GEOM_BaseObject );
-IMPLEMENT_STANDARD_RTTIEXT(GEOM_Object, GEOM_BaseObject );
+//================================================================================
+/*!
+ * \brief Returns GetLastFunction() of given objects
+ */
+//================================================================================
+
+Handle(TColStd_HSequenceOfTransient)
+GEOM_Object::GetLastFunctions( const std::list< Handle(GEOM_Object) >& theObjects )
+{
+  Handle(TColStd_HSequenceOfTransient) funs = new TColStd_HSequenceOfTransient;
+  std::list<Handle(GEOM_Object)>::const_iterator it = theObjects.begin();
+  for (; it != theObjects.end(); it++)
+  {
+    Handle(GEOM_Function) fun = (*it)->GetLastFunction();
+    if ( fun.IsNull())
+      return Handle(TColStd_HSequenceOfTransient)();
+    funs->Append( fun );
+  }
+  return funs;
+}
+
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_Object, GEOM_BaseObject )
+