private static < P extends GISPrimitive , N extends AbstractGISTreeSetNode < P , N > > N createNode ( N parent , IcosepQuadTreeZone region , GISTreeSetNodeFactory < P , N > builder ) { Rectangle2d area = parent . getAreaBounds ( ) ; if ( region == IcosepQuadTreeZone . ICOSEP ) { return builder . newNode ( IcosepQuadTreeZone . ICOSEP , area . getMinX ( ) , area . getMinY ( ) , area . getWidth ( ) , area . getHeight ( ) ) ; } if ( parent . getZone ( ) == IcosepQuadTreeZone . ICOSEP ) { area = computeIcosepSubarea ( region , area ) ; return builder . newNode ( region , area . getMinX ( ) , area . getMinY ( ) , area . getWidth ( ) , area . getHeight ( ) ) ; } final Point2d childCutPlane = computeCutPoint ( region , parent ) ; assert childCutPlane != null ; final double w = area . getWidth ( ) / 4. ; final double h = area . getHeight ( ) / 4. ; return builder . newNode ( region , childCutPlane . getX ( ) - w , childCutPlane . getY ( ) - h , 2. * w , 2. * h ) ; }
Create a child node that supports the specified region .