當前位置: 首頁>>代碼示例>>Java>>正文


Java Simplex.get_instance方法代碼示例

本文整理匯總了Java中geometry.planar.Simplex.get_instance方法的典型用法代碼示例。如果您正苦於以下問題:Java Simplex.get_instance方法的具體用法?Java Simplex.get_instance怎麽用?Java Simplex.get_instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在geometry.planar.Simplex的用法示例。


在下文中一共展示了Simplex.get_instance方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: remove_complete_expansion_room

import geometry.planar.Simplex; //導入方法依賴的package包/類
/**
 * Removes a complete expansion room from the database and creates
 * new incomplete expansion rooms for the neighbours.
 */
public void remove_complete_expansion_room(CompleteFreeSpaceExpansionRoom p_room)
{
    // create new incomplete expansion rooms for all  neighbours
    TileShape room_shape = p_room.get_shape();
    int room_layer = p_room.get_layer();
    Collection<ExpansionDoor> room_doors = p_room.get_doors();
    for (ExpansionDoor curr_door : room_doors)
    {
        ExpansionRoom curr_neighbour = curr_door.other_room(p_room);
        if (curr_neighbour != null)
        {
            curr_neighbour.remove_door(curr_door);
            TileShape neighbour_shape = curr_neighbour.get_shape();
            TileShape intersection = room_shape.intersection(neighbour_shape);
            if (intersection.dimension() == 1)
            {
                // add a new incomplete room to curr_neighbour.
                int[] touching_sides = room_shape.touching_sides(neighbour_shape);
                Line[] line_arr = new Line[1];
                line_arr[0] = neighbour_shape.border_line(touching_sides[1]).opposite();
                Simplex new_incomplete_room_shape = Simplex.get_instance(line_arr);
                IncompleteFreeSpaceExpansionRoom new_incomplete_room =
                        add_incomplete_expansion_room(new_incomplete_room_shape, room_layer, intersection);
                ExpansionDoor new_door = new ExpansionDoor(curr_neighbour, new_incomplete_room, 1);
                curr_neighbour.add_door(new_door);
                new_incomplete_room.add_door(new_door);
            }
        }
    }
    this.remove_all_doors(p_room);
    p_room.remove_from_tree(this.autoroute_search_tree);
    if (complete_expansion_rooms != null)
    {
        complete_expansion_rooms.remove(p_room);
    }
    else
    {
        System.out.println("AutorouteEngine.remove_complete_expansion_room: this.complete_expansion_rooms is null");
    }
    this.drill_page_array.invalidate(room_shape);
}
 
開發者ID:andrasfuchs,項目名稱:BioBalanceDetector,代碼行數:46,代碼來源:AutorouteEngine.java


注:本文中的geometry.planar.Simplex.get_instance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。