-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 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
#include <GEOM_PythonDump.hxx>
#include "utilities.h"
-#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
#include <TFunction_DriverTable.hxx>
*/
//=============================================================================
-GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations");
}
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
//Add a translate function
if (theCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_TranslateDriver::GetID(), TRANSLATE_VECTOR_DISTANCE);
}
else {
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << "geompy.Offset("
- << theObject << ", " << theOffset << ")";
+ if (theJoinByPipes)
+ GEOM::TPythonDump(aFunction) << "geompy.Offset("
+ << theObject << ", " << theOffset << ")";
+ else
+ GEOM::TPythonDump(aFunction) << theObject << " = geompy.MakeOffsetIntersectionJoin("
+ << theObject << ", " << theOffset << ")";
SetErrorCode(OK);
return theObject;
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a new Offset function
Handle(GEOM_Function) aFunction =
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeOffset("
- << theObject << ", " << theOffset << ")";
+ if (theJoinByPipes)
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeOffset("
+ << theObject << ", " << theOffset << ")";
+ else
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeOffsetIntersectionJoin("
+ << theObject << ", " << theOffset << ")";
SetErrorCode(OK);
return aCopy;
else
{
//Add a new Projection object
- aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ aCopy = GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction =
}
//Add a new Projection object
- thePointOnEdge = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ thePointOnEdge = GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction = thePointOnEdge->AddFunction
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be scaled
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a scale function
Handle(GEOM_Function) aFunction =
Handle(GEOM_Object) aCopy; //Add a new Copy object
Handle(GEOM_Function) aFunction;
if (doCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_ScaleDriver::GetID(), SCALE_SHAPE_AXES_COPY);
}
else {
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a position function
Standard_Integer aType = POSITION_SHAPE_COPY;
Handle(GEOM_Object) aCopy;
if (theCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_PositionDriver::GetID(), POSITION_ALONG_PATH);
}
else
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_COPY);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D_STEP);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_THREE_POINTS_COPY);
if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object
// Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
// Add a transform function (depends on theSample function)
Handle(GEOM_Function) aFunction =
//Add a new Projection object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction = aResult->AddFunction