#include <TDF_Tool.hxx>
#include "GEOM_Function.hxx"
+#include "GEOM_PythonDump.hxx"
#include "GEOMImpl_TranslateDriver.hxx"
#include "GEOMImpl_MirrorDriver.hxx"
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.TranslateTwoPoints(");
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(thePoint1->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(thePoint2->GetEntry(), anEntry);
- aDescr += (anEntry+")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateTwoPoints("
+ << theObject << ", " << thePoint1 << ", " << thePoint2 << ")";
SetErrorCode(OK);
return theObject;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.TranslateDXDXYDZ(");
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theX)+", ");
- aDescr += (TCollection_AsciiString(theY)+", ");
- aDescr += (TCollection_AsciiString(theZ)+")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateDXDYDZ("
+ << theObject << ", " << theX << ", " << theY << ", " << theZ << ")";
SetErrorCode(OK);
return theObject;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.TranslateTwoPointsCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(thePoint1->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(thePoint2->GetEntry(), anEntry);
- aDescr += (anEntry+")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeTranslationTwoPoints("
+ << theObject << ", " << thePoint1 << ", " << thePoint2 << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.TranslateDXDXYDZCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theX)+", ");
- aDescr += (TCollection_AsciiString(theY)+", ");
- aDescr += (TCollection_AsciiString(theZ)+")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeTranslation("
+ << theObject << ", " << theX << ", " << theY << ", " << theZ << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.TranslateVector(");
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theVector->GetEntry(), anEntry);
- aDescr += (anEntry+") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateVector("
+ << theObject << ", " << theVector << ")";
SetErrorCode(OK);
return theObject;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.TranslateVectorCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theVector->GetEntry(), anEntry);
- aDescr += (anEntry+")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeTranslationVector("
+ << theObject << ", " << theVector << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.Translate1D(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theVector->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theStep)+", ");
- aDescr += (TCollection_AsciiString(theNbTimes)+") ");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeMultiTranslation1D("
+ << theObject << ", " << theVector << ", " << theStep << ", " << theNbTimes << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.Translate2D(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theVector->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theStep1)+", ");
- aDescr += (TCollection_AsciiString(theNbTimes2)+", ");
- TDF_Tool::Entry(theVector2->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theStep2)+", ");
- aDescr += (TCollection_AsciiString(theNbTimes2)+") ");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeMultiTranslation2D("
+ << theObject << ", " << theVector << ", " << theStep1 << ", " << theNbTimes1
+ << ", " << theVector2 << ", " << theStep2 << ", " << theNbTimes2 << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry + " = ITransformOperations.MirrorPlane(");
- aDescr += (anEntry + ", ");
- TDF_Tool::Entry(thePlane->GetEntry(), anEntry);
- aDescr += (anEntry + ") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.MirrorPlane("
+ << theObject << ", " << thePlane << ")";
SetErrorCode(OK);
return theObject;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry + " = ITransformOperations.MirrorPlaneCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry + ", ");
- TDF_Tool::Entry(thePlane->GetEntry(), anEntry);
- aDescr += (anEntry + ")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeMirrorByPlane("
+ << theObject << ", " << thePlane << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry + " = ITransformOperations.MirrorPoint(");
- aDescr += (anEntry + ", ");
- TDF_Tool::Entry(thePoint->GetEntry(), anEntry);
- aDescr += (anEntry + ") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.MirrorPoint("
+ << theObject << ", " << thePoint << ")";
SetErrorCode(OK);
return NULL;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry + " = ITransformOperations.MirrorPointCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry + ", ");
- TDF_Tool::Entry(thePoint->GetEntry(), anEntry);
- aDescr += (anEntry + ")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeMirrorByPoint("
+ << theObject << ", " << thePoint << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry + " = ITransformOperations.MirrorAxis(");
- aDescr += (anEntry + ", ");
- TDF_Tool::Entry(theAxis->GetEntry(), anEntry);
- aDescr += (anEntry + ") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.MirrorAxis("
+ << theObject << ", " << theAxis << ")";
SetErrorCode(OK);
return NULL;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry + " = ITransformOperations.MirrorAxisCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry + ", ");
- TDF_Tool::Entry(theAxis->GetEntry(), anEntry);
- aDescr += (anEntry + ")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeMirrorByAxis("
+ << theObject << ", " << theAxis << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.OffsetShape(");
- aDescr += (anEntry+", ");
- aDescr += TCollection_AsciiString(theOffset)+")";
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.OffsetShape("
+ << theObject << ", " << theOffset << ")";
SetErrorCode(OK);
return theObject;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.OffsetShapeCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += TCollection_AsciiString(theOffset)+")";
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeOffset("
+ << theObject << ", " << theOffset << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.ScaleShape(");
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(thePoint->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += TCollection_AsciiString(theFactor)+")";
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.ScaleShape("
+ << theObject << ", " << thePoint << ", " << theFactor << ")";
SetErrorCode(OK);
return theObject;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.ScaleShapeCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(thePoint->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += TCollection_AsciiString(theFactor)+")";
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeScaleTransform("
+ << theObject << ", " << thePoint << ", " << theFactor << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.PositionShape(");
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theStartLCS->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theEndLCS->GetEntry(), anEntry);
- aDescr += (anEntry+") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.PositionShape("
+ << theObject << ", " << theStartLCS << ", " << theEndLCS << ")";
SetErrorCode(OK);
return theObject;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.PositionShapeCopy(");
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theStartLCS->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theEndLCS->GetEntry(), anEntry);
- aDescr += (anEntry+")");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakePosition("
+ << theObject << ", " << theStartLCS << ", " << theEndLCS << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.Rotate(");
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theAxis->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theAngle)+") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.Rotate(" << theObject
+ << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
SetErrorCode(OK);
return theObject;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.RotateCopy(");
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theAxis->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theAngle)+") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeRotation(" << theObject
+ << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.Rotate1D(");
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theAxis->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theNbTimes)+") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MultiRotate1D("
+ << theObject << ", " << theAxis << ", " << theNbTimes << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- aDescr += (anEntry+" = ITransformOperations.Rotate2D(");
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theAxis->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theAngle)+", ");
- aDescr += (TCollection_AsciiString(theNbTimes1)+", ");
- aDescr += (TCollection_AsciiString(theStep)+", ");
- aDescr += (TCollection_AsciiString(theNbTimes2)+") ");
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MultiRotate2D("
+ << theObject << ", " << theAxis << ", " << theAngle << ", "
+ << theNbTimes1 << ", " << theStep << ", " << theNbTimes2 << ")";
SetErrorCode(OK);
return aCopy;