当前位置: 首页>>代码示例>>Java>>正文


Java FloatPoint.bounding_octagon方法代码示例

本文整理汇总了Java中geometry.planar.FloatPoint.bounding_octagon方法的典型用法代码示例。如果您正苦于以下问题:Java FloatPoint.bounding_octagon方法的具体用法?Java FloatPoint.bounding_octagon怎么用?Java FloatPoint.bounding_octagon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在geometry.planar.FloatPoint的用法示例。


在下文中一共展示了FloatPoint.bounding_octagon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: transform_to_board

import geometry.planar.FloatPoint; //导入方法依赖的package包/类
public geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform)
{
    FloatPoint [] corner_arr = new FloatPoint[this.coordinate_arr.length / 2];
    double [] curr_point = new double [2];
    for (int i = 0; i < corner_arr.length; ++i)
    {
        curr_point[0] = this.coordinate_arr[2 * i];
        curr_point[1] = this.coordinate_arr[2 * i + 1];
        corner_arr[i] =  p_coordinate_transform.dsn_to_board(curr_point);
    }
    double offset = p_coordinate_transform.dsn_to_board(this.width) / 2;
    if (corner_arr.length <= 2)
    {
        IntOctagon bounding_oct = FloatPoint.bounding_octagon(corner_arr);
        return bounding_oct.enlarge(offset);
    }
    IntPoint [] rounded_corner_arr = new IntPoint[corner_arr.length];
    for (int i = 0; i < corner_arr.length; ++i)
    {
        rounded_corner_arr[i] = corner_arr[i].round();
    }
    geometry.planar.Shape result = new geometry.planar.PolygonShape(rounded_corner_arr);
    if (offset > 0)
    {
        result = result.bounding_tile().enlarge(offset);
    }
    return result;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:29,代码来源:PolygonPath.java

示例2: transform_to_board_rel

import geometry.planar.FloatPoint; //导入方法依赖的package包/类
public geometry.planar.Shape transform_to_board_rel(CoordinateTransform p_coordinate_transform)
{
    FloatPoint [] corner_arr = new FloatPoint[this.coordinate_arr.length / 2];
    double [] curr_point = new double [2];
    for (int i = 0; i < corner_arr.length; ++i)
    {
        curr_point[0] = this.coordinate_arr[2 * i];
        curr_point[1] = this.coordinate_arr[2 * i + 1];
        corner_arr[i] =  p_coordinate_transform.dsn_to_board_rel(curr_point);
    }
    double offset = p_coordinate_transform.dsn_to_board(this.width) / 2;
    if (corner_arr.length <= 2)
    {
        IntOctagon bounding_oct = FloatPoint.bounding_octagon(corner_arr);
        return bounding_oct.enlarge(offset);
    }
    IntPoint [] rounded_corner_arr = new IntPoint[corner_arr.length];
    for (int i = 0; i < corner_arr.length; ++i)
    {
        rounded_corner_arr[i] = corner_arr[i].round();
    }
    geometry.planar.Shape result = new geometry.planar.PolygonShape(rounded_corner_arr);
    if (offset > 0)
    {
        result = result.bounding_tile().enlarge(offset);
    }
    return result;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:29,代码来源:PolygonPath.java


注:本文中的geometry.planar.FloatPoint.bounding_octagon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。