-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 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
//function : Execute
//purpose :
//=======================================================================
-Standard_Integer GEOMImpl_ProjectionDriver::Execute(TFunction_Logbook& log) const
+Standard_Integer GEOMImpl_ProjectionDriver::Execute(Handle(TFunction_Logbook)& log) const
{
if (Label().IsNull()) return 0;
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
Standard_ConstructionError::Raise("No solution found");
}
- Quantity_Parameter U, V;
+ Standard_Real U, V;
proj.LowerDistanceParameters(U, V);
gp_Pnt2d aProjPnt (U, V);
bool isSol = false;
double minDist = RealLast();
for (int i = 1; i <= nbPoints; i++) {
- Quantity_Parameter Ui, Vi;
+ Standard_Real Ui, Vi;
proj.Parameters(i, Ui, Vi);
aProjPnt = gp_Pnt2d(Ui, Vi);
aClsf.Perform(aFace, aProjPnt, tol);
try {
OrtProj.Build();
- } catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- TCollection_AsciiString aMsg (aFail->GetMessageString());
+ } catch (Standard_Failure& aFail) {
+ TCollection_AsciiString aMsg (aFail.GetMessageString());
if (!aMsg.Length())
aMsg = "Projection aborted : possibly the source shape intersects the cylinder's axis";
Standard_ConstructionError::Raise(aMsg.ToCString());
// check that the result shape is an empty compound
// (IPAL22905: TC650: Projection on face dialog problems)
- if( !aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND )
+ if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND)
{
- TopoDS_Iterator anIter( aShape );
- if( !anIter.More() )
+ TopoDS_Iterator anIter(aShape);
+ if (!anIter.More())
Standard_ConstructionError::Raise("Projection aborted : empty compound produced");
+
+ if (anOriginal.ShapeType() == TopAbs_WIRE) {
+ // Make wire from resulting compound (Mantis issue 0023497)
+ TopTools_ListOfShape anEdgesList;
+ for (; anIter.More(); anIter.Next()) {
+ anEdgesList.Append(anIter.Value());
+ }
+ BRepBuilderAPI_MakeWire aMkWire;
+ aMkWire.Add(anEdgesList);
+ if (aMkWire.IsDone())
+ aShape = aMkWire.Wire();
+ }
}
}
if (aShape.IsNull()) return 0;
aFunction->SetValue(aShape);
- log.SetTouched(Label());
+ log->SetTouched(Label());
} else if (aType == PROJECTION_ON_WIRE) {
// Perform projection of point on a wire or an edge.
GEOMImpl_IProjection aProj (aFunction);
}
// Transform the curve to cylinder's parametric space.
- GEOMUtils::Handle(HTrsfCurve2d) aTrsfCurve =
+ Handle(GEOMUtils::HTrsfCurve2d) aTrsfCurve =
new GEOMUtils::HTrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
Approx_Curve2d aConv (aTrsfCurve, aPar[0], aPar[1],
aUResol, aVResol, GeomAbs_C1,
return aResult;
}
-IMPLEMENT_STANDARD_HANDLE (GEOMImpl_ProjectionDriver,GEOM_BaseDriver);
-IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_ProjectionDriver,GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_ProjectionDriver,GEOM_BaseDriver)