#include <TopoDS_Shell.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPAlgo_PaveFiller.hxx>
#include <BRepTools.hxx>
#include <TopExp_Explorer.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
+#include <TopExp.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <ShapeBuild_ReShape.hxx>
+#include <ShapeFix_Shape.hxx>
+
#include <QFile>
#include <QString>
else if( aListOfFaces.Extent() > 1 )
aResult = MergeFaces( aListOfFaces, false );
+ //remove internal edges
+ aResult = RemoveInternal(aResult);
SetShape( aResult );
}
return aResList;
}
+
+TopoDS_Shape HYDROData_LandCoverMap::RemoveInternal(const TopoDS_Shape& InSh)
+{
+ //Shape must be topologically correct
+ TopExp_Explorer anExp(InSh, TopAbs_EDGE);
+ TopTools_ListOfShape anEdgesToRemove;
+
+ for(; anExp.More(); anExp.Next() )
+ {
+ TopoDS_Edge CurEdge = TopoDS::Edge(anExp.Current());
+ if (CurEdge.Orientation() == TopAbs_INTERNAL)
+ anEdgesToRemove.Append(CurEdge);
+ }
+
+ Handle_ShapeBuild_ReShape aReshape = new ShapeBuild_ReShape();
+ TopoDS_Shape OutSh = aReshape->Apply(InSh);
+ TopTools_ListIteratorOfListOfShape aIt(anEdgesToRemove);
+ for (; aIt.More(); aIt.Next())
+ aReshape->Remove(aIt.Value());
+ OutSh = aReshape->Apply(InSh);
+
+ Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
+ sfs->Init(OutSh);
+ sfs->Perform();
+ return sfs->Shape();
+
+}
Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) );
Polyline_9->AddSection( "Section_1", HYDROData_PolylineXY::SECTION_POLYLINE, false );
Polyline_9->AddPoint( 0, gp_XY( -103.92, 288.40 ) );
+ Polyline_9->AddPoint( 0, gp_XY( -100.09, 285.22 ) );
+ Polyline_9->AddPoint( 0, gp_XY( -96.10, 281.90 ) );
+ Polyline_9->AddPoint( 0, gp_XY( -90.43, 277.19 ) );
Polyline_9->AddPoint( 0, gp_XY( -53.41, 246.43 ) );
Polyline_9->AddPoint( 0, gp_XY( 10.62, 245.01 ) );
+
+
Polyline_9->Update();
CPPUNIT_ASSERT_EQUAL( true, LCM->Split( Polyline_9 ) );
- Handle(HYDROGUI_LandCoverMapPrs) aPrs1 = new HYDROGUI_LandCoverMapPrs( LCM );
- TestViewer::show( aPrs1, AIS_Shaded, 0, true, "LCM_split_2a" );
+ //Handle(HYDROGUI_LandCoverMapPrs) aPrs1 = new HYDROGUI_LandCoverMapPrs( LCM );
+ TestViewer::show( LCM->GetShape(), AIS_Shaded, /*0,*/ true, "LCM_split_2a" );
CPPUNIT_ASSERT_IMAGES
CPPUNIT_ASSERT_EQUAL( true, LCM->Split( Polyline_8 ) );
- Handle(HYDROGUI_LandCoverMapPrs) aPrs2 = new HYDROGUI_LandCoverMapPrs( LCM );
- TestViewer::show( aPrs2, AIS_Shaded, 0, true, "LCM_split_2b" );
+ // Handle(HYDROGUI_LandCoverMapPrs) aPrs2 = new HYDROGUI_LandCoverMapPrs( LCM );
+ TestViewer::show( LCM->GetShape(), AIS_Shaded, /*0,*/ true, "LCM_split_2b" );
CPPUNIT_ASSERT_IMAGES
aDoc->Close();