X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMImpl%2FGEOMImpl_ICurvesOperations.cxx;h=8046dbb63971888038ab1da963b77276a6462a8b;hb=73747ffeb558151f48c52ef25e58900b4e31278c;hp=9934610e31e3e0b62d99c3fba8c0475802cf53cd;hpb=e86fadf71e93459ac3a22267487e8c4b4e4799ee;p=modules%2Fgeom.git diff --git a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx index 9934610e3..8046dbb63 100644 --- a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx @@ -1,4 +1,4 @@ -// 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 @@ -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 @@ -20,7 +20,7 @@ // 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, ... @@ -46,6 +46,7 @@ #include "GEOMImpl_SplineDriver.hxx" #include "GEOMImpl_EllipseDriver.hxx" #include "GEOMImpl_ArcDriver.hxx" +#include "GEOMImpl_ShapeDriver.hxx" #include "GEOMImpl_SketcherDriver.hxx" #include "GEOMImpl_3DSketcherDriver.hxx" @@ -57,6 +58,7 @@ #include "GEOMImpl_ISketcher.hxx" #include "GEOMImpl_I3DSketcher.hxx" #include "GEOMImpl_ICurveParametric.hxx" +#include "GEOMImpl_IIsoline.hxx" #include @@ -1429,3 +1431,71 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::Make3DSketcher (std::listAddObject(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; +}