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


Java IntOctagon.normalize方法代码示例

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


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

示例1: insert_incomplete_room

import geometry.planar.IntOctagon; //导入方法依赖的package包/类
/**
 * Inserts a new incomplete room with an octagon shape.
 */
private void insert_incomplete_room(AutorouteEngine p_autoroute_engine, int p_lx, int p_ly, int p_rx, int p_uy,
        int p_ulx, int p_lrx, int p_llx, int p_urx)
{
    IntOctagon new_incomplete_room_shape = new IntOctagon(p_lx, p_ly, p_rx, p_uy, p_ulx, p_lrx, p_llx, p_urx);
    new_incomplete_room_shape = new_incomplete_room_shape.normalize();
    if (new_incomplete_room_shape.dimension() == 2)
    {
        IntOctagon new_contained_shape = this.room_shape.intersection(new_incomplete_room_shape);
        if (!new_contained_shape.is_empty())
        {
            int door_dimension = new_contained_shape.dimension();
            if (door_dimension > 0)
            {
                FreeSpaceExpansionRoom new_room =
                        p_autoroute_engine.add_incomplete_expansion_room(new_incomplete_room_shape, this.from_room.get_layer(), new_contained_shape);
                ExpansionDoor new_door = new ExpansionDoor(this.completed_room, new_room, door_dimension);
                this.completed_room.add_door(new_door);
                new_room.add_door(new_door);
            }
        }
    }
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:26,代码来源:Sorted45DegreeRoomNeighbours.java

示例2: calc_outside_restrained_shape

import geometry.planar.IntOctagon; //导入方法依赖的package包/类
/** Intersects p_room_shape with the half plane defined by the outside of the borderline
 * with index p_obstacle_line_no of p_obstacle_shape.
 */
IntOctagon calc_outside_restrained_shape(IntOctagon p_obstacle_shape, int p_obstacle_line_no, IntOctagon p_room_shape)
{
    int lx = p_room_shape.lx;
    int ly = p_room_shape.ly;
    int rx = p_room_shape.rx;
    int uy = p_room_shape.uy;
    int ulx = p_room_shape.ulx;
    int lrx = p_room_shape.lrx;
    int llx = p_room_shape.llx;
    int urx = p_room_shape.urx;

    if (p_obstacle_line_no == 0)
    {
        uy = p_obstacle_shape.ly;
    }
    else if (p_obstacle_line_no == 2)
    {
        lx = p_obstacle_shape.rx;
    }
    else if (p_obstacle_line_no == 4)
    {
        ly = p_obstacle_shape.uy;
    }
    else if (p_obstacle_line_no == 6)
    {
        rx = p_obstacle_shape.lx;
    }
    else if (p_obstacle_line_no == 1)
    {
        ulx = p_obstacle_shape.lrx;
    }
    else if (p_obstacle_line_no == 3)
    {
        llx = p_obstacle_shape.urx;
    }
    else if (p_obstacle_line_no == 5)
    {
        lrx = p_obstacle_shape.ulx;
    }
    else if (p_obstacle_line_no == 7)
    {
        urx = p_obstacle_shape.llx;
    }
    else
    {
        System.out.println("ShapeSearchTree45Degree.calc_outside_restrained_shape: p_obstacle_line_no out of range");
    }

    IntOctagon result = new IntOctagon(lx, ly, rx, uy, ulx, lrx, llx, urx);
    return result.normalize();
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:55,代码来源:ShapeSearchTree45Degree.java

示例3: calc_inside_restrained_shape

import geometry.planar.IntOctagon; //导入方法依赖的package包/类
/** Intersects p_room_shape with the half plane defined by the inside of the borderline
 * with index p_obstacle_line_no of p_obstacle_shape.
 */
IntOctagon calc_inside_restrained_shape(IntOctagon p_obstacle_shape, int p_obstacle_line_no, IntOctagon p_room_shape)
{
    int lx = p_room_shape.lx;
    int ly = p_room_shape.ly;
    int rx = p_room_shape.rx;
    int uy = p_room_shape.uy;
    int ulx = p_room_shape.ulx;
    int lrx = p_room_shape.lrx;
    int llx = p_room_shape.llx;
    int urx = p_room_shape.urx;

    if (p_obstacle_line_no == 0)
    {
        ly = p_obstacle_shape.ly;
    }
    else if (p_obstacle_line_no == 2)
    {
        rx = p_obstacle_shape.rx;
    }
    else if (p_obstacle_line_no == 4)
    {
        uy = p_obstacle_shape.uy;
    }
    else if (p_obstacle_line_no == 6)
    {
        lx = p_obstacle_shape.lx;
    }
    else if (p_obstacle_line_no == 1)
    {
        lrx = p_obstacle_shape.lrx;
    }
    else if (p_obstacle_line_no == 3)
    {
        urx = p_obstacle_shape.urx;
    }
    else if (p_obstacle_line_no == 5)
    {
        ulx = p_obstacle_shape.ulx;
    }
    else if (p_obstacle_line_no == 7)
    {
        llx = p_obstacle_shape.llx;
    }
    else
    {
        System.out.println("ShapeSearchTree45Degree.calc_inside_restrained_shape: p_obstacle_line_no out of range");
    }

    IntOctagon result = new IntOctagon(lx, ly, rx, uy, ulx, lrx, llx, urx);
    return result.normalize();
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:55,代码来源:ShapeSearchTree45Degree.java


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