mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-12 17:50:35 +05:00
0022664: [CEA 1253] MakePipeWithDifferentSections fails on a elbow pipe
This commit is contained in:
parent
28c8e9fe42
commit
8851ec8d8f
@ -18,18 +18,22 @@ circles.append(geompy.MakeCircle(vertices[1], edges[0], 40))
|
||||
circles.append(geompy.MakeCircle(vertices[2], edges[2], 30))
|
||||
circles.append(geompy.MakeCircle(vertices[3], edges[2], 20))
|
||||
|
||||
# create pipe
|
||||
Pipe = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
|
||||
# create pipes
|
||||
Pipe1 = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
|
||||
Pipe2 = geompy.MakePipeWithDifferentSectionsBySteps(circles, vertices, Wire_1)
|
||||
|
||||
# add objects in the study
|
||||
geompy.addToStudy(circles[0], "circles1")
|
||||
geompy.addToStudy(circles[1], "circles2")
|
||||
geompy.addToStudy(circles[2], "circles3")
|
||||
geompy.addToStudy(circles[3], "circles4")
|
||||
id_wire = geompy.addToStudy(Wire_1, "Path")
|
||||
id_pipe = geompy.addToStudy(Pipe, "Pipe")
|
||||
id_wire = geompy.addToStudy(Wire_1, "Path")
|
||||
id_pipe1 = geompy.addToStudy(Pipe1, "Pipe1")
|
||||
id_pipe2 = geompy.addToStudy(Pipe2, "Pipe2")
|
||||
|
||||
# display the wire(path) and the pipe
|
||||
gg.createAndDisplayGO(id_wire)
|
||||
gg.createAndDisplayGO(id_pipe)
|
||||
gg.setDisplayMode(id_pipe,1)
|
||||
gg.createAndDisplayGO(id_pipe1)
|
||||
gg.createAndDisplayGO(id_pipe2)
|
||||
gg.setDisplayMode(id_pipe1,1)
|
||||
gg.setDisplayMode(id_pipe2,1)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 30 KiB |
@ -72,18 +72,33 @@ Additional controls:
|
||||
- If <b>With contact</b> is checked, the section is translated in contact with the spine.
|
||||
- If <b>With correction</b> is checked, the section is rotated to be orthogonal to the spine
|
||||
tangent in the corresponding point.
|
||||
- If <b>Step-by-step generation</b> is checked, the result is created
|
||||
step-by-step, i.e. it creates pipes between each pair of neighbor sections and
|
||||
fuses them into a single shape.
|
||||
|
||||
\note If <b>Step-by-step generation</b> is checked, <b>With contact</b> and
|
||||
<b>With correction</b> controls are disabled as corrections of bases are
|
||||
not allowed in step-by-step mode.
|
||||
|
||||
<b>Generate groups</b> checkbox - if checked allows to create groups of
|
||||
sub-shapes. For more details on groups creation please refer to
|
||||
\ref create_groups_page "this description".
|
||||
\n The \b Result of the operation will be a shell or a solid.
|
||||
|
||||
\n <b>TUI Command:</b> <em>geompy.MakePipeWithDifferentSections(baseShape, locations, pathShape, withContact, withCorrection,
|
||||
\n <b>TUI Commands:</b>
|
||||
- <em>geompy.MakePipeWithDifferentSections(baseShape, locations, pathShape, withContact, withCorrection,
|
||||
IsGenerateGroups=False)</em>
|
||||
\n <b>Arguments:</b> Name + list of shapes (edges, planar wires, faces or shells) serving as base object +
|
||||
list of locations (vertices) on the path corresponding specified list of the shapes +
|
||||
1 shape (edge or wire) for definition of the path +
|
||||
3 Boolean parameters (withContact, withCorrection, IsGenerateGroups).
|
||||
- <em>geompy.MakePipeWithDifferentSectionsBySteps(baseShape, locations, pathShape,
|
||||
IsGenerateGroups=False)</em>
|
||||
\n <b>Arguments:</b> Name + list of shapes (edges, planar wires, faces or shells) serving as base object +
|
||||
list of locations (vertices) on the path corresponding specified list of the shapes +
|
||||
1 shape (edge or wire) for definition of the path +
|
||||
Boolean parameter.
|
||||
|
||||
\n <b>Advanced options</b> \ref preview_anchor "Preview"
|
||||
|
||||
\image html pipe3.png
|
||||
|
@ -1808,9 +1808,13 @@ module GEOM
|
||||
* should be equal to number of bases or list of locations can be empty.
|
||||
* \param thePath - Path shape to extrude the base shape along it.
|
||||
* \param theWithContact - the mode defining that the section is translated to be in
|
||||
* contact with the spine.
|
||||
* contact with the spine. Ignored if IsBySteps is set.
|
||||
* \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. Ignored if IsBySteps is set.
|
||||
* \param IsBySteps - flag that tells if the result should be created
|
||||
* step by step or as a whole. If IsBySteps is set no correction
|
||||
* of bases is allowed.
|
||||
* \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,
|
||||
@ -1823,6 +1827,7 @@ module GEOM
|
||||
in GEOM_Object thePath,
|
||||
in boolean theWithContact ,
|
||||
in boolean theWithCorrection,
|
||||
in boolean IsBySteps,
|
||||
in boolean IsGenerateGroups);
|
||||
|
||||
/*!
|
||||
|
@ -1428,6 +1428,10 @@ Please, select face, shell or solid and try again</translation>
|
||||
<source>GEOM_GROUP_NAME_PREFIX</source>
|
||||
<translation>Group Names Prefix</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_STEP_BY_STEP</source>
|
||||
<translation>Step-by-step generation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_PLANE</source>
|
||||
<translation>Plane</translation>
|
||||
|
@ -1828,6 +1828,7 @@ Handle(TColStd_HSequenceOfTransient)
|
||||
const Handle(GEOM_Object) &thePath,
|
||||
const bool theWithContact,
|
||||
const bool theWithCorrections,
|
||||
const bool IsBySteps,
|
||||
const bool IsGenerateGroups)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
@ -1897,8 +1898,13 @@ Handle(TColStd_HSequenceOfTransient)
|
||||
aCI.SetBases(aSeqBases);
|
||||
aCI.SetLocations(aSeqLocs);
|
||||
aCI.SetPath(aRefPath);
|
||||
aCI.SetWithContactMode(theWithContact);
|
||||
aCI.SetWithCorrectionMode(theWithCorrections);
|
||||
|
||||
if (!IsBySteps) {
|
||||
aCI.SetWithContactMode(theWithContact);
|
||||
aCI.SetWithCorrectionMode(theWithCorrections);
|
||||
}
|
||||
|
||||
aCI.SetIsBySteps(IsBySteps);
|
||||
aCI.SetGenerateGroups(IsGenerateGroups);
|
||||
|
||||
//Compute the Pipe value
|
||||
@ -1930,7 +1936,11 @@ Handle(TColStd_HSequenceOfTransient)
|
||||
pyDump << aPipeDS;
|
||||
}
|
||||
|
||||
pyDump << " = geompy.MakePipeWithDifferentSections([";
|
||||
if (IsBySteps) {
|
||||
pyDump << " = geompy.MakePipeWithDifferentSectionsBySteps([";
|
||||
} else {
|
||||
pyDump << " = geompy.MakePipeWithDifferentSections([";
|
||||
}
|
||||
|
||||
for(i =1 ; i <= nbBases; i++) {
|
||||
|
||||
@ -1962,7 +1972,11 @@ Handle(TColStd_HSequenceOfTransient)
|
||||
}
|
||||
}
|
||||
|
||||
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections;
|
||||
pyDump<< "], "<<thePath;
|
||||
|
||||
if (!IsBySteps) {
|
||||
pyDump<<","<<theWithContact << "," << theWithCorrections;
|
||||
}
|
||||
|
||||
if (IsGenerateGroups) {
|
||||
pyDump << ", True";
|
||||
|
@ -135,6 +135,7 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
|
||||
const Handle(GEOM_Object) &thePath,
|
||||
const bool theWithContact,
|
||||
const bool theWithCorrections,
|
||||
const bool IsBySteps,
|
||||
const bool IsGenerateGroups);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeWithShellSections
|
||||
|
@ -42,6 +42,7 @@
|
||||
#define PIPEDS_LIST_LOCATIONS 3
|
||||
#define PIPEDS_ARG_WITHCONTACT 4
|
||||
#define PIPEDS_ARG_WITHCORRECT 5
|
||||
#define PIPEDS_ARG_BY_STEPS 6
|
||||
|
||||
// ---- GEOMImpl_IPipeShellSect
|
||||
#define PIPEDS_LIST_SUBBASES 6
|
||||
|
@ -73,6 +73,12 @@ class GEOMImpl_IPipeDiffSect : public GEOMImpl_IPipe
|
||||
int GetWithCorrectionMode()
|
||||
{ return _func->GetInteger(PIPEDS_ARG_WITHCORRECT); }
|
||||
|
||||
void SetIsBySteps (int IsBySteps)
|
||||
{ _func->SetInteger(PIPEDS_ARG_BY_STEPS, IsBySteps); }
|
||||
|
||||
int GetIsBySteps()
|
||||
{ return _func->GetInteger(PIPEDS_ARG_BY_STEPS); }
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -43,8 +43,10 @@
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepBuilderAPI_Copy.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepBuilderAPI_MakeSolid.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <BRepBuilderAPI_Sewing.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
#include <GeomFill_Trihedron.hxx>
|
||||
#include <GeomFill_CorrectedFrenet.hxx>
|
||||
@ -686,6 +688,42 @@ static void FindFirstPairFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
|
||||
FS2 = Fs(numface);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RemoveFaces
|
||||
//purpose : This function returns theShapeFrom without faces of the shape
|
||||
// theFacesToRm. It returns a shell if theShapeFrom is a solid or
|
||||
// a compound otherwise. Auxilary for CreatePipeWithDifferentSections
|
||||
// method.
|
||||
//=======================================================================
|
||||
static TopoDS_Shape RemoveFaces(const TopoDS_Shape &theShapeFrom,
|
||||
const TopoDS_Shape &theFacesToRm)
|
||||
{
|
||||
TopTools_IndexedMapOfShape aMapFaces;
|
||||
TopExp_Explorer anExp(theShapeFrom, TopAbs_FACE);
|
||||
BRep_Builder aBuilder;
|
||||
TopoDS_Shape aResult;
|
||||
|
||||
if (theShapeFrom.ShapeType() == TopAbs_SOLID) {
|
||||
// Create shell
|
||||
aBuilder.MakeShell(TopoDS::Shell(aResult));
|
||||
} else {
|
||||
// Create compound
|
||||
aBuilder.MakeCompound(TopoDS::Compound(aResult));
|
||||
}
|
||||
|
||||
TopExp::MapShapes(theFacesToRm, TopAbs_FACE, aMapFaces);
|
||||
|
||||
for (; anExp.More(); anExp.Next()) {
|
||||
const TopoDS_Shape &aFace = anExp.Current();
|
||||
|
||||
if (!aMapFaces.Contains(aFace)) {
|
||||
aBuilder.Add(aResult, aFace);
|
||||
}
|
||||
}
|
||||
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CreatePipeWithDifferentSections
|
||||
//purpose :
|
||||
@ -696,6 +734,7 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
||||
const Handle(TopTools_HSequenceOfShape) theHSeqLocs,
|
||||
const Standard_Boolean theWithContact,
|
||||
const Standard_Boolean theWithCorrect,
|
||||
const Standard_Boolean IsBySteps,
|
||||
Handle(TColStd_HArray1OfInteger) *theGroups)
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
@ -883,49 +922,82 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
||||
}
|
||||
}
|
||||
|
||||
// check curvature of wire for condition that
|
||||
// max summary angle between directions along
|
||||
// wire path must be < 4*PI. If not - split wire
|
||||
// and seguences of shapes, perform pipe for each
|
||||
// and make sewing after that
|
||||
double fp,lp;
|
||||
gp_Pnt P1,P2;
|
||||
gp_Vec Vec1,Vec2;
|
||||
double SumAng = 0;
|
||||
if ( Edges.Length() > 0 ) {
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(Edges.Value(1)),fp,lp);
|
||||
C->D1(fp,P1,Vec1);
|
||||
C->D1(lp,P2,Vec2);
|
||||
SumAng = fabs(Vec1.Angle(Vec2));
|
||||
Vec1 = Vec2;
|
||||
P1 = P2;
|
||||
}
|
||||
TColStd_SequenceOfInteger SplitEdgeNums,SplitLocNums;
|
||||
int LastLoc = 1;
|
||||
//cout<<"Edges.Length()="<<Edges.Length()<<endl;
|
||||
for (i=2; i<=Edges.Length(); i++) {
|
||||
TopoDS_Edge edge = TopoDS::Edge(Edges.Value(i));
|
||||
double tol = BRep_Tool::Tolerance(edge);
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
|
||||
C->D1(lp,P2,Vec2);
|
||||
double ang = fabs(Vec1.Angle(Vec2));
|
||||
SumAng += ang;
|
||||
if (SumAng>4*M_PI) {
|
||||
SumAng = ang;
|
||||
SplitEdgeNums.Append(i-1);
|
||||
int j;
|
||||
for (j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
|
||||
TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
|
||||
gp_Pnt P = BRep_Tool::Pnt(aVert);
|
||||
if (P1.Distance(P) < tol) {
|
||||
SplitLocNums.Append(j);
|
||||
LastLoc = j;
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsBySteps) {
|
||||
// Fill SplitEdgeNums and SplitLocNums with intermediate location indices
|
||||
// and corresponding edge indices.
|
||||
Standard_Integer i = 1;
|
||||
Standard_Integer j;
|
||||
TopoDS_Vertex aVert;
|
||||
gp_Pnt aP;
|
||||
|
||||
for (j = 2; j < aSeqLocs.Length(); j++) {
|
||||
SplitLocNums.Append(j);
|
||||
aVert = TopoDS::Vertex(aSeqLocs.Value(j));
|
||||
aP = BRep_Tool::Pnt(aVert);
|
||||
|
||||
while (i < Edges.Length()) {
|
||||
Standard_Real aFp;
|
||||
Standard_Real aLp;
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(Edges.Value(i));
|
||||
Standard_Real aTol = BRep_Tool::Tolerance(anEdge);
|
||||
Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aFp, aLp);
|
||||
gp_Pnt aPLast;
|
||||
|
||||
aC->D0(aLp, aPLast);
|
||||
i++;
|
||||
|
||||
if (aP.Distance(aPLast) < aTol) {
|
||||
SplitEdgeNums.Append(i - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// check curvature of wire for condition that
|
||||
// max summary angle between directions along
|
||||
// wire path must be < 4*PI. If not - split wire
|
||||
// and seguences of shapes, perform pipe for each
|
||||
// and make sewing after that
|
||||
double fp,lp;
|
||||
gp_Pnt P1,P2;
|
||||
gp_Vec Vec1,Vec2;
|
||||
double SumAng = 0;
|
||||
if ( Edges.Length() > 0 ) {
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(Edges.Value(1)),fp,lp);
|
||||
C->D1(fp,P1,Vec1);
|
||||
C->D1(lp,P2,Vec2);
|
||||
SumAng = fabs(Vec1.Angle(Vec2));
|
||||
Vec1 = Vec2;
|
||||
P1 = P2;
|
||||
}
|
||||
int LastLoc = 1;
|
||||
//cout<<"Edges.Length()="<<Edges.Length()<<endl;
|
||||
for (i=2; i<=Edges.Length(); i++) {
|
||||
TopoDS_Edge edge = TopoDS::Edge(Edges.Value(i));
|
||||
double tol = BRep_Tool::Tolerance(edge);
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
|
||||
C->D1(lp,P2,Vec2);
|
||||
double ang = fabs(Vec1.Angle(Vec2));
|
||||
SumAng += ang;
|
||||
if (SumAng>4*M_PI) {
|
||||
SumAng = ang;
|
||||
SplitEdgeNums.Append(i-1);
|
||||
int j;
|
||||
for (j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
|
||||
TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
|
||||
gp_Pnt P = BRep_Tool::Pnt(aVert);
|
||||
if (P1.Distance(P) < tol) {
|
||||
SplitLocNums.Append(j);
|
||||
LastLoc = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Vec1 = Vec2;
|
||||
P1 = P2;
|
||||
}
|
||||
}
|
||||
|
||||
bool isCreateGroups = (theGroups != NULL);
|
||||
@ -966,9 +1038,24 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
||||
Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
|
||||
}
|
||||
|
||||
BuildPipeShell(aBuilder);
|
||||
Standard_Boolean isDone = BuildPipeShell(aBuilder);
|
||||
|
||||
if (isDone && NeedCreateSolid && nn == 1) {
|
||||
// Make solid for the first step.
|
||||
isDone = aBuilder.MakeSolid();
|
||||
}
|
||||
|
||||
if (!isDone) {
|
||||
Standard_ConstructionError::Raise("Pipe construction failure");
|
||||
}
|
||||
|
||||
TopoDS_Shape resShape = aBuilder.Shape();
|
||||
|
||||
if (NeedCreateSolid && nn == 1) {
|
||||
// Remove top lid from the result.
|
||||
resShape = RemoveFaces(resShape, aBuilder.LastShape());
|
||||
}
|
||||
|
||||
aSeqRes.Append(resShape);
|
||||
|
||||
// Create groups.
|
||||
@ -1014,9 +1101,23 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
||||
Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
|
||||
}
|
||||
|
||||
BuildPipeShell(aBuilder);
|
||||
Standard_Boolean isDone = BuildPipeShell(aBuilder);
|
||||
|
||||
if (isDone && NeedCreateSolid) {
|
||||
isDone = aBuilder.MakeSolid();
|
||||
}
|
||||
|
||||
if (!isDone) {
|
||||
Standard_ConstructionError::Raise("Pipe construction failure");
|
||||
}
|
||||
|
||||
TopoDS_Shape resShape = aBuilder.Shape();
|
||||
|
||||
if (NeedCreateSolid) {
|
||||
// Remove bottom lid from the result.
|
||||
resShape = RemoveFaces(resShape, aBuilder.FirstShape());
|
||||
}
|
||||
|
||||
aSeqRes.Append(resShape);
|
||||
|
||||
// Create groups.
|
||||
@ -1046,6 +1147,28 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
||||
aSewing->Perform();
|
||||
aShape = aSewing->SewedShape();
|
||||
|
||||
if (NeedCreateSolid && aShape.ShapeType() == TopAbs_SHELL) {
|
||||
// Build a solid.
|
||||
BRepBuilderAPI_MakeSolid aMkSolid;
|
||||
|
||||
aMkSolid.Add(TopoDS::Shell(aShape));
|
||||
|
||||
if (!aMkSolid.IsDone()) {
|
||||
Standard_ConstructionError::Raise("Can't create solid pipe");
|
||||
}
|
||||
|
||||
TopoDS_Solid aSolid = aMkSolid.Solid();
|
||||
BRepClass3d_SolidClassifier aSC(aSolid);
|
||||
|
||||
aSC.PerformInfinitePoint(Precision::Confusion());
|
||||
|
||||
if (aSC.State() == TopAbs_IN) {
|
||||
aShape = aSolid.Reversed();
|
||||
} else {
|
||||
aShape = aSolid;
|
||||
}
|
||||
}
|
||||
|
||||
if (isCreateGroups) {
|
||||
// Replase Group shapes by modified ones.
|
||||
TopTools_SequenceOfShape aSeqGroups[5];
|
||||
@ -3032,6 +3155,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
|
||||
Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations ();
|
||||
Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
|
||||
Standard_Boolean aWithCorrect = (aCIDS->GetWithCorrectionMode());
|
||||
Standard_Boolean isBySteps = aCIDS->GetIsBySteps();
|
||||
|
||||
if (aCI) {
|
||||
delete aCI;
|
||||
@ -3079,7 +3203,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
|
||||
|
||||
aShape = CreatePipeWithDifferentSections
|
||||
(aWirePath, aHSeqBases, aHSeqLocs,
|
||||
aWithContact, aWithCorrect, pGroups);
|
||||
aWithContact, aWithCorrect, isBySteps, pGroups);
|
||||
|
||||
if (isGenerateGroups) {
|
||||
// Store created groups.
|
||||
@ -3265,8 +3389,13 @@ GetCreationInformation(std::string& theOperationName,
|
||||
AddParam( theParams, "Bases", aCI.GetBases() );
|
||||
AddParam( theParams, "Locations", aCI.GetLocations() );
|
||||
AddParam( theParams, "Path", aCI.GetPath() );
|
||||
AddParam( theParams, "With contact", aCI.GetWithContactMode() );
|
||||
AddParam( theParams, "With correction", aCI.GetWithCorrectionMode() );
|
||||
|
||||
if (!aCI.GetIsBySteps()) {
|
||||
AddParam( theParams, "With contact", aCI.GetWithContactMode() );
|
||||
AddParam( theParams, "With correction", aCI.GetWithCorrectionMode() );
|
||||
}
|
||||
|
||||
AddParam( theParams, "Step by step", aCI.GetIsBySteps() );
|
||||
break;
|
||||
}
|
||||
case PIPE_SHELL_SECTIONS:
|
||||
|
@ -88,6 +88,7 @@ public:
|
||||
const Handle(TopTools_HSequenceOfShape) theLocs,
|
||||
const Standard_Boolean theWithContact,
|
||||
const Standard_Boolean theWithCorrect,
|
||||
const Standard_Boolean IsBySteps,
|
||||
Handle(TColStd_HArray1OfInteger) *theGroups = NULL);
|
||||
|
||||
Standard_EXPORT virtual
|
||||
|
@ -351,7 +351,8 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShape
|
||||
aLocs->Append(aShapeCDG_1);
|
||||
aLocs->Append(aShapeCDG_2);
|
||||
|
||||
aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections(aWirePath, aBases, aLocs, false, false);
|
||||
aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
||||
(aWirePath, aBases, aLocs, false, false, false);
|
||||
|
||||
// 7. Make a solid, if possible
|
||||
if (theShapeBase.ShapeType() == TopAbs_FACE) {
|
||||
|
@ -987,6 +987,7 @@ GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
|
||||
GEOM::GEOM_Object_ptr thePath,
|
||||
CORBA::Boolean theWithContact,
|
||||
CORBA::Boolean theWithCorrections,
|
||||
CORBA::Boolean IsBySteps,
|
||||
CORBA::Boolean IsGenerateGroups)
|
||||
{
|
||||
GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
|
||||
@ -1029,7 +1030,7 @@ GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
|
||||
GetOperations()->MakePipeWithDifferentSections
|
||||
(aSeqBases, aSeqLocations,
|
||||
aPath, theWithContact,
|
||||
theWithCorrections, IsGenerateGroups);
|
||||
theWithCorrections, IsBySteps, IsGenerateGroups);
|
||||
if (!GetOperations()->IsDone() || aHSeq.IsNull())
|
||||
return aSeq._retn();
|
||||
|
||||
|
@ -186,6 +186,7 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
|
||||
GEOM::GEOM_Object_ptr thePath,
|
||||
CORBA::Boolean theWithContact,
|
||||
CORBA::Boolean theWithCorrections,
|
||||
CORBA::Boolean IsBySteps,
|
||||
CORBA::Boolean IsGenerateGroups);
|
||||
|
||||
GEOM::ListOfGO* MakePipeWithShellSections
|
||||
|
@ -1512,7 +1512,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithDifferentSections
|
||||
beginService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
|
||||
MESSAGE("GEOM_Superv_i::MakePipeWithDifferentSections");
|
||||
get3DPrimOp();
|
||||
GEOM::ListOfGO_var aList = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections, false);
|
||||
GEOM::ListOfGO_var aList = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections, false, false);
|
||||
endService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
|
||||
return aList[0];
|
||||
}
|
||||
|
@ -361,7 +361,8 @@ class Beam(StructuralElementPart):
|
||||
face2 = self.geom.MakeFace(wire2, True)
|
||||
shell = self.geom.MakePipeWithDifferentSections([wire1, wire2],
|
||||
[point1, point2],
|
||||
path, False, False)
|
||||
path, False, False,
|
||||
False)
|
||||
closedShell = self.geom.MakeShell([face1, face2, shell])
|
||||
solid = self.geom.MakeSolid([closedShell])
|
||||
return solid
|
||||
|
@ -4037,7 +4037,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
|
||||
theLocations, thePath,
|
||||
theWithContact, theWithCorrection,
|
||||
IsGenerateGroups)
|
||||
False, IsGenerateGroups)
|
||||
RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
|
||||
|
||||
if IsGenerateGroups:
|
||||
@ -4047,6 +4047,43 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
self._autoPublish(aList[0], theName, "pipe")
|
||||
return aList[0]
|
||||
|
||||
## Create a shape by extrusion of the profile shape along
|
||||
# the path shape. This function is a version of
|
||||
# MakePipeWithShellSections() with the same parameters, except
|
||||
# eliminated theWithContact and theWithCorrection. So it is
|
||||
# possible to find the description of all parameters is in this
|
||||
# method. The difference is that this method performs the operation
|
||||
# step by step, i.e. it creates pipes between each pair of neighbor
|
||||
# sections and fuses them into a single shape.
|
||||
#
|
||||
# @ref tui_creation_pipe_with_diff_sec "Example"
|
||||
@ManageTransactions("PrimOp")
|
||||
def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
|
||||
theLocations, thePath,
|
||||
IsGenerateGroups=False, theName=None):
|
||||
"""
|
||||
Create a shape by extrusion of the profile shape along
|
||||
the path shape. This function is a version of
|
||||
MakePipeWithShellSections() with the same parameters, except
|
||||
eliminated theWithContact and theWithCorrection. So it is
|
||||
possible to find the description of all parameters is in this
|
||||
method. The difference is that this method performs the operation
|
||||
step by step, i.e. it creates pipes between each pair of neighbor
|
||||
sections and fuses them into a single shape.
|
||||
"""
|
||||
aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
|
||||
theLocations, thePath,
|
||||
False, False,
|
||||
True, IsGenerateGroups)
|
||||
RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
|
||||
|
||||
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
|
||||
# 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.
|
||||
|
@ -50,13 +50,14 @@
|
||||
//=================================================================================
|
||||
GenerationGUI_PipeDlg::GenerationGUI_PipeDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||
bool modal, Qt::WindowFlags fl)
|
||||
: GEOMBase_Skeleton (theGeometryGUI, parent, modal, fl),
|
||||
myGenGroupCheckGP (0),
|
||||
myPrefixLblGP (0),
|
||||
myPrefixEditGP (0),
|
||||
myGenGroupCheckGMP (0),
|
||||
myPrefixLblGMP (0),
|
||||
myPrefixEditGMP (0)
|
||||
: GEOMBase_Skeleton (theGeometryGUI, parent, modal, fl),
|
||||
myGenGroupCheckGP (0),
|
||||
myPrefixLblGP (0),
|
||||
myPrefixEditGP (0),
|
||||
myStepByStepCheckGMP (0),
|
||||
myGenGroupCheckGMP (0),
|
||||
myPrefixLblGMP (0),
|
||||
myPrefixEditGMP (0)
|
||||
{
|
||||
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PIPE")));
|
||||
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
||||
@ -124,15 +125,18 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg (GeometryGUI* theGeometryGUI, QWidg
|
||||
// Add widgets for group generation
|
||||
QGridLayout *aLayoutGMP = (QGridLayout *)GroupMakePoints->GroupBox1->layout();
|
||||
|
||||
myGenGroupCheckGMP =
|
||||
myStepByStepCheckGMP =
|
||||
new QCheckBox(tr("GEOM_STEP_BY_STEP"), GroupMakePoints->GroupBox1);
|
||||
myGenGroupCheckGMP =
|
||||
new QCheckBox(tr("GEOM_GENERATE_GROUPS"), GroupMakePoints->GroupBox1);
|
||||
myPrefixLblGMP =
|
||||
myPrefixLblGMP =
|
||||
new QLabel (tr("GEOM_GROUP_NAME_PREFIX"), GroupMakePoints->GroupBox1);
|
||||
myPrefixEditGMP = new QLineEdit(GroupMakePoints->GroupBox1);
|
||||
myPrefixEditGMP = new QLineEdit(GroupMakePoints->GroupBox1);
|
||||
|
||||
aLayoutGMP->addWidget(myGenGroupCheckGMP, 8, 0, 1, 3);
|
||||
aLayoutGMP->addWidget(myPrefixLblGMP, 9, 0, 1, 2);
|
||||
aLayoutGMP->addWidget(myPrefixEditGMP, 9, 2);
|
||||
aLayoutGMP->addWidget(myStepByStepCheckGMP, 8, 0, 1, 3);
|
||||
aLayoutGMP->addWidget(myGenGroupCheckGMP, 9, 0, 1, 3);
|
||||
aLayoutGMP->addWidget(myPrefixLblGMP, 10, 0, 1, 2);
|
||||
aLayoutGMP->addWidget(myPrefixEditGMP, 10, 2);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
|
||||
layout->setMargin(0); layout->setSpacing(6);
|
||||
@ -201,8 +205,10 @@ void GenerationGUI_PipeDlg::Init()
|
||||
connect(GroupMakePoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupMakePoints->CheckBox1, SIGNAL(clicked()), this, SLOT(processPreview()));
|
||||
connect(GroupMakePoints->CheckBox2, SIGNAL(clicked()), this, SLOT(processPreview()));
|
||||
connect(myGenGroupCheckGP, SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
|
||||
connect(myGenGroupCheckGMP, SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
|
||||
connect(myStepByStepCheckGMP, SIGNAL(clicked()), this, SLOT(processPreview()));
|
||||
connect(myGenGroupCheckGP, SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
|
||||
connect(myGenGroupCheckGMP, SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
|
||||
connect(myStepByStepCheckGMP, SIGNAL(toggled(bool)), this, SLOT(StepByStepClicked(bool)));
|
||||
|
||||
initName(tr("GEOM_PIPE"));
|
||||
resize(100,100);
|
||||
@ -250,6 +256,7 @@ void GenerationGUI_PipeDlg::ConstructorsClicked( int constructorId )
|
||||
GroupPoints->hide();
|
||||
GroupMakePoints->show();
|
||||
GroupMakePoints->PushButton1->click();
|
||||
myStepByStepCheckGMP->setChecked(false);
|
||||
myGenGroupCheckGMP->setChecked(false);
|
||||
resetGenGroup(myGenGroupCheckGMP, false, true);
|
||||
break;
|
||||
@ -583,10 +590,16 @@ bool GenerationGUI_PipeDlg::execute (ObjectList& objects)
|
||||
myGenGroupCheckGMP->isChecked();
|
||||
}
|
||||
|
||||
bool isWithContact = GroupMakePoints->CheckBox1->isEnabled() &&
|
||||
GroupMakePoints->CheckBox1->isChecked();
|
||||
bool isWithCorrection = GroupMakePoints->CheckBox2->isEnabled() &&
|
||||
GroupMakePoints->CheckBox2->isChecked();
|
||||
|
||||
aList = anOper->MakePipeWithDifferentSections
|
||||
(myBaseGO.in(), myLocationsGO.in(), myPath.get(),
|
||||
GroupMakePoints->CheckBox1->isChecked(),
|
||||
GroupMakePoints->CheckBox2->isChecked(), doGroups);
|
||||
(myBaseGO.in(), myLocationsGO.in(), myPath.get(),
|
||||
isWithContact, isWithCorrection,
|
||||
myStepByStepCheckGMP->isChecked(),
|
||||
doGroups);
|
||||
|
||||
if (aList->length() > 0) {
|
||||
if (doGroups) {
|
||||
@ -706,6 +719,16 @@ void GenerationGUI_PipeDlg::GenGroupClicked(bool isChecked)
|
||||
resetGenGroup((QCheckBox *)sender(), isChecked, false);
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : StepByStepClicked
|
||||
// purpose : Slot to treat checking "Step-by-step generation" check box.
|
||||
//=================================================================================
|
||||
void GenerationGUI_PipeDlg::StepByStepClicked(bool isChecked)
|
||||
{
|
||||
GroupMakePoints->CheckBox1->setEnabled(!isChecked);
|
||||
GroupMakePoints->CheckBox2->setEnabled(!isChecked);
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : updateGenGroup
|
||||
// purpose : Update "Generate groups" widgets depending on the path.
|
||||
|
@ -81,6 +81,7 @@ private:
|
||||
QCheckBox *myGenGroupCheckGP;
|
||||
QLabel *myPrefixLblGP;
|
||||
QLineEdit *myPrefixEditGP;
|
||||
QCheckBox *myStepByStepCheckGMP;
|
||||
QCheckBox *myGenGroupCheckGMP;
|
||||
QLabel *myPrefixLblGMP;
|
||||
QLineEdit *myPrefixEditGMP;
|
||||
@ -95,6 +96,7 @@ private slots:
|
||||
void ConstructorsClicked( int );
|
||||
void SelectionTypeButtonClicked();
|
||||
void GenGroupClicked(bool);
|
||||
void StepByStepClicked(bool);
|
||||
};
|
||||
|
||||
#endif // GENERATIONGUI_PIPEDLG_H
|
||||
|
Loading…
Reference in New Issue
Block a user