-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <GEOM_Function.hxx>
-#include <Basics_OCCTVersion.hxx>
-
#include <BRepAlgo.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
//function : Execute
//purpose :
//=======================================================================
-Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const
+Standard_Integer GEOMImpl_FillingDriver::Execute(Handle(TFunction_Logbook)& log) const
{
if (Label().IsNull()) return 0;
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
Standard_Integer aMethod = IF.GetMethod();
GeomFill_SectionGenerator Section;
- Standard_Integer i = 0;
+ Standard_Integer aNumSection = 0;
Handle(Geom_Curve) aLastC;
gp_Pnt PL1,PL2;
for (Ex.Init(aShape, TopAbs_EDGE); Ex.More(); Ex.Next()) {
C->Reverse();
}
else if (aMethod == 2) {
- if (i == 0) {
+ if (aNumSection == 0) {
PL1 = P1;
PL2 = P2;
}
}
Section.AddCurve(C);
- i++;
+ aNumSection++;
}
/* a 'tolerance' is used to compare 2 knots : see GeomFill_Generator.cdl */
Section.Perform(Precision::PConfusion());
- Handle(GeomFill_Line) Line = new GeomFill_Line(i);
+ //imn: to fix the bug 23351: "Crash is filling has only one edge"
+ //after fix related occt bug 27875 must be removed
+ if (aNumSection < 2) {
+ Standard_ConstructionError::Raise("Input must contain more than one edge");
+ }
+ Handle(GeomFill_Line) Line = new GeomFill_Line(aNumSection);
GeomFill_AppSurf App (mindeg, maxdeg, tol3d, tol2d, nbiter); /* user parameters */
App.Perform(Line, Section);
Handle(TColStd_HSequenceOfTransient) aConstraints = IF.GetShapes();
- for ( unsigned int ind = 1; ind <= aConstraints->Length(); ind++ ) {
+ for ( int ind = 1; ind <= aConstraints->Length(); ind++ ) {
TopoDS_Edge E;
TopoDS_Face F;
Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast( aConstraints->Value(ind) );
aFunction->SetValue(aShape);
- log.SetTouched(Label());
+ log->SetTouched(Label());
return 1;
}
}
case FILLING_ON_CONSTRAINTS:
{
- theOperationName = "FACE";
+ theOperationName = "FACE";
AddParam( theParams, "Edges/Faces", aCI.GetShapes() );
break;
}
return true;
}
-IMPLEMENT_STANDARD_HANDLE (GEOMImpl_FillingDriver,GEOM_BaseDriver);
-IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_FillingDriver,GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_FillingDriver,GEOM_BaseDriver)