// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
#include <Standard_Stream.hxx>
#include <GEOMImpl_IPipeShellSect.hxx>
#include <GEOMImpl_IPipeBiNormal.hxx>
+#include <Precision.hxx>
+
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec,
- double theH)
+ double theH, double theScaleFactor)
{
SetErrorCode(KO);
aCI.SetBase(aRefBase);
aCI.SetVector(aRefVec);
aCI.SetH(theH);
+ aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismVecH("
- << theBase << ", " << theVec << ", " << theH << ")";
+ GEOM::TPythonDump pd (aFunction);
+ pd << aPrism << " = geompy.MakePrismVecH(" << theBase << ", " << theVec << ", " << theH;
+ if (theScaleFactor > Precision::Confusion())
+ pd << ", " << theScaleFactor << ")";
+ else
+ pd << ")";
SetErrorCode(OK);
return aPrism;
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
(Handle(GEOM_Object) theBase,
- Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2)
+ Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2,
+ double theScaleFactor)
{
SetErrorCode(KO);
aCI.SetBase(aRefBase);
aCI.SetFirstPoint(aRefPnt1);
aCI.SetLastPoint(aRefPnt2);
+ aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrism("
- << theBase << ", " << thePoint1 << ", " << thePoint2 << ")";
+ GEOM::TPythonDump pd (aFunction);
+ pd << aPrism << " = geompy.MakePrism(" << theBase << ", " << thePoint1 << ", " << thePoint2;
+ if (theScaleFactor > Precision::Confusion())
+ pd << ", " << theScaleFactor << ")";
+ else
+ pd << ")";
SetErrorCode(OK);
return aPrism;
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
- (Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ)
+ (Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ,
+ double theScaleFactor)
{
SetErrorCode(KO);
aCI.SetDX(theDX);
aCI.SetDY(theDY);
aCI.SetDZ(theDZ);
+ aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismDXDYDZ("
- << theBase << ", " << theDX << ", " << theDY << ", " << theDZ << ")";
+ GEOM::TPythonDump pd (aFunction);
+ pd << aPrism << " = geompy.MakePrismDXDYDZ("
+ << theBase << ", " << theDX << ", " << theDY << ", " << theDZ;
+ if (theScaleFactor > Precision::Confusion())
+ pd << ", " << theScaleFactor << ")";
+ else
+ pd << ")";
SetErrorCode(OK);
return aPrism;
pd << aFilling << " = geompy.MakeFilling("
<< theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
<< theTol2D << ", " << theTol3D << ", " << theNbIter << ", ";
- if( theMethod==1 ) pd << "GEOM.FOM_UseOri";
+ if( theMethod==1 ) pd << "GEOM.FOM_UseOri";
else if( theMethod==2 ) pd << "GEOM.FOM_AutoCorrect";
else pd << "GEOM.FOM_Default";
if(isApprox)
return anObj;
Standard_Integer nbObj = theSeqSections->Length();
- if (!nbObj)
+ if (!nbObj)
return anObj;
//Add a new ThruSections object
Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GetDocID(), GEOM_THRUSECTIONS);
-
+
//Add a new ThruSections function
int aTypeFunc = (theRuled ? THRUSECTIONS_RULED : THRUSECTIONS_SMOOTHED);
Handle(Standard_Transient) anItem = theSeqSections->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
if(!aSectObj.IsNull())
{
Handle(Standard_Transient) anItem = theSeqSections->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
if(!aSectObj.IsNull()) {
pyDump<< aSectObj;
pyDump<<", ";
}
}
-
+
pyDump<< "],"<<theModeSolid << "," << thePreci <<","<< theRuled <<")";
SetErrorCode(OK);
return aThruSect;
-
-
}
return anObj;
Standard_Integer nbBases = theBases->Length();
-
+
if (!nbBases)
return anObj;
-
+
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
-
+
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
if(aBase.IsNull())
continue;
Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
if(anItemLoc.IsNull())
continue;
-
+
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
continue;
aCI.SetPath(aRefPath);
aCI.SetWithContactMode(theWithContact);
aCI.SetWithCorrectionMode(theWithCorrections);
-
+
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
pyDump<<", ";
}
-
}
-
+
pyDump<< "], [";
-
+
for(i =1 ; i <= nbLocs; i++) {
Handle(Standard_Transient) anItem = theLocations->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
pyDump<<", ";
}
- }
+ }
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
SetErrorCode(OK);
return aPipeDS;
-
-
}
return anObj;
Standard_Integer nbBases = theBases->Length();
-
+
if (!nbBases)
return anObj;
-
+
Standard_Integer nbSubBases = (theSubBases.IsNull() ? 0 :theSubBases->Length());
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
-
+
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
aCI.SetPath(aRefPath);
aCI.SetWithContactMode(theWithContact);
aCI.SetWithCorrectionMode(theWithCorrections);
-
+
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
pyDump<<", ";
}
-
}
-
+
pyDump<< "], [";
-
+
for(i =1 ; i <= nbSubBases; i++) {
Handle(Standard_Transient) anItem = theSubBases->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
pyDump<<", ";
}
-
}
-
+
pyDump<< "], [";
-
+
for(i =1 ; i <= nbLocs; i++) {
Handle(Standard_Transient) anItem = theLocations->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
pyDump<<", ";
}
- }
+ }
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
return anObj;
Standard_Integer nbBases = theBases->Length();
-
+
if (!nbBases)
return anObj;
-
+
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
-
+
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
aCI.SetBases(aSeqBases);
aCI.SetLocations(aSeqLocs);
-
+
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
pyDump<<", ";
}
-
}
-
+
pyDump<< "], [";
-
+
for(i =1 ; i <= nbLocs; i++) {
Handle(Standard_Transient) anItem = theLocations->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
pyDump<<", ";
}
- }
+ }
pyDump<< "])";
SetErrorCode(OK);
return aPipe;
}
-