-// Copyright (C) 2014-2015 EDF-R&D
+// Copyright (C) 2014-2015 EDF-R&D
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
aDoc->Close();
}
-void test_HYDROData_LandCoverMap::test_merge_faces()
+void test_HYDROData_LandCoverMap::test_merge_faces_boxes()
{
TopoDS_Shape pp1, pp2, pp3, pp4;
BRep_Builder BB;
CPPUNIT_ASSERT(!pp3.IsNull());
CPPUNIT_ASSERT(!pp4.IsNull());
- //Test mergeFaces() func; USD == true
+ //Test mergeFaces() func // boxes // USD == true
{
TopTools_ListOfShape Faces;
Faces.Append(pp1);
}
//
- //Test mergeFaces() func; USD == false
+ //Test mergeFaces() func // boxes // USD == false
{
TopTools_ListOfShape Faces;
Faces.Append(pp1);
Faces.Append(pp4);
TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
TestViewer::show( aMergedFace, AIS_Shaded, true, "cs23" );
- CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT_IMAGES
CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
}
{
CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
}
}
+
+
+void test_HYDROData_LandCoverMap::test_merge_faces_circles()
+{
+ TopoDS_Shape ff1, ff2, ff3;
+ BRep_Builder BB;
+ BRepTools::Read(ff1, (REF_DATA_PATH + "/ff1.brep").toStdString().c_str(), BB);
+ BRepTools::Read(ff2, (REF_DATA_PATH + "/ff2.brep").toStdString().c_str(), BB);
+ BRepTools::Read(ff3, (REF_DATA_PATH + "/ff3.brep").toStdString().c_str(), BB);
+
+ CPPUNIT_ASSERT(!ff1.IsNull());
+ CPPUNIT_ASSERT(!ff2.IsNull());
+ CPPUNIT_ASSERT(!ff3.IsNull());
+
+ //Test mergeFaces() func // circles // USD == true
+ {
+ TopTools_ListOfShape Faces;
+ Faces.Append(ff1);
+ Faces.Append(ff2);
+ TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
+ TestViewer::show( aMergedFace, AIS_Shaded, true, "cs11_c" );
+ CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_FACE);
+ }
+ {
+ TopTools_ListOfShape Faces;
+ Faces.Append(ff1);
+ Faces.Append(ff3);
+ TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
+ TestViewer::show( aMergedFace, AIS_Shaded, true, "cs12_c" );
+ CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
+ }
+ {
+ TopTools_ListOfShape Faces;
+ Faces.Append(ff1);
+ Faces.Append(ff2);
+ Faces.Append(ff3);
+ TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
+ TestViewer::show( aMergedFace, AIS_Shaded, true, "_cs13" );
+ CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
+ }
+ {
+ TopTools_ListOfShape Faces;
+ Faces.Append(ff1);
+ Faces.Append(ff3);
+ Faces.Append(ff2);
+ TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true );
+ TestViewer::show( aMergedFace, AIS_Shaded, true, "cs14_c" );
+ CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
+ }
+ //
+
+ //Test mergeFaces() func // circles // USD == false
+ {
+ TopTools_ListOfShape Faces;
+ Faces.Append(ff1);
+ Faces.Append(ff2);
+ TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
+ TestViewer::show( aMergedFace, AIS_Shaded, true, "cs21_c" );
+ CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
+ }
+ {
+ TopTools_ListOfShape Faces;
+ Faces.Append(ff1);
+ Faces.Append(ff3);
+ TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
+ TestViewer::show( aMergedFace, AIS_Shaded, true, "cs22_c" );
+ CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
+ }
+ {
+ TopTools_ListOfShape Faces;
+ Faces.Append(ff1);
+ Faces.Append(ff2);
+ Faces.Append(ff3);
+ TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
+ TestViewer::show( aMergedFace, AIS_Shaded, true, "_cs23" );
+ CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
+ }
+ {
+ TopTools_ListOfShape Faces;
+ Faces.Append(ff1);
+ Faces.Append(ff3);
+ Faces.Append(ff2);
+ TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false );
+ TestViewer::show( aMergedFace, AIS_Shaded, true, "cs24_c" );
+ CPPUNIT_ASSERT_IMAGES
+ CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL);
+ }
+
+}
\ No newline at end of file