From fae04bb13fddadff4f4346bb59533a45466e1359 Mon Sep 17 00:00:00 2001 From: gka Date: Thu, 11 May 2006 11:06:30 +0000 Subject: [PATCH] Debug of Thru sections --- src/GEOMImpl/GEOMImpl_Gen.cxx | 2 ++ src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx | 27 ++++++++++++++------ src/GEOMImpl/Makefile.in | 1 + 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/GEOMImpl/GEOMImpl_Gen.cxx b/src/GEOMImpl/GEOMImpl_Gen.cxx index 74ebd75c3..28d385de5 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.cxx +++ b/src/GEOMImpl/GEOMImpl_Gen.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -104,6 +105,7 @@ GEOMImpl_Gen::GEOMImpl_Gen() TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CylinderDriver::GetID(), new GEOMImpl_CylinderDriver()); TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PrismDriver::GetID(), new GEOMImpl_PrismDriver()); TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeDriver::GetID(), new GEOMImpl_PipeDriver()); + TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ThruSectionsDriver::GetID(), new GEOMImpl_ThruSectionsDriver()); TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RevolutionDriver::GetID(), new GEOMImpl_RevolutionDriver()); TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SphereDriver::GetID(), new GEOMImpl_SphereDriver()); TFunction_DriverTable::Get()->AddDriver(GEOMImpl_TorusDriver::GetID(), new GEOMImpl_TorusDriver()); diff --git a/src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx b/src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx index 90ae81513..98a9833c5 100644 --- a/src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include @@ -99,18 +101,27 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co continue; TopoDS_Shape aShapeSection = aSection->GetValue(); - if(aShapeSection == TopAbs_WIRE) + TopAbs_ShapeEnum aTypeSect = aShapeSection.ShapeType(); + if(aTypeSect == TopAbs_WIRE) { - TopoDS_Wire aWire = TopoDS::Wire(aShapeSection); - aBuilder.AddWire(aSectWire); + BRepBuilderAPI_MakeWire aTool; + + TopExp_Explorer aExp(aShapeSection,TopAbs_EDGE); + for( ; aExp.More() ; aExp.Next()) + aTool.Add(TopoDS::Edge(aExp.Current())); + if(aTool.IsDone()) + { + TopoDS_Wire aSectWire = aTool.Wire();//TopoDS::Wire(aShapeSection); + aBuilder.AddWire(aSectWire); + } } - else if(aShapeSection == TopAbs_EDGE) { - TopoDS_Edge anEdge = TopoDS::Edge(aShapePath); + else if(aTypeSect == TopAbs_EDGE) { + TopoDS_Edge anEdge = TopoDS::Edge(aShapeSection); TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge); aBuilder.AddWire(aWire); } - else if(aShapeSection == TopAbs_VERTEX) { - TopoDS_Vertex aVert = TopoDS::Vertex(aShapePath); + else if(aTypeSect == TopAbs_VERTEX) { + TopoDS_Vertex aVert = TopoDS::Vertex(aShapeSection); aBuilder.AddVertex(aVert); } else @@ -122,7 +133,7 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co //make surface by sections aBuilder.Build(); TopoDS_Shape aShape = aBuilder.Shape(); - + if (aShape.IsNull()) return 0; BRepCheck_Analyzer ana (aShape, Standard_False); diff --git a/src/GEOMImpl/Makefile.in b/src/GEOMImpl/Makefile.in index 1564d4ba6..32a106aff 100644 --- a/src/GEOMImpl/Makefile.in +++ b/src/GEOMImpl/Makefile.in @@ -40,6 +40,7 @@ LIB_SRC = GEOMImpl_IBasicOperations.cxx \ GEOMImpl_TorusDriver.cxx \ GEOMImpl_PrismDriver.cxx \ GEOMImpl_PipeDriver.cxx \ + GEOMImpl_ThruSectionsDriver.cxx \ GEOMImpl_RevolutionDriver.cxx \ GEOMImpl_ShapeDriver.cxx \ GEOMImpl_BlockDriver.cxx \ -- 2.39.2