Salome HOME
Implementation of gluing faces by given list (for PAL13191).
[modules/geom.git] / src / GEOM_I / GEOM_IHealingOperations_i.cc
index 7060b2afd8b7da4d24b3027ac41a51d9699b5611..cdd3f1efec13f02368601a86dfef46afbaa98045 100644 (file)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// 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.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// 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>
@@ -435,3 +454,71 @@ CORBA::Boolean GEOM_IHealingOperations_i::GetFreeBoundary ( GEOM::GEOM_Object_pt
 
   return true;
 }
+
+
+//=============================================================================
+/*!
+ *  ChangeOrientation
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientation (GEOM::GEOM_Object_ptr theObject)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  // Set a not done flag
+  GetOperations()->SetNotDone();
+
+  // Check parameters
+  if ( CORBA::is_nil(theObject) )
+    return aGEOMObject._retn();
+
+  aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
+
+  // Get the object itself
+  Handle(GEOM_Object) anObject =
+    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+  if (anObject.IsNull())
+    return aGEOMObject._retn();
+
+  // Perform
+//  Handle(GEOM_Object) aNewObject =
+    GetOperations()->ChangeOrientation( anObject );
+//  if (!GetOperations()->IsDone() || aNewObject.IsNull())
+//    return aGEOMObject._retn();
+
+  //return GetObject(aNewObject);
+  return aGEOMObject._retn();  
+}
+
+
+//=============================================================================
+/*!
+ *  ChangeOrientationCopy
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientationCopy (GEOM::GEOM_Object_ptr theObject)
+{
+  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());
+  if (anObject.IsNull())
+    return aGEOMObject._retn();
+
+  // Perform
+  Handle(GEOM_Object) aNewObject =
+    GetOperations()->ChangeOrientationCopy( anObject );
+  if (!GetOperations()->IsDone() || aNewObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(aNewObject);
+}
+