當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。