1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <Standard_Stream.hxx>
22 #include <GEOMImpl_IBasicOperations.hxx>
24 #include "utilities.h"
26 #include <Utils_ExceptHandlers.hxx>
28 #include <TFunction_DriverTable.hxx>
29 #include <TFunction_Driver.hxx>
30 #include <TFunction_Logbook.hxx>
31 #include <TDF_Tool.hxx>
33 #include <GEOM_Function.hxx>
34 #include <GEOM_PythonDump.hxx>
36 #include <GEOMImpl_PointDriver.hxx>
37 #include <GEOMImpl_VectorDriver.hxx>
38 #include <GEOMImpl_LineDriver.hxx>
39 #include <GEOMImpl_PlaneDriver.hxx>
40 #include <GEOMImpl_MarkerDriver.hxx>
42 #include <GEOMImpl_IPoint.hxx>
43 #include <GEOMImpl_IVector.hxx>
44 #include <GEOMImpl_ILine.hxx>
45 #include <GEOMImpl_IPlane.hxx>
46 #include <GEOMImpl_IMarker.hxx>
48 #include <GEOMImpl_Types.hxx>
50 #include <Standard_Failure.hxx>
51 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
53 //=============================================================================
57 //=============================================================================
58 GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID)
59 : GEOM_IOperations(theEngine, theDocID)
61 MESSAGE("GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations");
64 //=============================================================================
68 //=============================================================================
69 GEOMImpl_IBasicOperations::~GEOMImpl_IBasicOperations()
71 MESSAGE("GEOMImpl_IBasicOperations::~GEOMImpl_IBasicOperations");
75 //=============================================================================
79 //=============================================================================
80 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointXYZ
81 (double theX, double theY, double theZ)
85 //Add a new Point object
86 Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
88 //Add a new Point function with XYZ parameters
89 Handle(GEOM_Function) aFunction =
90 aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_XYZ);
91 if (aFunction.IsNull()) return NULL;
93 //Check if the function is set correctly
94 if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
96 GEOMImpl_IPoint aPI(aFunction);
102 //Compute the point value
104 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
107 if (!GetSolver()->ComputeFunction(aFunction)) {
108 SetErrorCode("Point driver failed");
112 catch (Standard_Failure) {
113 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
114 SetErrorCode(aFail->GetMessageString());
118 //Make a Python command
119 GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertex("
120 << theX << ", " << theY << ", " << theZ << ")";
126 //=============================================================================
128 * MakePointWithReference
130 //=============================================================================
131 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference
132 (Handle(GEOM_Object) theReference, double theX, double theY, double theZ)
136 if (theReference.IsNull()) return NULL;
138 //Add a new Point object
139 Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
141 //Add a new Point function for creation a point relativley another point
142 Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_XYZ_REF);
144 //Check if the function is set correctly
145 if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
147 GEOMImpl_IPoint aPI(aFunction);
149 Handle(GEOM_Function) aRefFunction = theReference->GetLastFunction();
150 if (aRefFunction.IsNull()) return NULL;
152 aPI.SetRef(aRefFunction);
157 //Compute the point value
159 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
162 if (!GetSolver()->ComputeFunction(aFunction)) {
163 SetErrorCode("Point driver failed");
167 catch (Standard_Failure) {
168 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
169 SetErrorCode(aFail->GetMessageString());
173 //Make a Python command
174 GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexWithRef("
175 << theReference << ", " << theX << ", " << theY << ", " << theZ << ")";
181 //=============================================================================
185 //=============================================================================
186 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
187 (Handle(GEOM_Object) theCurve, double theParameter)
191 if (theCurve.IsNull()) return NULL;
193 //Add a new Point object
194 Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
196 //Add a new Point function for creation a point relativley another point
197 Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_CURVE_PAR);
199 //Check if the function is set correctly
200 if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
202 GEOMImpl_IPoint aPI (aFunction);
204 Handle(GEOM_Function) aRefFunction = theCurve->GetLastFunction();
205 if (aRefFunction.IsNull()) return NULL;
207 aPI.SetCurve(aRefFunction);
208 aPI.SetParameter(theParameter);
210 //Compute the point value
212 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
215 if (!GetSolver()->ComputeFunction(aFunction)) {
216 SetErrorCode("Point driver failed");
220 catch (Standard_Failure) {
221 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
222 SetErrorCode(aFail->GetMessageString());
226 //Make a Python command
227 GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurve("
228 << theCurve << ", " << theParameter << ")";
234 //=============================================================================
238 //=============================================================================
239 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentOnCurve
240 (const Handle(GEOM_Object)& theCurve, double theParameter)
244 if (theCurve.IsNull()) return NULL;
246 //Add a new Vector object
247 Handle(GEOM_Object) aVec = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
249 //Add a new Point function for creation a point relativley another point
250 Handle(GEOM_Function) aFunction = aVec->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TANGENT_CURVE_PAR);
252 //Check if the function is set correctly
253 if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL;
255 GEOMImpl_IVector aVI (aFunction);
257 Handle(GEOM_Function) aRefFunction = theCurve->GetLastFunction();
258 if (aRefFunction.IsNull()) return NULL;
260 aVI.SetCurve(aRefFunction);
261 aVI.SetParameter(theParameter);
263 //Compute the vector value
265 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
268 if (!GetSolver()->ComputeFunction(aFunction)) {
269 SetErrorCode("Vector driver failed");
273 catch (Standard_Failure) {
274 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
275 SetErrorCode(aFail->GetMessageString());
279 //Make a Python command
280 GEOM::TPythonDump(aFunction) << aVec << " = geompy.MakeTangentOnCurve("
281 << theCurve << ", " << theParameter << ")";
287 //=============================================================================
291 //=============================================================================
292 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorDXDYDZ
293 (double theDX, double theDY, double theDZ)
297 //Add a new Vector object
298 Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
300 //Add a new Vector function with DXDYDZ parameters
301 Handle(GEOM_Function) aFunction =
302 aVector->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_DX_DY_DZ);
303 if (aFunction.IsNull()) return NULL;
305 //Check if the function is set correctly
306 if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL;
308 GEOMImpl_IVector aPI (aFunction);
314 //Compute the Vector value
316 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
319 if (!GetSolver()->ComputeFunction(aFunction)) {
320 SetErrorCode("Vector driver failed");
324 catch (Standard_Failure) {
325 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
326 SetErrorCode(aFail->GetMessageString());
330 //Make a Python command
331 GEOM::TPythonDump(aFunction) << aVector << " = geompy.MakeVectorDXDYDZ("
332 << theDX << ", " << theDY << ", " << theDZ << ")";
338 //=============================================================================
342 //=============================================================================
343 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorTwoPnt
344 (Handle(GEOM_Object) thePnt1, Handle(GEOM_Object) thePnt2)
348 if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
350 //Add a new Vector object
351 Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
353 //Add a new Vector function
354 Handle(GEOM_Function) aFunction =
355 aVector->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TWO_PNT);
357 //Check if the function is set correctly
358 if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL;
360 GEOMImpl_IVector aPI (aFunction);
362 Handle(GEOM_Function) aRef1 = thePnt1->GetLastFunction();
363 Handle(GEOM_Function) aRef2 = thePnt2->GetLastFunction();
364 if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
366 aPI.SetPoint1(aRef1);
367 aPI.SetPoint2(aRef2);
369 //Compute the Vector value
371 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
374 if (!GetSolver()->ComputeFunction(aFunction)) {
375 SetErrorCode("Vector driver failed");
379 catch (Standard_Failure) {
380 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
381 SetErrorCode(aFail->GetMessageString());
385 //Make a Python command
386 GEOM::TPythonDump(aFunction) << aVector << " = geompy.MakeVector("
387 << thePnt1 << ", " << thePnt2 << ")";
394 //=============================================================================
398 //=============================================================================
399 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLine
400 (Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theDir)
404 if (thePnt.IsNull() || theDir.IsNull()) return NULL;
406 //Add a new Line object
407 Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
409 //Add a new Line function
410 Handle(GEOM_Function) aFunction =
411 aLine->AddFunction(GEOMImpl_LineDriver::GetID(), LINE_PNT_DIR);
413 //Check if the function is set correctly
414 if (aFunction->GetDriverGUID() != GEOMImpl_LineDriver::GetID()) return NULL;
416 GEOMImpl_ILine aPI (aFunction);
418 Handle(GEOM_Function) aRef1 = thePnt->GetLastFunction();
419 Handle(GEOM_Function) aRef2 = theDir->GetLastFunction();
420 if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
422 aPI.SetPoint1(aRef1);
423 aPI.SetPoint2(aRef2);
425 //Compute the Line value
427 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
430 if (!GetSolver()->ComputeFunction(aFunction)) {
431 SetErrorCode("Line driver failed");
435 catch (Standard_Failure) {
436 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
437 SetErrorCode(aFail->GetMessageString());
441 //Make a Python command
442 GEOM::TPythonDump(aFunction) << aLine << " = geompy.MakeLine("
443 << thePnt << ", " << theDir << ")";
449 //=============================================================================
453 //=============================================================================
454 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoPnt
455 (Handle(GEOM_Object) thePnt1, Handle(GEOM_Object) thePnt2)
459 if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
461 //Add a new Line object
462 Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
464 //Add a new Line function
465 Handle(GEOM_Function) aFunction =
466 aLine->AddFunction(GEOMImpl_LineDriver::GetID(), LINE_TWO_PNT);
468 //Check if the function is set correctly
469 if (aFunction->GetDriverGUID() != GEOMImpl_LineDriver::GetID()) return NULL;
471 GEOMImpl_ILine aPI (aFunction);
473 Handle(GEOM_Function) aRef1 = thePnt1->GetLastFunction();
474 Handle(GEOM_Function) aRef2 = thePnt2->GetLastFunction();
475 if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
477 aPI.SetPoint1(aRef1);
478 aPI.SetPoint2(aRef2);
480 //Compute the Line value
482 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
485 if (!GetSolver()->ComputeFunction(aFunction)) {
486 SetErrorCode("Line driver failed");
490 catch (Standard_Failure) {
491 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
492 SetErrorCode(aFail->GetMessageString());
496 //Make a Python command
497 GEOM::TPythonDump(aFunction) << aLine << " = geompy.MakeLineTwoPnt("
498 << thePnt1 << ", " << thePnt2 << ")";
505 //=============================================================================
509 //=============================================================================
510 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneThreePnt
511 (Handle(GEOM_Object) thePnt1, Handle(GEOM_Object) thePnt2,
512 Handle(GEOM_Object) thePnt3, double theSize)
516 if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
518 //Add a new Plane object
519 Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
521 //Add a new Plane function
522 Handle(GEOM_Function) aFunction =
523 aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_THREE_PNT);
525 //Check if the function is set correctly
526 if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
528 GEOMImpl_IPlane aPI (aFunction);
530 Handle(GEOM_Function) aRef1 = thePnt1->GetLastFunction();
531 Handle(GEOM_Function) aRef2 = thePnt2->GetLastFunction();
532 Handle(GEOM_Function) aRef3 = thePnt3->GetLastFunction();
533 if (aRef1.IsNull() || aRef2.IsNull() || aRef3.IsNull()) return NULL;
535 aPI.SetPoint1(aRef1);
536 aPI.SetPoint2(aRef2);
537 aPI.SetPoint3(aRef3);
538 aPI.SetSize(theSize);
540 //Compute the Plane value
542 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
545 if (!GetSolver()->ComputeFunction(aFunction)) {
546 SetErrorCode("Plane driver failed");
550 catch (Standard_Failure) {
551 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
552 SetErrorCode(aFail->GetMessageString());
556 //Make a Python command
557 GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakePlaneThreePnt("
558 << thePnt1 << ", " << thePnt2 << ", " << thePnt3 << ", " << theSize << ")";
564 //=============================================================================
568 //=============================================================================
569 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlanePntVec
570 (Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theVec,
575 if (thePnt.IsNull() || theVec.IsNull()) return NULL;
577 //Add a new Plane object
578 Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
580 //Add a new Plane function
581 Handle(GEOM_Function) aFunction =
582 aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_PNT_VEC);
584 //Check if the function is set correctly
585 if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
587 GEOMImpl_IPlane aPI (aFunction);
589 Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
590 Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
591 if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
593 aPI.SetPoint(aRefPnt);
594 aPI.SetVector(aRefVec);
595 aPI.SetSize(theSize);
597 //Compute the Plane value
599 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
602 if (!GetSolver()->ComputeFunction(aFunction)) {
603 SetErrorCode("Plane driver failed");
607 catch (Standard_Failure) {
608 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
609 SetErrorCode(aFail->GetMessageString());
613 //Make a Python command
614 GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakePlane("
615 << thePnt << ", " << theVec << ", " << theSize << ")";
621 //=============================================================================
625 //=============================================================================
626 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneFace
627 (Handle(GEOM_Object) theFace, double theSize)
631 if (theFace.IsNull()) return NULL;
633 //Add a new Plane object
634 Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
636 //Add a new Plane function
637 Handle(GEOM_Function) aFunction =
638 aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_FACE);
640 //Check if the function is set correctly
641 if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
643 GEOMImpl_IPlane aPI (aFunction);
645 Handle(GEOM_Function) aRef = theFace->GetLastFunction();
646 if (aRef.IsNull()) return NULL;
649 aPI.SetSize(theSize);
651 //Compute the Plane value
653 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
656 if (!GetSolver()->ComputeFunction(aFunction)) {
657 SetErrorCode("Plane driver failed");
661 catch (Standard_Failure) {
662 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
663 SetErrorCode(aFail->GetMessageString());
667 //Make a Python command
668 GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakePlaneFace("
669 << theFace << ", " << theSize << ")";
676 //=============================================================================
680 //=============================================================================
681 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker
682 (double theOX, double theOY, double theOZ,
683 double theXDX, double theXDY, double theXDZ,
684 double theYDX, double theYDY, double theYDZ)
688 //Add a new Marker object
689 Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
691 //Add a new Marker function
692 Handle(GEOM_Function) aFunction =
693 aMarker->AddFunction(GEOMImpl_MarkerDriver::GetID(), MARKER_CS);
694 if (aFunction.IsNull()) return NULL;
696 //Check if the function is set correctly
697 if (aFunction->GetDriverGUID() != GEOMImpl_MarkerDriver::GetID()) return NULL;
699 GEOMImpl_IMarker aPI(aFunction);
701 aPI.SetOrigin(theOX, theOY, theOZ);
702 aPI.SetXDir(theXDX, theXDY, theXDZ);
703 aPI.SetYDir(theYDX, theYDY, theYDZ);
705 //Compute the marker value
707 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
710 if (!GetSolver()->ComputeFunction(aFunction)) {
711 SetErrorCode("Marker driver failed");
715 catch (Standard_Failure) {
716 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
717 SetErrorCode(aFail->GetMessageString());
721 //Make a Python command
722 GEOM::TPythonDump(aFunction) << aMarker << " = geompy.MakeMarker("
723 << theOX << ", " << theOY << ", " << theOZ << ", "
724 << theXDX << ", " << theXDY << ", " << theXDZ << ", "
725 << theYDX << ", " << theYDY << ", " << theYDZ << ")";
731 //=============================================================================
733 * MakeTangentPlaneOnFace
735 //=============================================================================
737 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Handle(GEOM_Object)& theFace,
744 if (theFace.IsNull()) return NULL;
746 //Add a new Plane object
747 Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
749 //Add a new Plane function
750 Handle(GEOM_Function) aFunction =
751 aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_TANGENT_FACE);
753 //Check if the function is set correctly
754 if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
756 GEOMImpl_IPlane aPI (aFunction);
758 Handle(GEOM_Function) aRef = theFace->GetLastFunction();
759 if (aRef.IsNull()) return NULL;
762 aPI.SetSize(theSize);
763 aPI.SetParameterU(theParamU);
764 aPI.SetParameterV(theParamV);
766 //Compute the Plane value
768 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
771 if (!GetSolver()->ComputeFunction(aFunction)) {
772 SetErrorCode("Plane driver failed");
776 catch (Standard_Failure) {
777 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
778 SetErrorCode(aFail->GetMessageString());
782 //Make a Python command
783 GEOM::TPythonDump(aFunction) << aPlane << " = geompy.MakeTangentPlaneOnFace("
784 << theFace << ", " <<theParamU <<", "<<theParamV <<", "<< theSize << ")";