#include <TDF_Tool.hxx>
#include "GEOM_Function.hxx"
+#include "GEOM_PythonDump.hxx"
+
#include "GEOMImpl_Types.hxx"
#include "GEOMImpl_BoxDriver.hxx"
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aBox->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeBoxDXDYDZ(";
- aDescr += (TCollection_AsciiString(theDX)+", ");
- aDescr += (TCollection_AsciiString(theDY)+", ");
- aDescr += (TCollection_AsciiString(theDZ)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aBox << " = geompy.MakeBoxDXDYDZ("
+ << theDX << ", " << theDY << ", " << theDZ << ")";
SetErrorCode(OK);
return aBox;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aBox->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeBoxTwoPnt(";
- TDF_Tool::Entry(thePnt1->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(thePnt2->GetEntry(), anEntry);
- aDescr += (anEntry+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aBox << " = geompy.MakeBoxTwoPnt("
+ << thePnt1 << ", " << thePnt2 << ")";
SetErrorCode(OK);
return aBox;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aCylinder->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeCylinderRH(";
- aDescr += (TCollection_AsciiString(theR)+", ");
- aDescr += (TCollection_AsciiString(theH)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCylinder
+ << " = geompy.MakeCylinderRH(" << theR << ", " << theH << ")";
SetErrorCode(OK);
return aCylinder;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aCylinder->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeCylinderPntVecRH(";
- TDF_Tool::Entry(thePnt->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theVec->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theR)+", ");
- aDescr += (TCollection_AsciiString(theH)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCylinder << " = geompy.MakeCylinder("
+ << thePnt << ", " << theVec << ", " << theR << ", " << theH << ")";
SetErrorCode(OK);
return aCylinder;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aCone->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeConeR1R2H(";
- aDescr += (TCollection_AsciiString(theR1)+", ");
- aDescr += (TCollection_AsciiString(theR2)+", ");
- aDescr += (TCollection_AsciiString(theH)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCone << " = geompy.MakeConeR1R2H("
+ << theR1 << ", " << theR2 << ", " << theH << ")";
SetErrorCode(OK);
return aCone;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aCone->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeConePntVecR1R2H(";
- TDF_Tool::Entry(thePnt->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theVec->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theR1)+", ");
- aDescr += (TCollection_AsciiString(theR2)+", ");
- aDescr += (TCollection_AsciiString(theH)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCone << " = geompy.MakeCone(" << thePnt
+ << ", " << theVec << ", " << theR1 << ", " << theR2 << ", " << theH << ")";
SetErrorCode(OK);
return aCone;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aSphere->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeSphereR(";
- aDescr += (TCollection_AsciiString(theR)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aSphere << " = geompy.MakeSphereR(" << theR << ")";
SetErrorCode(OK);
return aSphere;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aSphere->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeSpherePntR(";
- TDF_Tool::Entry(thePnt->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theR)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aSphere
+ << " = geompy.MakeSpherePntR(" << thePnt << ", " << theR << ")";
SetErrorCode(OK);
return aSphere;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(anEll->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = ICurvesOperations.MakeTorusRR(";
- aDescr += (TCollection_AsciiString(theRMajor)+", ");
- aDescr += (TCollection_AsciiString(theRMinor)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeTorusRR("
+ << theRMajor << ", " << theRMinor << ")";
SetErrorCode(OK);
return anEll;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(anEll->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = ICurvesOperations.MakeTorusPntVecRR(";
- TDF_Tool::Entry(thePnt->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theVec->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theRMajor)+", ");
- aDescr += (TCollection_AsciiString(theRMinor)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeTorus(" << thePnt
+ << ", " << theVec << ", " << theRMajor << ", " << theRMinor << ")";
SetErrorCode(OK);
return anEll;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aPrism->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakePrismVecH(";
- TDF_Tool::Entry(theBase->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theVec->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theH)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismVecH("
+ << theBase << ", " << theVec << ", " << theH << ")";
SetErrorCode(OK);
return aPrism;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aPrism->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakePrismVecH(";
- TDF_Tool::Entry(theBase->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) << aPrism << " = geompy.MakePrism("
+ << theBase << ", " << thePoint1 << ", " << thePoint2 << ")";
SetErrorCode(OK);
return aPrism;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aPipe->GetEntry(), anEntry);
- aDescr += (anEntry + " = I3DPrimOperations.MakePipe(");
- TDF_Tool::Entry(theBase->GetEntry(), anEntry);
- aDescr += (anEntry + ", ");
- TDF_Tool::Entry(thePath->GetEntry(), anEntry);
- aDescr += (anEntry + ")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aPipe << " = geompy.MakePipe("
+ << theBase << ", " << thePath << ")";
SetErrorCode(OK);
return aPipe;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aRevolution->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeRevolutionAxisAngle(";
- TDF_Tool::Entry(theBase->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- TDF_Tool::Entry(theAxis->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theAngle)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution("
+ << theBase << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
SetErrorCode(OK);
return aRevolution;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aSolid->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = I3DPrimOperations.MakeSolidShell(";
- TDF_Tool::Entry(theShell->GetEntry(), anEntry);
- aDescr += (anEntry+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aSolid << " = geompy.MakeSolid(" << theShell << ")";
SetErrorCode(OK);
return aSolid;
* MakeFilling
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg, double theTol2D, double theTol3D, int theNbIter)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
+ (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg,
+ double theTol2D, double theTol3D, int theNbIter)
{
SetErrorCode(KO);
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr("");
- TDF_Tool::Entry(aFilling->GetEntry(), anEntry);
- aDescr += anEntry;
- aDescr += " = ICurvesOperations.MakeFilling(";
- TDF_Tool::Entry(theShape->GetEntry(), anEntry);
- aDescr += (anEntry+", ");
- aDescr += (TCollection_AsciiString(theMinDeg)+", ");
- aDescr += (TCollection_AsciiString(theMaxDeg)+", ");
- aDescr += (TCollection_AsciiString(theTol2D)+", ");
- aDescr += (TCollection_AsciiString(theTol3D)+", ");
- aDescr += (TCollection_AsciiString(theNbIter)+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aFilling << " = geompy.MakeFilling("
+ << theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
+ << theTol2D << ", " << theTol3D << ", " << theNbIter << ")";
SetErrorCode(OK);
return aFilling;