本文整理汇总了Java中geometry.planar.Simplex类的典型用法代码示例。如果您正苦于以下问题:Java Simplex类的具体用法?Java Simplex怎么用?Java Simplex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Simplex类属于geometry.planar包,在下文中一共展示了Simplex类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculate_incomplete_rooms_with_empty_neighbours
import geometry.planar.Simplex; //导入依赖的package包/类
private static void calculate_incomplete_rooms_with_empty_neighbours(ObstacleExpansionRoom p_room, AutorouteEngine p_autoroute_engine)
{
TileShape room_shape = p_room.get_shape();
for (int i = 0; i < room_shape.border_line_count(); ++i)
{
Line curr_line = room_shape.border_line(i);
if (SortedRoomNeighbours.insert_door_ok(p_room, curr_line))
{
Line[] shape_line = new Line[1];
shape_line[0] = curr_line.opposite();
TileShape new_room_shape = new Simplex(shape_line);
TileShape new_contained_shape = room_shape.intersection(new_room_shape);
FreeSpaceExpansionRoom new_room = p_autoroute_engine.add_incomplete_expansion_room(new_room_shape, p_room.get_layer(), new_contained_shape);
ExpansionDoor new_door = new ExpansionDoor(p_room, new_room, 1);
p_room.add_door(new_door);
new_room.add_door(new_door);
}
}
}
示例2: TargetItemExpansionDoor
import geometry.planar.Simplex; //导入依赖的package包/类
/** Creates a new instance of ItemExpansionInfo */
public TargetItemExpansionDoor(Item p_item, int p_tree_entry_no, CompleteExpansionRoom p_room, ShapeSearchTree p_search_tree)
{
item = p_item;
tree_entry_no = p_tree_entry_no;
room = p_room;
if (room == null)
{
this.shape = Simplex.EMPTY;
}
else
{
TileShape item_shape = item.get_tree_shape(p_search_tree, tree_entry_no);
this.shape = item_shape.intersection(room.get_shape());
}
maze_search_info = new MazeSearchElement();
}
示例3: reduce_trace_shape_at_tie_pin
import geometry.planar.Simplex; //导入依赖的package包/类
/**
* Reduces the first or last shape of p_trace at a tie pin, so that the autorouter algorithm
* can find a connection for a different net.
*/
public void reduce_trace_shape_at_tie_pin(Pin p_tie_pin, PolylineTrace p_trace)
{
TileShape pin_shape = p_tie_pin.get_tree_shape_on_layer(this, p_trace.get_layer());
FloatPoint compare_corner;
int trace_shape_no;
if (p_trace.first_corner().equals(p_tie_pin.get_center()))
{
trace_shape_no = 0;
compare_corner = p_trace.polyline().corner_approx(1);
}
else if (p_trace.last_corner().equals(p_tie_pin.get_center()))
{
trace_shape_no = p_trace.corner_count() - 2;
compare_corner = p_trace.polyline().corner_approx(p_trace.corner_count() - 2);
}
else
{
return;
}
TileShape trace_shape = p_trace.get_tree_shape(this, trace_shape_no);
TileShape intersection = trace_shape.intersection(pin_shape);
if (intersection.dimension() < 2)
{
return;
}
TileShape[] shape_pieces = trace_shape.cutout(pin_shape);
TileShape new_trace_shape = Simplex.EMPTY;
for (int i = 0; i < shape_pieces.length; ++i)
{
if (shape_pieces[i].dimension() == 2)
{
if (new_trace_shape == Simplex.EMPTY || shape_pieces[i].contains(compare_corner))
{
new_trace_shape = shape_pieces[i];
}
}
}
change_item_shape(p_trace, trace_shape_no, new_trace_shape);
}
示例4: 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);
}