-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 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 <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::MakeFaceObjHW (Handle(GEOM_Object) theObj,
- double theH, double theW)
+ double theH, double theW)
{
SetErrorCode(KO);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
- Handle(GEOM_Object) thePnt2,
- Handle(GEOM_Object) thePnt3)
+ Handle(GEOM_Object) thePnt2,
+ Handle(GEOM_Object) thePnt3)
{
SetErrorCode(KO);
//=============================================================================
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::MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
- Handle(GEOM_Object) theVec,
- double theH)
+ Handle(GEOM_Object) theVec,
+ double theH)
{
SetErrorCode(KO);
//=============================================================================
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;
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
(Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg,
- double theTol2D, double theTol3D, int theNbIter, bool isApprox)
+ double theTol2D, double theTol3D, int theNbIter,
+ int theMethod, bool isApprox)
{
SetErrorCode(KO);
aFI.SetTol3D(theTol3D);
aFI.SetNbIter(theNbIter);
aFI.SetApprox(isApprox);
+ aFI.SetMethod(theMethod);
//Compute the Solid value
try {
//Make a Python command
GEOM::TPythonDump pd (aFunction);
pd << aFilling << " = geompy.MakeFilling("
- << theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
- << theTol2D << ", " << theTol3D << ", " << theNbIter;
+ << theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
+ << theTol2D << ", " << theTol3D << ", " << theNbIter << ", ";
+ if( theMethod==1 ) pd << "GEOM.FOM_UseOri";
+ else if( theMethod==2 ) pd << "GEOM.FOM_AutoCorrect";
+ else pd << "GEOM.FOM_Default";
if(isApprox)
- pd << ", " << isApprox;
+ pd << ", " << isApprox ;
pd << ")";
SetErrorCode(OK);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
- const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
- bool theModeSolid,
- double thePreci,
- bool theRuled)
+ const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
+ bool theModeSolid,
+ double thePreci,
+ bool theRuled)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
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;
if(i < nbObj)
- pyDump<<", ";
+ pyDump<<", ";
}
}
-
+
pyDump<< "],"<<theModeSolid << "," << thePreci <<","<< theRuled <<")";
SetErrorCode(OK);
return aThruSect;
-
-
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations,
- const Handle(GEOM_Object)& thePath,
- bool theWithContact,
- bool theWithCorrections)
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
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;
-
+ continue;
+
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
if(aRefLoc.IsNull())
- continue;
+ continue;
aSeqLocs->Append(aRefLoc);
}
aSeqBases->Append(aRefBase);
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<<", ";
}
-
}
-
+
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<<", ";
}
- }
+ }
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
SetErrorCode(OK);
return aPipeDS;
-
-
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theSubBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations,
- const Handle(GEOM_Object)& thePath,
- bool theWithContact,
- bool theWithCorrections)
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theSubBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
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 =
if( nbSubBases >= nbBases ) {
Handle(Standard_Transient) aSubItem = theSubBases->Value(i);
if(aSubItem.IsNull())
- continue;
+ continue;
Handle(GEOM_Object) aSubBase = Handle(GEOM_Object)::DownCast(aSubItem);
if(aSubBase.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefSubBase = aSubBase->GetLastFunction();
if(aRefSubBase.IsNull())
- continue;
+ continue;
aSeqSubBases->Append(aRefSubBase);
}
if(nbLocs) {
Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
if(anItemLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
if(aRefLoc.IsNull())
- continue;
+ continue;
aSeqLocs->Append(aRefLoc);
}
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<<", ";
}
-
}
-
+
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<<", ";
}
-
}
-
+
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<<", ";
}
- }
+ }
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations)
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
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 =
if(nbLocs) {
Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
if(anItemLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
if(aRefLoc.IsNull())
- continue;
+ continue;
aSeqLocs->Append(aRefLoc);
}
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<<", ";
}
-
}
-
+
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<<", ";
}
- }
+ }
pyDump<< "])";
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
- Handle(GEOM_Object) thePath,
- Handle(GEOM_Object) theVec)
+ Handle(GEOM_Object) thePath,
+ Handle(GEOM_Object) theVec)
{
SetErrorCode(KO);
SetErrorCode(OK);
return aPipe;
}
-