0022869: Change IDL and C++ in accordance. Modification of geomBuilder.py

This commit is contained in:
skv 2015-03-23 13:02:48 +03:00
parent 909440ce50
commit 7598e448c9
8 changed files with 579 additions and 257 deletions

View File

@ -1699,9 +1699,16 @@ module GEOM
* the path shape. The path shape can be a wire or an edge. * the path shape. The path shape can be a wire or an edge.
* \param theBase Base shape to be extruded. * \param theBase Base shape to be extruded.
* \param thePath Path shape to extrude the base shape along it. * \param thePath Path shape to extrude the base shape along it.
* \return New GEOM_Object, containing the created pipe. * \param IsGenerateGroups flag that tells if it is necessary to
* return groups (true) or not (false).
* \return The list of objects. The first one is a result pipe,
* the other ones are the created groups. If \a IsGenerateGroups
* is not set the returned list contains a single object, which
* is the operation result.
*/ */
GEOM_Object MakePipe (in GEOM_Object theBase, in GEOM_Object thePath); ListOfGO MakePipe (in GEOM_Object theBase,
in GEOM_Object thePath,
in boolean IsGenerateGroups);
/*! /*!
* \brief Create a shape by revolution of the base shape around the axis * \brief Create a shape by revolution of the base shape around the axis
@ -1769,13 +1776,19 @@ module GEOM
* contact with the spine. * contact with the spine.
* \param theWithCorrection - defining that the section is rotated to be * \param theWithCorrection - defining that the section is rotated to be
* orthogonal to the spine tangent in the correspondent point * orthogonal to the spine tangent in the correspondent point
* \return New GEOM_Object, containing the created pipe. * \param IsGenerateGroups flag that tells if it is necessary to
* return groups (true) or not (false).
* \return The list of objects. The first one is a result pipe,
* the other ones are the created groups. If \a IsGenerateGroups
* is not set the returned list contains a single object, which
* is the operation result.
*/ */
GEOM_Object MakePipeWithDifferentSections (in ListOfGO theSeqBases, ListOfGO MakePipeWithDifferentSections (in ListOfGO theSeqBases,
in ListOfGO theLocations, in ListOfGO theLocations,
in GEOM_Object thePath, in GEOM_Object thePath,
in boolean theWithContact , in boolean theWithContact ,
in boolean theWithCorrection ); in boolean theWithCorrection,
in boolean IsGenerateGroups);
/*! /*!
* \brief Create a shape by extrusion of the profile shape along * \brief Create a shape by extrusion of the profile shape along
@ -1793,23 +1806,35 @@ module GEOM
* contact with the spine. * contact with the spine.
* \param theWithCorrection - defining that the section is rotated to be * \param theWithCorrection - defining that the section is rotated to be
* orthogonal to the spine tangent in the correspondent point * orthogonal to the spine tangent in the correspondent point
* \return New GEOM_Object, containing the created pipe. * \param IsGenerateGroups flag that tells if it is necessary to
* return groups (true) or not (false).
* \return The list of objects. The first one is a result pipe,
* the other ones are the created groups. If \a IsGenerateGroups
* is not set the returned list contains a single object, which
* is the operation result.
*/ */
GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases, ListOfGO MakePipeWithShellSections (in ListOfGO theSeqBases,
in ListOfGO theSeqSubBases, in ListOfGO theSeqSubBases,
in ListOfGO theLocations, in ListOfGO theLocations,
in GEOM_Object thePath, in GEOM_Object thePath,
in boolean theWithContact , in boolean theWithContact,
in boolean theWithCorrection ); in boolean theWithCorrection,
in boolean IsGenerateGroups);
/*! /*!
* \brief Create solids between given sections * \brief Create solids between given sections
* \param theSeqBases - list of sections (shell or face). * \param theSeqBases - list of sections (shell or face).
* \param theLocations - list of corresponding vertexes * \param theLocations - list of corresponding vertexes
* \return New GEOM_Object, containing the created solids. * \param IsGenerateGroups flag that tells if it is necessary to
* return groups (true) or not (false).
* \return The list of objects. The first one is a result pipe,
* the other ones are the created groups. If \a IsGenerateGroups
* is not set the returned list contains a single object, which
* is the operation result.
*/ */
GEOM_Object MakePipeShellsWithoutPath (in ListOfGO theSeqBases, ListOfGO MakePipeShellsWithoutPath (in ListOfGO theSeqBases,
in ListOfGO theLocations); in ListOfGO theLocations,
in boolean IsGenerateGroups);
/*! /*!
* \brief Create a shape by extrusion of the base shape along * \brief Create a shape by extrusion of the base shape along
@ -1821,11 +1846,17 @@ module GEOM
* \param theVec Vector defines a constant binormal direction to keep the * \param theVec Vector defines a constant binormal direction to keep the
* same angle beetween the Direction and the sections * same angle beetween the Direction and the sections
* along the sweep surface. * along the sweep surface.
* \return New GEOM_Object, containing the created pipe. * \param IsGenerateGroups flag that tells if it is necessary to
* return groups (true) or not (false).
* \return The list of objects. The first one is a result pipe,
* the other ones are the created groups. If \a IsGenerateGroups
* is not set the returned list contains a single object, which
* is the operation result.
*/ */
GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase, ListOfGO MakePipeBiNormalAlongVector (in GEOM_Object theBase,
in GEOM_Object thePath, in GEOM_Object thePath,
in GEOM_Object theVec); in GEOM_Object theVec,
in boolean IsGenerateGroups);
/*! /*!

View File

@ -1446,8 +1446,10 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism
* MakePipe * MakePipe
*/ */
//============================================================================= //=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) theBase, Handle(TColStd_HSequenceOfTransient) GEOMImpl_I3DPrimOperations::MakePipe
Handle(GEOM_Object) thePath) (const Handle(GEOM_Object) &theBase,
const Handle(GEOM_Object) &thePath,
const bool IsGenerateGroups)
{ {
SetErrorCode(KO); SetErrorCode(KO);
@ -1488,12 +1490,28 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) th
return NULL; return NULL;
} }
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
aSeq->Append(aPipe);
//Make a Python command //Make a Python command
GEOM::TPythonDump(aFunction) << aPipe << " = geompy.MakePipe(" GEOM::TPythonDump pyDump(aFunction);
<< theBase << ", " << thePath << ")";
if (IsGenerateGroups) {
pyDump << aSeq;
} else {
pyDump << aPipe;
}
pyDump << " = geompy.MakePipe(" << theBase << ", " << thePath;
if (IsGenerateGroups) {
pyDump << ", True";
}
pyDump << ")";
SetErrorCode(OK); SetErrorCode(OK);
return aPipe; return aSeq;
} }
@ -1789,22 +1807,23 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
* MakePipeWithDifferentSections * MakePipeWithDifferentSections
*/ */
//============================================================================= //=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections( Handle(TColStd_HSequenceOfTransient)
const Handle(TColStd_HSequenceOfTransient)& theBases, GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections
const Handle(TColStd_HSequenceOfTransient)& theLocations, (const Handle(TColStd_HSequenceOfTransient) &theBases,
const Handle(GEOM_Object)& thePath, const Handle(TColStd_HSequenceOfTransient) &theLocations,
bool theWithContact, const Handle(GEOM_Object) &thePath,
bool theWithCorrections) const bool theWithContact,
const bool theWithCorrections,
const bool IsGenerateGroups)
{ {
Handle(GEOM_Object) anObj;
SetErrorCode(KO); SetErrorCode(KO);
if(theBases.IsNull()) if(theBases.IsNull())
return anObj; return NULL;
Standard_Integer nbBases = theBases->Length(); Standard_Integer nbBases = theBases->Length();
if (!nbBases) if (!nbBases)
return anObj; return NULL;
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length()); Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object //Add a new Pipe object
@ -1814,16 +1833,16 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
Handle(GEOM_Function) aFunction = Handle(GEOM_Function) aFunction =
aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_DIFFERENT_SECTIONS); aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_DIFFERENT_SECTIONS);
if (aFunction.IsNull()) return anObj; if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly //Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj; if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
GEOMImpl_IPipeDiffSect aCI (aFunction); GEOMImpl_IPipeDiffSect aCI (aFunction);
Handle(GEOM_Function) aRefPath = thePath->GetLastFunction(); Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
if(aRefPath.IsNull()) if(aRefPath.IsNull())
return anObj; return NULL;
Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient; Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
Handle(TColStd_HSequenceOfTransient) aSeqLocs = new TColStd_HSequenceOfTransient; Handle(TColStd_HSequenceOfTransient) aSeqLocs = new TColStd_HSequenceOfTransient;
@ -1859,7 +1878,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
} }
if(!aSeqBases->Length()) if(!aSeqBases->Length())
return anObj; return NULL;
aCI.SetBases(aSeqBases); aCI.SetBases(aSeqBases);
aCI.SetLocations(aSeqLocs); aCI.SetLocations(aSeqLocs);
@ -1872,18 +1891,28 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe with defferent section driver failed"); SetErrorCode("Pipe with defferent section driver failed");
return anObj; return NULL;
} }
} }
catch (Standard_Failure) { catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString()); SetErrorCode(aFail->GetMessageString());
return anObj; return NULL;
} }
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
aSeq->Append(aPipeDS);
//Make a Python command //Make a Python command
GEOM::TPythonDump pyDump(aFunction); GEOM::TPythonDump pyDump(aFunction);
pyDump << aPipeDS << " = geompy.MakePipeWithDifferentSections([";
if (IsGenerateGroups) {
pyDump << aSeq;
} else {
pyDump << aPipeDS;
}
pyDump << " = geompy.MakePipeWithDifferentSections([";
for(i =1 ; i <= nbBases; i++) { for(i =1 ; i <= nbBases; i++) {
@ -1915,10 +1944,16 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
} }
} }
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")"; pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections;
if (IsGenerateGroups) {
pyDump << ", True";
}
pyDump << ")";
SetErrorCode(OK); SetErrorCode(OK);
return aPipeDS; return aSeq;
} }
@ -1927,23 +1962,24 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
* MakePipeWithShellSections * MakePipeWithShellSections
*/ */
//============================================================================= //=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections( Handle(TColStd_HSequenceOfTransient)
const Handle(TColStd_HSequenceOfTransient)& theBases, GEOMImpl_I3DPrimOperations::MakePipeWithShellSections
const Handle(TColStd_HSequenceOfTransient)& theSubBases, (const Handle(TColStd_HSequenceOfTransient) &theBases,
const Handle(TColStd_HSequenceOfTransient)& theLocations, const Handle(TColStd_HSequenceOfTransient) &theSubBases,
const Handle(GEOM_Object)& thePath, const Handle(TColStd_HSequenceOfTransient) &theLocations,
bool theWithContact, const Handle(GEOM_Object) &thePath,
bool theWithCorrections) const bool theWithContact,
const bool theWithCorrections,
const bool IsGenerateGroups)
{ {
Handle(GEOM_Object) anObj;
SetErrorCode(KO); SetErrorCode(KO);
if(theBases.IsNull()) if(theBases.IsNull())
return anObj; return NULL;
Standard_Integer nbBases = theBases->Length(); Standard_Integer nbBases = theBases->Length();
if (!nbBases) if (!nbBases)
return anObj; return NULL;
Standard_Integer nbSubBases = (theSubBases.IsNull() ? 0 :theSubBases->Length()); Standard_Integer nbSubBases = (theSubBases.IsNull() ? 0 :theSubBases->Length());
@ -1956,17 +1992,17 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
Handle(GEOM_Function) aFunction = Handle(GEOM_Function) aFunction =
aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELL_SECTIONS); aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELL_SECTIONS);
if (aFunction.IsNull()) return anObj; if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly //Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj; if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
//GEOMImpl_IPipeDiffSect aCI (aFunction); //GEOMImpl_IPipeDiffSect aCI (aFunction);
GEOMImpl_IPipeShellSect aCI (aFunction); GEOMImpl_IPipeShellSect aCI (aFunction);
Handle(GEOM_Function) aRefPath = thePath->GetLastFunction(); Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
if(aRefPath.IsNull()) if(aRefPath.IsNull())
return anObj; return NULL;
Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient; Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient; Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient;
@ -2015,7 +2051,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
} }
if(!aSeqBases->Length()) if(!aSeqBases->Length())
return anObj; return NULL;
aCI.SetBases(aSeqBases); aCI.SetBases(aSeqBases);
aCI.SetSubBases(aSeqSubBases); aCI.SetSubBases(aSeqSubBases);
@ -2029,18 +2065,28 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe with shell sections driver failed"); SetErrorCode("Pipe with shell sections driver failed");
return anObj; return NULL;
} }
} }
catch (Standard_Failure) { catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString()); SetErrorCode(aFail->GetMessageString());
return anObj; return NULL;
} }
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
aSeq->Append(aPipeDS);
//Make a Python command //Make a Python command
GEOM::TPythonDump pyDump(aFunction); GEOM::TPythonDump pyDump(aFunction);
pyDump << aPipeDS << " = geompy.MakePipeWithShellSections([";
if (IsGenerateGroups) {
pyDump << aSeq;
} else {
pyDump << aPipeDS;
}
pyDump << " = geompy.MakePipeWithShellSections([";
for(i =1 ; i <= nbBases; i++) { for(i =1 ; i <= nbBases; i++) {
@ -2088,10 +2134,16 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
} }
} }
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")"; pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections;
if (IsGenerateGroups) {
pyDump << ", True";
}
pyDump << ")";
SetErrorCode(OK); SetErrorCode(OK);
return aPipeDS; return aSeq;
} }
@ -2101,19 +2153,20 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
* MakePipeShellsWithoutPath * MakePipeShellsWithoutPath
*/ */
//============================================================================= //=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath( Handle(TColStd_HSequenceOfTransient)
const Handle(TColStd_HSequenceOfTransient)& theBases, GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath
const Handle(TColStd_HSequenceOfTransient)& theLocations) (const Handle(TColStd_HSequenceOfTransient) &theBases,
const Handle(TColStd_HSequenceOfTransient) &theLocations,
const bool IsGenerateGroups)
{ {
Handle(GEOM_Object) anObj;
SetErrorCode(KO); SetErrorCode(KO);
if(theBases.IsNull()) if(theBases.IsNull())
return anObj; return NULL;
Standard_Integer nbBases = theBases->Length(); Standard_Integer nbBases = theBases->Length();
if (!nbBases) if (!nbBases)
return anObj; return NULL;
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length()); Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
@ -2124,10 +2177,10 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
Handle(GEOM_Function) aFunction = Handle(GEOM_Function) aFunction =
aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELLS_WITHOUT_PATH); aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELLS_WITHOUT_PATH);
if (aFunction.IsNull()) return anObj; if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly //Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj; if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
GEOMImpl_IPipeShellSect aCI (aFunction); GEOMImpl_IPipeShellSect aCI (aFunction);
@ -2164,7 +2217,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
} }
if(!aSeqBases->Length()) if(!aSeqBases->Length())
return anObj; return NULL;
aCI.SetBases(aSeqBases); aCI.SetBases(aSeqBases);
aCI.SetLocations(aSeqLocs); aCI.SetLocations(aSeqLocs);
@ -2174,18 +2227,28 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe with shell sections without path driver failed"); SetErrorCode("Pipe with shell sections without path driver failed");
return anObj; return NULL;
} }
} }
catch (Standard_Failure) { catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString()); SetErrorCode(aFail->GetMessageString());
return anObj; return NULL;
} }
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
aSeq->Append(aPipeDS);
//Make a Python command //Make a Python command
GEOM::TPythonDump pyDump(aFunction); GEOM::TPythonDump pyDump(aFunction);
pyDump << aPipeDS << " = geompy.MakePipeShellsWithoutPath([";
if (IsGenerateGroups) {
pyDump << aSeq;
} else {
pyDump << aPipeDS;
}
pyDump << " = geompy.MakePipeShellsWithoutPath([";
for(i =1 ; i <= nbBases; i++) { for(i =1 ; i <= nbBases; i++) {
@ -2217,10 +2280,16 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
} }
} }
pyDump<< "])"; pyDump<< "]";
if (IsGenerateGroups) {
pyDump << ", True";
}
pyDump << ")";
SetErrorCode(OK); SetErrorCode(OK);
return aPipeDS; return aSeq;
} }
@ -2229,9 +2298,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
* MakePipeBiNormalAlongVector * MakePipeBiNormalAlongVector
*/ */
//============================================================================= //=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase, Handle(TColStd_HSequenceOfTransient)
Handle(GEOM_Object) thePath, GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector
Handle(GEOM_Object) theVec) (const Handle(GEOM_Object) &theBase,
const Handle(GEOM_Object) &thePath,
const Handle(GEOM_Object) &theVec,
const bool IsGenerateGroups)
{ {
SetErrorCode(KO); SetErrorCode(KO);
@ -2274,12 +2346,30 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
return NULL; return NULL;
} }
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
aSeq->Append(aPipe);
//Make a Python command //Make a Python command
GEOM::TPythonDump(aFunction) << aPipe << " = geompy.MakePipeBiNormalAlongVector(" GEOM::TPythonDump pyDump(aFunction);
<< theBase << ", " << thePath << ", " << theVec << ")";
if (IsGenerateGroups) {
pyDump << aSeq;
} else {
pyDump << aPipe;
}
pyDump << " = geompy.MakePipeBiNormalAlongVector("
<< theBase << ", " << thePath << ", " << theVec;
if (IsGenerateGroups) {
pyDump << ", True";
}
pyDump << ")";
SetErrorCode(OK); SetErrorCode(OK);
return aPipe; return aSeq;
} }
//============================================================================= //=============================================================================

View File

@ -98,8 +98,10 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
Standard_EXPORT Handle(GEOM_Object) MakeDraftPrism (Handle(GEOM_Object) theInitShape, Handle(GEOM_Object) theBase, Standard_EXPORT Handle(GEOM_Object) MakeDraftPrism (Handle(GEOM_Object) theInitShape, Handle(GEOM_Object) theBase,
double theHeight, double theAngle, bool theFuse); double theHeight, double theAngle, bool theFuse);
Standard_EXPORT Handle(GEOM_Object) MakePipe (Handle(GEOM_Object) theBase, Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipe
Handle(GEOM_Object) thePath); (const Handle(GEOM_Object) &theBase,
const Handle(GEOM_Object) &thePath,
const bool IsGenerateGroups);
Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle (Handle(GEOM_Object) theBase, Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theAxis, Handle(GEOM_Object) theAxis,
@ -121,28 +123,34 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
double thePreci, double thePreci,
bool theRuled); bool theRuled);
Standard_EXPORT Handle(GEOM_Object) MakePipeWithDifferentSections( Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
const Handle(TColStd_HSequenceOfTransient)& theBases, MakePipeWithDifferentSections
const Handle(TColStd_HSequenceOfTransient)& theLocations, (const Handle(TColStd_HSequenceOfTransient) &theBases,
const Handle(GEOM_Object)& thePath, const Handle(TColStd_HSequenceOfTransient) &theLocations,
bool theWithContact, const Handle(GEOM_Object) &thePath,
bool theWithCorrections); const bool theWithContact,
const bool theWithCorrections,
const bool IsGenerateGroups);
Standard_EXPORT Handle(GEOM_Object) MakePipeWithShellSections( Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeWithShellSections
const Handle(TColStd_HSequenceOfTransient)& theBases, (const Handle(TColStd_HSequenceOfTransient) &theBases,
const Handle(TColStd_HSequenceOfTransient)& theSubBases, const Handle(TColStd_HSequenceOfTransient) &theSubBases,
const Handle(TColStd_HSequenceOfTransient)& theLocations, const Handle(TColStd_HSequenceOfTransient) &theLocations,
const Handle(GEOM_Object)& thePath, const Handle(GEOM_Object) &thePath,
bool theWithContact, const bool theWithContact,
bool theWithCorrections); const bool theWithCorrections,
const bool IsGenerateGroups);
Standard_EXPORT Handle(GEOM_Object) MakePipeShellsWithoutPath Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeShellsWithoutPath
(const Handle(TColStd_HSequenceOfTransient)& theBases, (const Handle(TColStd_HSequenceOfTransient) &theBases,
const Handle(TColStd_HSequenceOfTransient)& theLocations); const Handle(TColStd_HSequenceOfTransient) &theLocations,
const bool IsGenerateGroups);
Standard_EXPORT Handle(GEOM_Object) MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase, Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeBiNormalAlongVector
Handle(GEOM_Object) thePath, (const Handle(GEOM_Object) &theBase,
Handle(GEOM_Object) theVec); const Handle(GEOM_Object) &thePath,
const Handle(GEOM_Object) &theVec,
const bool IsGenerateGroups);
Standard_EXPORT Handle(GEOM_Object) MakeThickening Standard_EXPORT Handle(GEOM_Object) MakeThickening
(Handle(GEOM_Object) theObject, (Handle(GEOM_Object) theObject,

View File

@ -793,10 +793,12 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDraftPrism
* MakePipe * MakePipe
*/ */
//============================================================================= //=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipe GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipe
(GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr thePath) (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePath,
CORBA::Boolean IsGenerateGroups)
{ {
GEOM::GEOM_Object_var aGEOMObject; GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
//Set a not done flag //Set a not done flag
GetOperations()->SetNotDone(); GetOperations()->SetNotDone();
@ -805,15 +807,20 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipe
Handle(GEOM_Object) aBase = GetObjectImpl(theBase); Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
Handle(GEOM_Object) aPath = GetObjectImpl(thePath); Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
if (aBase.IsNull() || aPath.IsNull()) return aGEOMObject._retn(); if (aBase.IsNull() || aPath.IsNull()) return aSeq._retn();
//Create the Pipe //Create the Pipe
Handle(GEOM_Object) anObject = Handle(TColStd_HSequenceOfTransient) aHSeq =
GetOperations()->MakePipe(aBase, aPath); GetOperations()->MakePipe(aBase, aPath, IsGenerateGroups);
if (!GetOperations()->IsDone() || anObject.IsNull()) if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aGEOMObject._retn(); return aSeq._retn();
return GetObject(anObject); Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
return aSeq._retn();
} }
//============================================================================= //=============================================================================
@ -973,14 +980,15 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThruSections(const GEOM::Lis
* MakePipeWithDifferentSections * MakePipeWithDifferentSections
*/ */
//============================================================================= //=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
(const GEOM::ListOfGO& theBases, (const GEOM::ListOfGO &theBases,
const GEOM::ListOfGO& theLocations, const GEOM::ListOfGO &theLocations,
GEOM::GEOM_Object_ptr thePath, GEOM::GEOM_Object_ptr thePath,
CORBA::Boolean theWithContact, CORBA::Boolean theWithContact,
CORBA::Boolean theWithCorrections) CORBA::Boolean theWithCorrections,
CORBA::Boolean IsGenerateGroups)
{ {
GEOM::GEOM_Object_var aGEOMObject; GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
//Set a not done flag //Set a not done flag
GetOperations()->SetNotDone(); GetOperations()->SetNotDone();
@ -993,11 +1001,11 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
aNbLocs = theLocations.length(); aNbLocs = theLocations.length();
if (aNbLocs && aNbBases != aNbLocs) if (aNbLocs && aNbBases != aNbLocs)
return aGEOMObject._retn(); return aSeq._retn();
Handle(GEOM_Object) aPath = GetObjectImpl(thePath); Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
if (aPath.IsNull()) if (aPath.IsNull())
return aGEOMObject._retn(); return aSeq._retn();
for (ind = 0; ind < aNbBases; ind++) { for (ind = 0; ind < aNbBases; ind++) {
Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]); Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
@ -1013,16 +1021,23 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
aSeqBases->Append(aBase); aSeqBases->Append(aBase);
} }
if (!aSeqBases->Length()) if (!aSeqBases->Length())
return aGEOMObject._retn(); return aSeq._retn();
// Make pipe // Make pipe
Handle(GEOM_Object) anObject = Handle(TColStd_HSequenceOfTransient) aHSeq =
GetOperations()->MakePipeWithDifferentSections(aSeqBases,aSeqLocations ,aPath, GetOperations()->MakePipeWithDifferentSections
theWithContact,theWithCorrections); (aSeqBases, aSeqLocations,
if (!GetOperations()->IsDone() || anObject.IsNull()) aPath, theWithContact,
return aGEOMObject._retn(); theWithCorrections, IsGenerateGroups);
if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aSeq._retn();
return GetObject(anObject); Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
return aSeq._retn();
} }
@ -1031,15 +1046,16 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
* MakePipeWithShellSections * MakePipeWithShellSections
*/ */
//============================================================================= //=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeWithShellSections
(const GEOM::ListOfGO& theBases, (const GEOM::ListOfGO &theBases,
const GEOM::ListOfGO& theSubBases, const GEOM::ListOfGO &theSubBases,
const GEOM::ListOfGO& theLocations, const GEOM::ListOfGO &theLocations,
GEOM::GEOM_Object_ptr thePath, GEOM::GEOM_Object_ptr thePath,
CORBA::Boolean theWithContact, CORBA::Boolean theWithContact,
CORBA::Boolean theWithCorrections) CORBA::Boolean theWithCorrections,
CORBA::Boolean IsGenerateGroups)
{ {
GEOM::GEOM_Object_var aGEOMObject; GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
//Set a not done flag //Set a not done flag
GetOperations()->SetNotDone(); GetOperations()->SetNotDone();
@ -1054,11 +1070,11 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
aNbLocs = theLocations.length(); aNbLocs = theLocations.length();
if (aNbLocs && aNbBases != aNbLocs) if (aNbLocs && aNbBases != aNbLocs)
return aGEOMObject._retn(); return aSeq._retn();
Handle(GEOM_Object) aPath = GetObjectImpl(thePath); Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
if (aPath.IsNull()) if (aPath.IsNull())
return aGEOMObject._retn(); return aSeq._retn();
for (ind = 0; ind < aNbBases; ind++) { for (ind = 0; ind < aNbBases; ind++) {
Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]); Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
@ -1083,17 +1099,23 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
} }
} }
if (!aSeqBases->Length()) if (!aSeqBases->Length())
return aGEOMObject._retn(); return aSeq._retn();
// Make pipe // Make pipe
Handle(GEOM_Object) anObject = Handle(TColStd_HSequenceOfTransient) aHSeq =
GetOperations()->MakePipeWithShellSections(aSeqBases, aSeqSubBases, GetOperations()->MakePipeWithShellSections
(aSeqBases, aSeqSubBases,
aSeqLocations, aPath, aSeqLocations, aPath,
theWithContact, theWithCorrections); theWithContact, theWithCorrections, IsGenerateGroups);
if (!GetOperations()->IsDone() || anObject.IsNull()) if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aGEOMObject._retn(); return aSeq._retn();
return GetObject(anObject); Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
return aSeq._retn();
} }
@ -1102,11 +1124,12 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
* MakePipeShellsWithoutPath * MakePipeShellsWithoutPath
*/ */
//============================================================================= //=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
(const GEOM::ListOfGO& theBases, (const GEOM::ListOfGO &theBases,
const GEOM::ListOfGO& theLocations) const GEOM::ListOfGO &theLocations,
CORBA::Boolean IsGenerateGroups)
{ {
GEOM::GEOM_Object_var aGEOMObject; GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
//Set a not done flag //Set a not done flag
GetOperations()->SetNotDone(); GetOperations()->SetNotDone();
@ -1119,7 +1142,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
aNbLocs = theLocations.length(); aNbLocs = theLocations.length();
if (aNbLocs && aNbBases != aNbLocs) if (aNbLocs && aNbBases != aNbLocs)
return aGEOMObject._retn(); return aSeq._retn();
for (ind = 0; ind < aNbBases; ind++) { for (ind = 0; ind < aNbBases; ind++) {
Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]); Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
@ -1135,16 +1158,22 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
} }
if (!aSeqBases->Length()) if (!aSeqBases->Length())
return aGEOMObject._retn(); return aSeq._retn();
// Make pipe // Make pipe
Handle(GEOM_Object) anObject = Handle(TColStd_HSequenceOfTransient) aHSeq =
GetOperations()->MakePipeShellsWithoutPath(aSeqBases,aSeqLocations); GetOperations()->MakePipeShellsWithoutPath
(aSeqBases, aSeqLocations, IsGenerateGroups);
if (!GetOperations()->IsDone() || anObject.IsNull()) if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aGEOMObject._retn(); return aSeq._retn();
return GetObject(anObject); Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
return aSeq._retn();
} }
//============================================================================= //=============================================================================
@ -1152,12 +1181,13 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
* MakePipeBiNormalAlongVector * MakePipeBiNormalAlongVector
*/ */
//============================================================================= //=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
(GEOM::GEOM_Object_ptr theBase, (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePath, GEOM::GEOM_Object_ptr thePath,
GEOM::GEOM_Object_ptr theVec) GEOM::GEOM_Object_ptr theVec,
CORBA::Boolean IsGenerateGroups)
{ {
GEOM::GEOM_Object_var aGEOMObject; GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
//Set a not done flag //Set a not done flag
GetOperations()->SetNotDone(); GetOperations()->SetNotDone();
@ -1167,15 +1197,21 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
Handle(GEOM_Object) aPath = GetObjectImpl(thePath); Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
Handle(GEOM_Object) aVec = GetObjectImpl(theVec); Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aGEOMObject._retn(); if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aSeq._retn();
//Create the Pipe //Create the Pipe
Handle(GEOM_Object) anObject = Handle(TColStd_HSequenceOfTransient) aHSeq =
GetOperations()->MakePipeBiNormalAlongVector(aBase, aPath, aVec); GetOperations()->MakePipeBiNormalAlongVector
if (!GetOperations()->IsDone() || anObject.IsNull()) (aBase, aPath, aVec, IsGenerateGroups);
return aGEOMObject._retn(); if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aSeq._retn();
return GetObject(anObject); Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
return aSeq._retn();
} }
//============================================================================= //=============================================================================

View File

@ -155,8 +155,9 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
CORBA::Double theAngle, CORBA::Double theAngle,
CORBA::Boolean theFuse); CORBA::Boolean theFuse);
GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase, GEOM::ListOfGO *MakePipe (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePath); GEOM::GEOM_Object_ptr thePath,
CORBA::Boolean IsGenerateGroups);
GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr theAxis, GEOM::GEOM_Object_ptr theAxis,
@ -178,25 +179,33 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
CORBA::Double thePreci, CORBA::Double thePreci,
CORBA::Boolean theRuled); CORBA::Boolean theRuled);
GEOM::GEOM_Object_ptr MakePipeWithDifferentSections(const GEOM::ListOfGO& theBases, GEOM::ListOfGO *MakePipeWithDifferentSections
const GEOM::ListOfGO& theLocations, (const GEOM::ListOfGO &theBases,
const GEOM::ListOfGO &theLocations,
GEOM::GEOM_Object_ptr thePath, GEOM::GEOM_Object_ptr thePath,
CORBA::Boolean theWithContact, CORBA::Boolean theWithContact,
CORBA::Boolean theWithCorrections); CORBA::Boolean theWithCorrections,
CORBA::Boolean IsGenerateGroups);
GEOM::GEOM_Object_ptr MakePipeWithShellSections(const GEOM::ListOfGO& theBases, GEOM::ListOfGO *MakePipeWithShellSections
const GEOM::ListOfGO& theSubBases, (const GEOM::ListOfGO &theBases,
const GEOM::ListOfGO& theLocations, const GEOM::ListOfGO &theSubBases,
const GEOM::ListOfGO &theLocations,
GEOM::GEOM_Object_ptr thePath, GEOM::GEOM_Object_ptr thePath,
CORBA::Boolean theWithContact, CORBA::Boolean theWithContact,
CORBA::Boolean theWithCorrections); CORBA::Boolean theWithCorrections,
CORBA::Boolean IsGenerateGroups);
GEOM::GEOM_Object_ptr MakePipeShellsWithoutPath(const GEOM::ListOfGO& theBases, GEOM::ListOfGO *MakePipeShellsWithoutPath
const GEOM::ListOfGO& theLocations); (const GEOM::ListOfGO &theBases,
const GEOM::ListOfGO &theLocations,
CORBA::Boolean IsGenerateGroups);
GEOM::GEOM_Object_ptr MakePipeBiNormalAlongVector (GEOM::GEOM_Object_ptr theBase, GEOM::ListOfGO *MakePipeBiNormalAlongVector
(GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePath, GEOM::GEOM_Object_ptr thePath,
GEOM::GEOM_Object_ptr theVec); GEOM::GEOM_Object_ptr theVec,
CORBA::Boolean IsGenerateGroups);
GEOM::GEOM_Object_ptr MakeThickening (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr MakeThickening (GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfLong &theFacesIDs, const GEOM::ListOfLong &theFacesIDs,

View File

@ -1403,9 +1403,9 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipe (GEOM::GEOM_Object_ptr theBase,
beginService( " GEOM_Superv_i::MakePipe" ); beginService( " GEOM_Superv_i::MakePipe" );
MESSAGE("GEOM_Superv_i::MakePipe"); MESSAGE("GEOM_Superv_i::MakePipe");
get3DPrimOp(); get3DPrimOp();
GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePipe(theBase, thePath); GEOM::ListOfGO_var aList = my3DPrimOp->MakePipe(theBase, thePath, false);
endService( " GEOM_Superv_i::MakePipe" ); endService( " GEOM_Superv_i::MakePipe" );
return anObj; return aList[0];
} }
//============================================================================= //=============================================================================
@ -1512,9 +1512,9 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithDifferentSections
beginService( " GEOM_Superv_i::MakePipeWithDifferentSections" ); beginService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
MESSAGE("GEOM_Superv_i::MakePipeWithDifferentSections"); MESSAGE("GEOM_Superv_i::MakePipeWithDifferentSections");
get3DPrimOp(); get3DPrimOp();
GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections); GEOM::ListOfGO_var aList = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections, false);
endService( " GEOM_Superv_i::MakePipeWithDifferentSections" ); endService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
return anObj; return aList[0];
} }
@ -1532,12 +1532,13 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithShellSections
beginService( " GEOM_Superv_i::MakePipeWithShellSections" ); beginService( " GEOM_Superv_i::MakePipeWithShellSections" );
MESSAGE("GEOM_Superv_i::MakePipeWithShellSections"); MESSAGE("GEOM_Superv_i::MakePipeWithShellSections");
get3DPrimOp(); get3DPrimOp();
GEOM::GEOM_Object_ptr anObj = GEOM::ListOfGO_var aList =
my3DPrimOp->MakePipeWithShellSections(theBases, theSubBases, my3DPrimOp->MakePipeWithShellSections(theBases, theSubBases,
theLocations, thePath, theLocations, thePath,
theWithContact, theWithCorrections); theWithContact, theWithCorrections,
false);
endService( " GEOM_Superv_i::MakePipeWithShellSections" ); endService( " GEOM_Superv_i::MakePipeWithShellSections" );
return anObj; return aList[0];
} }
@ -1551,10 +1552,10 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeShellsWithoutPath
beginService( " GEOM_Superv_i::MakePipeShellsWithoutPath" ); beginService( " GEOM_Superv_i::MakePipeShellsWithoutPath" );
MESSAGE("GEOM_Superv_i::MakePipeShellsWithoutPath"); MESSAGE("GEOM_Superv_i::MakePipeShellsWithoutPath");
get3DPrimOp(); get3DPrimOp();
GEOM::GEOM_Object_ptr anObj = GEOM::ListOfGO_var aList =
my3DPrimOp->MakePipeShellsWithoutPath(theBases,theLocations); my3DPrimOp->MakePipeShellsWithoutPath(theBases,theLocations, false);
endService( " GEOM_Superv_i::MakePipeShellsWithoutPath" ); endService( " GEOM_Superv_i::MakePipeShellsWithoutPath" );
return anObj; return aList[0];
} }
@ -1569,10 +1570,10 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeBiNormalAlongVector
beginService( " GEOM_Superv_i::MakePipeBiNormalAlongVector" ); beginService( " GEOM_Superv_i::MakePipeBiNormalAlongVector" );
MESSAGE("GEOM_Superv_i::MakePipeBiNormalAlongVector"); MESSAGE("GEOM_Superv_i::MakePipeBiNormalAlongVector");
get3DPrimOp(); get3DPrimOp();
GEOM::GEOM_Object_ptr anObj = GEOM::ListOfGO_var aList =
my3DPrimOp->MakePipeBiNormalAlongVector(theBase, thePath, theVec); my3DPrimOp->MakePipeBiNormalAlongVector(theBase, thePath, theVec, false);
endService( " GEOM_Superv_i::MakePipeBiNormalAlongVector" ); endService( " GEOM_Superv_i::MakePipeBiNormalAlongVector" );
return anObj; return aList[0];
} }

View File

@ -3869,41 +3869,97 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
return anObj return anObj
## Create a shape by extrusion of the base shape along ## Create a shape by extrusion of the base shape along
# the path shape. The path shape can be a wire or an edge. # the path shape. The path shape can be a wire or an edge. It is
# possible to generate groups along with the result by means of
# setting the flag \a IsGenerateGroups.<BR>
# If \a thePath is a closed edge or wire and \a IsGenerateGroups is
# set, an error is occured. If \a thePath is not closed edge/wire,
# the following groups are returned:
# - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
# "Side2";
# - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
# "Other".
# .
# "Down" and "Up" groups contain:
# - Edges if \a theBase is edge or wire;
# - Faces if \a theBase is face or shell.<BR>
# .
# "Side1" and "Side2" groups contain edges generated from the first
# and last vertices of \a theBase. The first and last vertices are
# determined taking into account edge/wire orientation.<BR>
# "Other" group represents faces generated from the bounding edges of
# \a theBase.
#
# @param theBase Base shape to be extruded. # @param theBase Base shape to be extruded.
# @param thePath Path shape to extrude the base shape along it. # @param thePath Path shape to extrude the base shape along it.
# @param IsGenerateGroups flag that tells if it is necessary to
# create groups. It is equal to False by default.
# @param theName Object name; when specified, this parameter is used # @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created pipe. # @return New GEOM.GEOM_Object, containing the created pipe if
# \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created pipe, the
# remaining ones are created groups.
# #
# @ref tui_creation_pipe "Example" # @ref tui_creation_pipe "Example"
@ManageTransactions("PrimOp") @ManageTransactions("PrimOp")
def MakePipe(self, theBase, thePath, theName=None): def MakePipe(self, theBase, thePath,
IsGenerateGroups=False, theName=None):
""" """
Create a shape by extrusion of the base shape along Create a shape by extrusion of the base shape along
the path shape. The path shape can be a wire or an edge. the path shape. The path shape can be a wire or an edge. It is
possible to generate groups along with the result by means of
setting the flag IsGenerateGroups.
If thePath is a closed edge or wire and IsGenerateGroups is
set, an error is occured. If thePath is not closed edge/wire,
the following groups are returned:
- If theBase is unclosed edge or wire: "Down", "Up", "Side1",
"Side2";
- If theBase is closed edge or wire, face or shell: "Down", "Up",
"Other".
"Down" and "Up" groups contain:
- Edges if theBase is edge or wire;
- Faces if theBase is face or shell.
"Side1" and "Side2" groups contain edges generated from the first
and last vertices of theBase. The first and last vertices are
determined taking into account edge/wire orientation.
"Other" group represents faces generated from the bounding edges of
theBase.
Parameters: Parameters:
theBase Base shape to be extruded. theBase Base shape to be extruded.
thePath Path shape to extrude the base shape along it. thePath Path shape to extrude the base shape along it.
IsGenerateGroups flag that tells if it is necessary to
create groups. It is equal to False by default.
theName Object name; when specified, this parameter is used theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created pipe. New GEOM.GEOM_Object, containing the created pipe if
IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created pipe, the
remaining ones are created groups.
""" """
# Example: see GEOM_TestAll.py # Example: see GEOM_TestAll.py
anObj = self.PrimOp.MakePipe(theBase, thePath) aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
RaiseIfFailed("MakePipe", self.PrimOp) RaiseIfFailed("MakePipe", self.PrimOp)
self._autoPublish(anObj, theName, "pipe")
return anObj if IsGenerateGroups:
self._autoPublish(aList, theName, "pipe")
return aList
self._autoPublish(aList[0], theName, "pipe")
return aList[0]
## Create a shape by extrusion of the profile shape along ## Create a shape by extrusion of the profile shape along
# the path shape. The path shape can be a wire or an edge. # the path shape. The path shape can be a wire or an edge.
# the several profiles can be specified in the several locations of path. # the several profiles can be specified in the several locations of path.
# It is possible to generate groups along with the result by means of
# setting the flag \a IsGenerateGroups. For detailed information on
# groups that can be created please see the method MakePipe().
# @param theSeqBases - list of Bases shape to be extruded. # @param theSeqBases - list of Bases shape to be extruded.
# @param theLocations - list of locations on the path corresponding # @param theLocations - list of locations on the path corresponding
# specified list of the Bases shapes. Number of locations # specified list of the Bases shapes. Number of locations
@ -3913,21 +3969,30 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
# contact with the spine. # contact with the spine.
# @param theWithCorrection - defining that the section is rotated to be # @param theWithCorrection - defining that the section is rotated to be
# orthogonal to the spine tangent in the correspondent point # orthogonal to the spine tangent in the correspondent point
# @param IsGenerateGroups - flag that tells if it is necessary to
# create groups. It is equal to False by default.
# @param theName Object name; when specified, this parameter is used # @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created pipe. # @return New GEOM.GEOM_Object, containing the created pipe if
# \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created pipe, the
# remaining ones are created groups.
# #
# @ref tui_creation_pipe_with_diff_sec "Example" # @ref tui_creation_pipe_with_diff_sec "Example"
@ManageTransactions("PrimOp") @ManageTransactions("PrimOp")
def MakePipeWithDifferentSections(self, theSeqBases, def MakePipeWithDifferentSections(self, theSeqBases,
theLocations, thePath, theLocations, thePath,
theWithContact, theWithCorrection, theName=None): theWithContact, theWithCorrection,
IsGenerateGroups=False, theName=None):
""" """
Create a shape by extrusion of the profile shape along Create a shape by extrusion of the profile shape along
the path shape. The path shape can be a wire or an edge. the path shape. The path shape can be a wire or an edge.
the several profiles can be specified in the several locations of path. the several profiles can be specified in the several locations of path.
It is possible to generate groups along with the result by means of
setting the flag IsGenerateGroups. For detailed information on
groups that can be created please see the method geompy.MakePipe().
Parameters: Parameters:
theSeqBases - list of Bases shape to be extruded. theSeqBases - list of Bases shape to be extruded.
@ -3939,23 +4004,37 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
contact with the spine(0/1) contact with the spine(0/1)
theWithCorrection - defining that the section is rotated to be theWithCorrection - defining that the section is rotated to be
orthogonal to the spine tangent in the correspondent point (0/1) orthogonal to the spine tangent in the correspondent point (0/1)
IsGenerateGroups - flag that tells if it is necessary to
create groups. It is equal to False by default.
theName Object name; when specified, this parameter is used theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created pipe. New GEOM.GEOM_Object, containing the created pipe if
IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created pipe, the
remaining ones are created groups.
""" """
anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases, aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
theLocations, thePath, theLocations, thePath,
theWithContact, theWithCorrection) theWithContact, theWithCorrection,
IsGenerateGroups)
RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp) RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
self._autoPublish(anObj, theName, "pipe")
return anObj if IsGenerateGroups:
self._autoPublish(aList, theName, "pipe")
return aList
self._autoPublish(aList[0], theName, "pipe")
return aList[0]
## Create a shape by extrusion of the profile shape along ## Create a shape by extrusion of the profile shape along
# the path shape. The path shape can be a wire or a edge. # the path shape. The path shape can be a wire or an edge.
# the several profiles can be specified in the several locations of path. # the several profiles can be specified in the several locations of path.
# It is possible to generate groups along with the result by means of
# setting the flag \a IsGenerateGroups. For detailed information on
# groups that can be created please see the method MakePipe().
# @param theSeqBases - list of Bases shape to be extruded. Base shape must be # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
# shell or face. If number of faces in neighbour sections # shell or face. If number of faces in neighbour sections
# aren't coincided result solid between such sections will # aren't coincided result solid between such sections will
@ -3974,21 +4053,30 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
# contact with the spine. # contact with the spine.
# @param theWithCorrection - defining that the section is rotated to be # @param theWithCorrection - defining that the section is rotated to be
# orthogonal to the spine tangent in the correspondent point # orthogonal to the spine tangent in the correspondent point
# @param IsGenerateGroups - flag that tells if it is necessary to
# create groups. It is equal to False by default.
# @param theName Object name; when specified, this parameter is used # @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created solids. # @return New GEOM.GEOM_Object, containing the created solids if
# \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created solids, the
# remaining ones are created groups.
# #
# @ref tui_creation_pipe_with_shell_sec "Example" # @ref tui_creation_pipe_with_shell_sec "Example"
@ManageTransactions("PrimOp") @ManageTransactions("PrimOp")
def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases, def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
theLocations, thePath, theLocations, thePath,
theWithContact, theWithCorrection, theName=None): theWithContact, theWithCorrection,
IsGenerateGroups=False, theName=None):
""" """
Create a shape by extrusion of the profile shape along Create a shape by extrusion of the profile shape along
the path shape. The path shape can be a wire or a edge. the path shape. The path shape can be a wire or an edge.
the several profiles can be specified in the several locations of path. the several profiles can be specified in the several locations of path.
It is possible to generate groups along with the result by means of
setting the flag IsGenerateGroups. For detailed information on
groups that can be created please see the method geompy.MakePipe().
Parameters: Parameters:
theSeqBases - list of Bases shape to be extruded. Base shape must be theSeqBases - list of Bases shape to be extruded. Base shape must be
@ -4009,19 +4097,30 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
contact with the spine (0/1) contact with the spine (0/1)
theWithCorrection - defining that the section is rotated to be theWithCorrection - defining that the section is rotated to be
orthogonal to the spine tangent in the correspondent point (0/1) orthogonal to the spine tangent in the correspondent point (0/1)
IsGenerateGroups - flag that tells if it is necessary to
create groups. It is equal to False by default.
theName Object name; when specified, this parameter is used theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created solids. New GEOM.GEOM_Object, containing the created solids if
IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created solids, the
remaining ones are created groups.
""" """
anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases, aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
theLocations, thePath, theLocations, thePath,
theWithContact, theWithCorrection) theWithContact, theWithCorrection,
IsGenerateGroups)
RaiseIfFailed("MakePipeWithShellSections", self.PrimOp) RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
self._autoPublish(anObj, theName, "pipe")
return anObj if IsGenerateGroups:
self._autoPublish(aList, theName, "pipe")
return aList
self._autoPublish(aList[0], theName, "pipe")
return aList[0]
## Create a shape by extrusion of the profile shape along ## Create a shape by extrusion of the profile shape along
# the path shape. This function is used only for debug pipe # the path shape. This function is used only for debug pipe
@ -4031,7 +4130,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
@ManageTransactions("PrimOp") @ManageTransactions("PrimOp")
def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases, def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
theLocations, thePath, theLocations, thePath,
theWithContact, theWithCorrection, theName=None): theWithContact, theWithCorrection,
IsGenerateGroups=False, theName=None):
""" """
Create a shape by extrusion of the profile shape along Create a shape by extrusion of the profile shape along
the path shape. This function is used only for debug pipe the path shape. This function is used only for debug pipe
@ -4050,16 +4150,17 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
tmpLocations = [ theLocations[i-1], theLocations[i] ] tmpLocations = [ theLocations[i-1], theLocations[i] ]
tmpSeqSubBases = [] tmpSeqSubBases = []
if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ] if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases, aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
tmpLocations, thePath, tmpLocations, thePath,
theWithContact, theWithCorrection) theWithContact, theWithCorrection,
IsGenerateGroups)
if self.PrimOp.IsDone() == 0: if self.PrimOp.IsDone() == 0:
print "Problems with pipe creation between ",i," and ",i+1," sections" print "Problems with pipe creation between ",i," and ",i+1," sections"
RaiseIfFailed("MakePipeWithShellSections", self.PrimOp) RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
break break
else: else:
print "Pipe between ",i," and ",i+1," sections is OK" print "Pipe between ",i," and ",i+1," sections is OK"
res.append(anObj) res.append(aList[0])
pass pass
pass pass
@ -4069,57 +4170,92 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
self._autoPublish(resc, theName, "pipe") self._autoPublish(resc, theName, "pipe")
return resc return resc
## Create solids between given sections ## Create solids between given sections.
# It is possible to generate groups along with the result by means of
# setting the flag \a IsGenerateGroups. For detailed information on
# groups that can be created please see the method MakePipe().
# @param theSeqBases - list of sections (shell or face). # @param theSeqBases - list of sections (shell or face).
# @param theLocations - list of corresponding vertexes # @param theLocations - list of corresponding vertexes
# @param IsGenerateGroups - flag that tells if it is necessary to
# create groups. It is equal to False by default.
# @param theName Object name; when specified, this parameter is used # @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created solids. # @return New GEOM.GEOM_Object, containing the created solids if
# \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created solids, the
# remaining ones are created groups.
# #
# @ref tui_creation_pipe_without_path "Example" # @ref tui_creation_pipe_without_path "Example"
@ManageTransactions("PrimOp") @ManageTransactions("PrimOp")
def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None): def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
IsGenerateGroups=False, theName=None):
""" """
Create solids between given sections Create solids between given sections.
It is possible to generate groups along with the result by means of
setting the flag IsGenerateGroups. For detailed information on
groups that can be created please see the method geompy.MakePipe().
Parameters: Parameters:
theSeqBases - list of sections (shell or face). theSeqBases - list of sections (shell or face).
theLocations - list of corresponding vertexes theLocations - list of corresponding vertexes
IsGenerateGroups - flag that tells if it is necessary to
create groups. It is equal to False by default.
theName Object name; when specified, this parameter is used theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created solids. New GEOM.GEOM_Object, containing the created solids if
IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created solids, the
remaining ones are created groups.
""" """
anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations) aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
IsGenerateGroups)
RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp) RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
self._autoPublish(anObj, theName, "pipe")
return anObj if IsGenerateGroups:
self._autoPublish(aList, theName, "pipe")
return aList
self._autoPublish(aList[0], theName, "pipe")
return aList[0]
## Create a shape by extrusion of the base shape along ## Create a shape by extrusion of the base shape along
# the path shape with constant bi-normal direction along the given vector. # the path shape with constant bi-normal direction along the given vector.
# The path shape can be a wire or an edge. # The path shape can be a wire or an edge.
# It is possible to generate groups along with the result by means of
# setting the flag \a IsGenerateGroups. For detailed information on
# groups that can be created please see the method MakePipe().
# @param theBase Base shape to be extruded. # @param theBase Base shape to be extruded.
# @param thePath Path shape to extrude the base shape along it. # @param thePath Path shape to extrude the base shape along it.
# @param theVec Vector defines a constant binormal direction to keep the # @param theVec Vector defines a constant binormal direction to keep the
# same angle beetween the direction and the sections # same angle beetween the direction and the sections
# along the sweep surface. # along the sweep surface.
# @param IsGenerateGroups flag that tells if it is necessary to
# create groups. It is equal to False by default.
# @param theName Object name; when specified, this parameter is used # @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created pipe. # @return New GEOM.GEOM_Object, containing the created pipe if
# \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created pipe, the
# remaining ones are created groups.
# #
# @ref tui_creation_pipe "Example" # @ref tui_creation_pipe "Example"
@ManageTransactions("PrimOp") @ManageTransactions("PrimOp")
def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None): def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
IsGenerateGroups=False, theName=None):
""" """
Create a shape by extrusion of the base shape along Create a shape by extrusion of the base shape along
the path shape with constant bi-normal direction along the given vector. the path shape with constant bi-normal direction along the given vector.
The path shape can be a wire or an edge. The path shape can be a wire or an edge.
It is possible to generate groups along with the result by means of
setting the flag IsGenerateGroups. For detailed information on
groups that can be created please see the method geompy.MakePipe().
Parameters: Parameters:
theBase Base shape to be extruded. theBase Base shape to be extruded.
@ -4127,18 +4263,29 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
theVec Vector defines a constant binormal direction to keep the theVec Vector defines a constant binormal direction to keep the
same angle beetween the direction and the sections same angle beetween the direction and the sections
along the sweep surface. along the sweep surface.
IsGenerateGroups flag that tells if it is necessary to
create groups. It is equal to False by default.
theName Object name; when specified, this parameter is used theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created pipe. New GEOM.GEOM_Object, containing the created pipe if
IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created pipe, the
remaining ones are created groups.
""" """
# Example: see GEOM_TestAll.py # Example: see GEOM_TestAll.py
anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec) aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
theVec, IsGenerateGroups)
RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp) RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
self._autoPublish(anObj, theName, "pipe")
return anObj if IsGenerateGroups:
self._autoPublish(aList, theName, "pipe")
return aList
self._autoPublish(aList[0], theName, "pipe")
return aList[0]
## Makes a thick solid from a shape. If the input is a surface shape ## Makes a thick solid from a shape. If the input is a surface shape
# (face or shell) the result is a thick solid. If an input shape is # (face or shell) the result is a thick solid. If an input shape is

View File

@ -480,7 +480,7 @@ bool GenerationGUI_PipeDlg::isValid (QString&)
//================================================================================= //=================================================================================
bool GenerationGUI_PipeDlg::execute (ObjectList& objects) bool GenerationGUI_PipeDlg::execute (ObjectList& objects)
{ {
GEOM::GEOM_Object_var anObj; GEOM::ListOfGO_var aList;
GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation()); GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
switch( getConstructorId() ) { switch( getConstructorId() ) {
@ -489,15 +489,15 @@ bool GenerationGUI_PipeDlg::execute (ObjectList& objects)
for (int i = 0; i < myBaseObjects.count(); i++) { for (int i = 0; i < myBaseObjects.count(); i++) {
switch ( getConstructorId() ) { switch ( getConstructorId() ) {
case 0 : case 0 :
anObj = anOper->MakePipe(myBaseObjects[i].get(), myPath.get()); aList = anOper->MakePipe(myBaseObjects[i].get(), myPath.get(), false);
break; break;
case 1 : case 1 :
anObj = anOper->MakePipeBiNormalAlongVector(myBaseObjects[i].get(), myPath.get(), myVec.get()); aList = anOper->MakePipeBiNormalAlongVector(myBaseObjects[i].get(), myPath.get(), myVec.get(), false);
break; break;
} }
if (!anObj->_is_nil()) if (!aList[0]->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(aList[0]._retn());
} }
break; break;
case 2: case 2:
@ -513,11 +513,11 @@ bool GenerationGUI_PipeDlg::execute (ObjectList& objects)
myLocationsGO[i] = myLocations[i].copy(); myLocationsGO[i] = myLocations[i].copy();
} }
anObj = anOper->MakePipeWithDifferentSections(myBaseGO.in(), myLocationsGO.in(), myPath.get(), aList = anOper->MakePipeWithDifferentSections(myBaseGO.in(), myLocationsGO.in(), myPath.get(),
GroupMakePoints->CheckBox1->isChecked(), GroupMakePoints->CheckBox1->isChecked(),
GroupMakePoints->CheckBox2->isChecked()); GroupMakePoints->CheckBox2->isChecked(), false);
if (!anObj->_is_nil()) if (!aList[0]->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(aList[0]._retn());
} }
break; break;
default: default: