Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/geom.git] / src / GEOM_I / GEOM_IMeasureOperations_i.cc
index d4e8c6a8e67fc9bf8d9c74c332c330794d5b48f6..84248c73bcd2f408ab954e8d1de21403287a9a33 100644 (file)
@@ -1,23 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// 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.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// 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.
+//  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.
 //
-// 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
+//  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.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  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 "GEOM_IMeasureOperations_i.hh"
@@ -473,3 +474,151 @@ CORBA::Double GEOM_IMeasureOperations_i::GetAngle (GEOM::GEOM_Object_ptr theShap
   // Get the angle
   return GetOperations()->GetAngle(aShape1, aShape2);
 }
+
+
+//=============================================================================
+/*!
+ *  CurveCurvatureByParam
+ */
+//=============================================================================
+CORBA::Double GEOM_IMeasureOperations_i::CurveCurvatureByParam
+                       (GEOM::GEOM_Object_ptr theCurve, CORBA::Double theParam)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if(theCurve==NULL) return -1.0;
+
+  //Get the reference shape
+  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+    (theCurve->GetStudyID(), theCurve->GetEntry());
+
+  if(aShape.IsNull()) return -1.0;
+
+  return GetOperations()->CurveCurvatureByParam(aShape,theParam);
+}
+
+
+//=============================================================================
+/*!
+ *  CurveCurvatureByPoint
+ */
+//=============================================================================
+CORBA::Double GEOM_IMeasureOperations_i::CurveCurvatureByPoint
+               (GEOM::GEOM_Object_ptr theCurve, GEOM::GEOM_Object_ptr thePoint)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if( theCurve==NULL || thePoint==NULL ) return -1.0;
+
+  //Get the reference shape
+  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+    (theCurve->GetStudyID(), theCurve->GetEntry());
+  Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
+    (thePoint->GetStudyID(), thePoint->GetEntry());
+
+  if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
+
+  return GetOperations()->CurveCurvatureByPoint(aShape,aPoint);
+}
+
+
+//=============================================================================
+/*!
+ *  MaxSurfaceCurvatureByParam
+ */
+//=============================================================================
+CORBA::Double GEOM_IMeasureOperations_i::MaxSurfaceCurvatureByParam
+                                                (GEOM::GEOM_Object_ptr theSurf,
+                                                CORBA::Double theUParam,
+                                                CORBA::Double theVParam)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if(theSurf==NULL) return -1.0;
+
+  //Get the reference shape
+  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+    (theSurf->GetStudyID(), theSurf->GetEntry());
+
+  if(aShape.IsNull()) return -1.0;
+
+  return GetOperations()->MaxSurfaceCurvatureByParam(aShape,theUParam,theVParam);
+}
+
+
+//=============================================================================
+/*!
+ *  MaxSurfaceCurvatureByPoint
+ */
+//=============================================================================
+CORBA::Double GEOM_IMeasureOperations_i::MaxSurfaceCurvatureByPoint
+                (GEOM::GEOM_Object_ptr theSurf, GEOM::GEOM_Object_ptr thePoint)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if( theSurf==NULL || thePoint==NULL ) return -1.0;
+
+  //Get the reference shape
+  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+    (theSurf->GetStudyID(), theSurf->GetEntry());
+  Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
+    (thePoint->GetStudyID(), thePoint->GetEntry());
+
+  if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
+
+  return GetOperations()->MaxSurfaceCurvatureByPoint(aShape,aPoint);
+}
+
+
+//=============================================================================
+/*!
+ *  MinSurfaceCurvatureByParam
+ */
+//=============================================================================
+CORBA::Double GEOM_IMeasureOperations_i::MinSurfaceCurvatureByParam
+                                                (GEOM::GEOM_Object_ptr theSurf,
+                                                CORBA::Double theUParam,
+                                                CORBA::Double theVParam)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if(theSurf==NULL) return -1.0;
+
+  //Get the reference shape
+  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+    (theSurf->GetStudyID(), theSurf->GetEntry());
+
+  if(aShape.IsNull()) return -1.0;
+
+  return GetOperations()->MinSurfaceCurvatureByParam(aShape,theUParam,theVParam);
+}
+
+
+//=============================================================================
+/*!
+ *  MinSurfaceCurvatureByPoint
+ */
+//=============================================================================
+CORBA::Double GEOM_IMeasureOperations_i::MinSurfaceCurvatureByPoint
+                (GEOM::GEOM_Object_ptr theSurf, GEOM::GEOM_Object_ptr thePoint)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if( theSurf==NULL || thePoint==NULL ) return -1.0;
+
+  //Get the reference shape
+  Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+    (theSurf->GetStudyID(), theSurf->GetEntry());
+  Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
+    (thePoint->GetStudyID(), thePoint->GetEntry());
+
+  if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
+
+  return GetOperations()->MinSurfaceCurvatureByPoint(aShape,aPoint);
+}