]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Debug of Thru sections
authorgka <gka@opencascade.com>
Thu, 11 May 2006 11:06:30 +0000 (11:06 +0000)
committergka <gka@opencascade.com>
Thu, 11 May 2006 11:06:30 +0000 (11:06 +0000)
src/GEOMImpl/GEOMImpl_Gen.cxx
src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx
src/GEOMImpl/Makefile.in

index 74ebd75c38358df73768394138af0a556a42ec86..28d385de55d28a4ece56d8b07174025ebf238d11 100644 (file)
@@ -48,6 +48,7 @@
 #include <GEOMImpl_CylinderDriver.hxx>
 #include <GEOMImpl_PrismDriver.hxx>
 #include <GEOMImpl_PipeDriver.hxx>
+#include <GEOMImpl_ThruSectionsDriver.hxx>
 #include <GEOMImpl_RevolutionDriver.hxx>
 #include <GEOMImpl_ShapeDriver.hxx>
 #include <GEOMImpl_BlockDriver.hxx>
@@ -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());
index 90ae815138cc20500c6f276849f4dbb85378de3b..98a9833c5109aea073d6fdee7ba0b2956bf8ce33 100644 (file)
@@ -30,6 +30,8 @@
 #include <BRepCheck_Analyzer.hxx>
 #include <BRepOffsetAPI_ThruSections.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
 
 #include <TopAbs.hxx>
 #include <TopoDS.hxx>
@@ -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);
index 1564d4ba67f341d15aa6e9d108dfc89789a1092d..32a106affef9523a8e4d0a5e2d5587569e3179e2 100644 (file)
@@ -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 \