-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#ifdef WNT
+#ifdef WIN32
// E.A. : On windows with python 2.6, there is a conflict
// E.A. : between pymath.h and Standard_math.h which define
// E.A. : some same symbols : acosh, asinh, ...
#include "GEOMImpl_SplineDriver.hxx"
#include "GEOMImpl_EllipseDriver.hxx"
#include "GEOMImpl_ArcDriver.hxx"
+#include "GEOMImpl_ShapeDriver.hxx"
#include "GEOMImpl_SketcherDriver.hxx"
#include "GEOMImpl_3DSketcherDriver.hxx"
#include "GEOMImpl_ISketcher.hxx"
#include "GEOMImpl_I3DSketcher.hxx"
#include "GEOMImpl_ICurveParametric.hxx"
+#include "GEOMImpl_IIsoline.hxx"
#include <Basics_OCCTVersion.hxx>
SetErrorCode(OK);
return a3DSketcher;
}
+
+//=============================================================================
+/*!
+ * MakeIsoline
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeIsoline
+ (const Handle(GEOM_Object) &theFace,
+ const bool IsUIso,
+ const double theParameter)
+{
+ SetErrorCode(KO);
+
+ if (theFace.IsNull()) {
+ return NULL;
+ }
+
+ //Add a new Spline object
+ Handle(GEOM_Object) anIsoline =
+ GetEngine()->AddObject(GetDocID(), GEOM_ISOLINE);
+
+ //Add a new Spline function for interpolation type
+ Handle(GEOM_Function) aFunction =
+ anIsoline->AddFunction(GEOMImpl_ShapeDriver::GetID(), SHAPE_ISOLINE);
+
+ if (aFunction.IsNull()) {
+ return NULL;
+ }
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) {
+ return NULL;
+ }
+
+ GEOMImpl_IIsoline aCI (aFunction);
+ Handle(GEOM_Function) aRefFace = theFace->GetLastFunction();
+
+ if (aRefFace.IsNull()) {
+ return NULL;
+ }
+
+ aCI.SetFace(aRefFace);
+ aCI.SetIsUIso(IsUIso);
+ aCI.SetParameter(theParameter);
+
+ //Compute the isoline curve
+ try {
+#if OCC_VERSION_LARGE > 0x06010000
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Shape driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump (aFunction) << anIsoline << " = geompy.MakeIsoline( "
+ << theFace << ", " << IsUIso << ", " << theParameter << " )";
+
+ SetErrorCode(OK);
+ return anIsoline;
+}