本文整理汇总了Java中geometry.planar.IntOctagon.union方法的典型用法代码示例。如果您正苦于以下问题:Java IntOctagon.union方法的具体用法?Java IntOctagon.union怎么用?Java IntOctagon.union使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geometry.planar.IntOctagon
的用法示例。
在下文中一共展示了IntOctagon.union方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insert
import geometry.planar.IntOctagon; //导入方法依赖的package包/类
/**
* Translates p_drill_item by p_vector by shoving obstacle
* traces and vias aside, so that no clearance violations occur.
* If p_tidy_region != null, it will be joined by the bounding octagons of the translated shapes.
*/
static boolean insert(DrillItem p_drill_item, Vector p_vector,
int p_max_recursion_depth, int p_max_via_recursion_depth, IntOctagon p_tidy_region,
RoutingBoard p_board)
{
if (p_drill_item.is_shove_fixed())
{
return false;
}
boolean attach_allowed = false;
if (p_drill_item instanceof Via)
{
attach_allowed = ((Via)p_drill_item).attach_allowed;
}
ForcedPadAlgo forced_pad_algo = new ForcedPadAlgo(p_board);
Collection<Item> ignore_items = new java.util.LinkedList<Item>();
ignore_items.add(p_drill_item);
ShapeSearchTree search_tree = p_board.search_tree_manager.get_default_tree();
for (int curr_layer = p_drill_item.first_layer(); curr_layer <= p_drill_item.last_layer(); ++curr_layer)
{
int curr_ind = curr_layer - p_drill_item.first_layer();
TileShape curr_shape = p_drill_item.get_tree_shape(search_tree, curr_ind);
if (curr_shape == null)
{
continue;
}
ConvexShape new_shape = (ConvexShape) curr_shape.translate_by(p_vector);
TileShape curr_tile_shape;
if (p_board.rules.get_trace_angle_restriction() == AngleRestriction.NINETY_DEGREE)
{
curr_tile_shape = new_shape.bounding_box();
}
else
{
curr_tile_shape = new_shape.bounding_octagon();
}
if (p_tidy_region != null)
{
p_tidy_region = p_tidy_region.union(curr_tile_shape.bounding_octagon());
}
CalcFromSide from_side = new CalcFromSide(p_drill_item.get_center(), curr_tile_shape);
if (!forced_pad_algo.forced_pad(curr_tile_shape, from_side, curr_layer, p_drill_item.net_no_arr,
p_drill_item.clearance_class_no(), attach_allowed,
ignore_items, p_max_recursion_depth, p_max_via_recursion_depth))
{
return false;
}
IntBox curr_bounding_box = curr_shape.bounding_box();
for (int j = 0; j < 4; ++j)
{
p_board.join_changed_area( curr_bounding_box.corner_approx(j), curr_layer);
}
}
p_drill_item.move_by(p_vector);
return true;
}
示例2: remove_items_and_pull_tight
import geometry.planar.IntOctagon; //导入方法依赖的package包/类
/**
* Removes the items in p_item_list and pulls the nearby rubbertraces tight.
* Returns false, if some items could not be removed, because they were fixed.
*/
public boolean remove_items_and_pull_tight(Collection<Item> p_item_list, int p_tidy_width,
int p_pull_tight_accuracy, boolean p_with_delete_fixed)
{
boolean result = true;
IntOctagon tidy_region;
boolean calculate_tidy_region;
if (p_tidy_width < Integer.MAX_VALUE)
{
tidy_region = IntOctagon.EMPTY;
calculate_tidy_region = (p_tidy_width > 0);
}
else
{
tidy_region = null;
calculate_tidy_region = false;
}
start_marking_changed_area();
Set<Integer> changed_nets = new TreeSet<Integer>();
Iterator<Item> it = p_item_list.iterator();
while (it.hasNext())
{
Item curr_item = it.next();
if (!p_with_delete_fixed && curr_item.is_delete_fixed() || curr_item.is_user_fixed())
{
result = false;
}
else
{
for (int i = 0; i < curr_item.tile_shape_count(); ++i)
{
TileShape curr_shape = curr_item.get_tile_shape(i);
changed_area.join(curr_shape, curr_item.shape_layer(i));
if (calculate_tidy_region)
{
tidy_region = tidy_region.union(curr_shape.bounding_octagon());
}
}
remove_item(curr_item);
for (int i = 0; i < curr_item.net_count(); ++i)
{
changed_nets.add(curr_item.get_net_no(i));
}
}
}
for (Integer curr_net_no : changed_nets)
{
this.combine_traces(curr_net_no);
}
if (calculate_tidy_region)
{
tidy_region = tidy_region.enlarge(p_tidy_width);
}
opt_changed_area(new int[0], tidy_region, p_pull_tight_accuracy, null, null, PULL_TIGHT_TIME_LIMIT);
return result;
}