本文整理汇总了Java中geometry.planar.IntOctagon.is_empty方法的典型用法代码示例。如果您正苦于以下问题:Java IntOctagon.is_empty方法的具体用法?Java IntOctagon.is_empty怎么用?Java IntOctagon.is_empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geometry.planar.IntOctagon
的用法示例。
在下文中一共展示了IntOctagon.is_empty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
}
示例2: opt_changed_area
import geometry.planar.IntOctagon; //导入方法依赖的package包/类
/**
* Function for optimizing the route in an internal marked area.
* If p_clip_shape != null, the optimizing area is restricted to p_clip_shape.
* p_trace_cost_arr is used for optimizing vias and may be null.
*/
void opt_changed_area(ExpansionCostFactor[] p_trace_cost_arr)
{
if (board.changed_area == null)
{
return;
}
boolean something_changed = true;
// starting with curr_min_translate_dist big is a try to
// avoid fine approximation at the beginning to avoid
// problems with dog ears
while (something_changed)
{
something_changed = false;
for (int i = 0; i < board.get_layer_count(); ++i)
{
IntOctagon changed_region = board.changed_area.get_area(i);
if (changed_region.is_empty())
{
continue;
}
board.changed_area.set_empty(i);
board.join_graphics_update_box(changed_region.bounding_box());
double changed_area_offset =
1.5 * (board.rules.clearance_matrix.max_value(i) + 2 * board.rules.get_max_trace_half_width());
changed_region = changed_region.enlarge(changed_area_offset);
// search in the ShapeSearchTree for all overlapping traces
// with clip_shape on layer i
Collection<SearchTreeObject> items = board.overlapping_objects(changed_region, i);
Iterator<SearchTreeObject> it = items.iterator();
while (it.hasNext())
{
if (this.is_stop_requested())
{
return;
}
SearchTreeObject curr_ob = it.next();
if (curr_ob instanceof PolylineTrace)
{
PolylineTrace curr_trace = (PolylineTrace) curr_ob;
if (curr_trace.pull_tight(this))
{
something_changed = true;
if (this.split_traces_at_keep_point())
{
break;
}
}
else if (smoothen_end_corners_at_trace_1(curr_trace))
{
something_changed = true;
break; // because items may be removed
}
}
else if (curr_ob instanceof Via && p_trace_cost_arr != null)
{
if (OptViaAlgo.opt_via_location(this.board, (Via) curr_ob,
p_trace_cost_arr, this.min_translate_dist, 10))
{
something_changed = true;
}
}
}
}
}
}