test/plane_partitioner_test.cpp
// Only the second input polygon has nullptr edge_first_coincident values.
Only the second input polygon has nullptr edge_first_coincident values.
Only the second input polygon has nullptr edge_first_coincident values .
TEST(PlanePartitioner, SplitOnlyFromSecondPolygon) {
  PlanePartitioner<BSPPolygon<>> partitioner;
  std::vector<BSPPolygon<>> input{
    MakeRectangle(0, 0, 0, 2, 2),
  };
  CollectorVisitor<BSPPolygon<>, PolygonFilter> visitor1(PolygonFilter(0));
  std::vector<BSPContentInfo> content_info{
    BSPContentInfo{false,
                   true, 0},
  };
  partitioner.Run(input.begin(), input.end(), 2,
                  true, content_info, visitor1);
  ASSERT_THAT(visitor1.polygons(), ElementsAre(input[0]));
  const BSPPolygon<>& visitor1_polygon = visitor1.polygons()[0];
  std::vector<BSPPolygon<>> input2{
    visitor1_polygon,
    MakeRectangle(1, 2, 2, 4, 4),
  };
  std::vector<BSPContentInfo> content_info2{
    BSPContentInfo{false,
                   true, 0},
    BSPContentInfo{false,
                   true, 0},
  };
  CollectorVisitor<BSPPolygon<>, PolygonFilter> visitor2(PolygonFilter(1));
  partitioner.Run(input2.begin(), input2.end(), 2,
                  true, content_info2, visitor2);
  EXPECT_EQ(visitor2.polygons().size(), 1);
  for (const BSPPolygon<>& polygon : visitor2.polygons()) {
    for (const BSPPolygon<>::EdgeRep& edge : polygon.edges()) {
      EXPECT_NE(edge.edge_first_coincident.split, nullptr);
    }
  }
}
TEST ( PlanePartitioner , SplitOnlyFromSecondPolygon ) { PlanePartitioner < BSPPolygon < > > partitioner ; std :: vector < BSPPolygon < > > input { MakeRectangle ( 0 , 0 , 0 , 2 , 2 ) , } ; CollectorVisitor < BSPPolygon < > , PolygonFilter > visitor1 ( PolygonFilter ( 0 ) ) ; std :: vector < BSPContentInfo > content_info { BSPContentInfo { false , true , 0 } , } ; partitioner . Run ( input . begin ( ) , input . end ( ) , 2 , true , content_info , visitor1 ) ; ASSERT_THAT ( visitor1 . polygons ( ) , ElementsAre ( input [ 0 ] ) ) ; const BSPPolygon < > & visitor1_polygon = visitor1 . polygons ( ) [ 0 ] ; std :: vector < BSPPolygon < > > input2 { visitor1_polygon , MakeRectangle ( 1 , 2 , 2 , 4 , 4 ) , } ; std :: vector < BSPContentInfo > content_info2 { BSPContentInfo { false , true , 0 } , BSPContentInfo { false , true , 0 } , } ; CollectorVisitor < BSPPolygon < > , PolygonFilter > visitor2 ( PolygonFilter ( 1 ) ) ; partitioner . Run ( input2 . begin ( ) , input2 . end ( ) , 2 , true , content_info2 , visitor2 ) ; EXPECT_EQ ( visitor2 . polygons ( ) . size ( ) , 1 ) ; for ( const BSPPolygon < > & polygon : visitor2 . polygons ( ) ) { for ( const BSPPolygon < > :: EdgeRep & edge : polygon . edges ( ) ) { EXPECT_NE ( edge . edge_first_coincident . split , nullptr ) ; } } }
Only the second input polygon has nullptr edge_first_coincident values.
Only the second input polygon has nullptr edge_first_coincident values .
/*id=*/ /*minx=*/ /*miny=*/ /*maxx=*/ /*maxy=*/ /*has_interior_polygons=*/ /*has_border_polygons=*/ /*pwn=*/ /*drop_dimension=*/ /*pos_normal=*/ /*id=*/ /*minx=*/ /*miny=*/ /*maxx=*/ /*maxy=*/ /*has_interior_polygons=*/ /*has_border_polygons=*/ /*pwn=*/ /*has_interior_polygons=*/ /*has_border_polygons=*/ /*pwn=*/ /*drop_dimension=*/ /*pos_normal=*/