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


Java IntOctagon.enlarge方法代码示例

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


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

示例1: touching_pins_at_end_corners

import geometry.planar.IntOctagon; //导入方法依赖的package包/类
/**
 * Looks up touching pins at the first corner and the last corner of the trace.
 * Used to avoid acid traps.
 */
Set<Pin> touching_pins_at_end_corners()
{
    Set<Pin> result = new TreeSet<Pin>();
    if (this.board == null)
    {
        return result;
    }
    Point curr_end_point = this.first_corner();
    for (int i = 0; i < 2; ++i)
    {
        IntOctagon curr_oct = curr_end_point.surrounding_octagon();
        curr_oct = curr_oct.enlarge(this.half_width);
        Set<Item> curr_overlaps = this.board.overlapping_items_with_clearance(curr_oct, this.layer, new int[0], this.clearance_class_no());
        for (Item curr_item : curr_overlaps)
        {
            if ((curr_item instanceof Pin) && curr_item.shares_net(this))
            {
                result.add((Pin)curr_item);
            }
        }
        curr_end_point = this.last_corner();
    }
    return result;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:29,代码来源:Trace.java

示例2: transform_to_board

import geometry.planar.IntOctagon; //导入方法依赖的package包/类
public geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform)
{
    FloatPoint [] corner_arr = new FloatPoint[this.coordinate_arr.length / 2];
    double [] curr_point = new double [2];
    for (int i = 0; i < corner_arr.length; ++i)
    {
        curr_point[0] = this.coordinate_arr[2 * i];
        curr_point[1] = this.coordinate_arr[2 * i + 1];
        corner_arr[i] =  p_coordinate_transform.dsn_to_board(curr_point);
    }
    double offset = p_coordinate_transform.dsn_to_board(this.width) / 2;
    if (corner_arr.length <= 2)
    {
        IntOctagon bounding_oct = FloatPoint.bounding_octagon(corner_arr);
        return bounding_oct.enlarge(offset);
    }
    IntPoint [] rounded_corner_arr = new IntPoint[corner_arr.length];
    for (int i = 0; i < corner_arr.length; ++i)
    {
        rounded_corner_arr[i] = corner_arr[i].round();
    }
    geometry.planar.Shape result = new geometry.planar.PolygonShape(rounded_corner_arr);
    if (offset > 0)
    {
        result = result.bounding_tile().enlarge(offset);
    }
    return result;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:29,代码来源:PolygonPath.java

示例3: transform_to_board_rel

import geometry.planar.IntOctagon; //导入方法依赖的package包/类
public geometry.planar.Shape transform_to_board_rel(CoordinateTransform p_coordinate_transform)
{
    FloatPoint [] corner_arr = new FloatPoint[this.coordinate_arr.length / 2];
    double [] curr_point = new double [2];
    for (int i = 0; i < corner_arr.length; ++i)
    {
        curr_point[0] = this.coordinate_arr[2 * i];
        curr_point[1] = this.coordinate_arr[2 * i + 1];
        corner_arr[i] =  p_coordinate_transform.dsn_to_board_rel(curr_point);
    }
    double offset = p_coordinate_transform.dsn_to_board(this.width) / 2;
    if (corner_arr.length <= 2)
    {
        IntOctagon bounding_oct = FloatPoint.bounding_octagon(corner_arr);
        return bounding_oct.enlarge(offset);
    }
    IntPoint [] rounded_corner_arr = new IntPoint[corner_arr.length];
    for (int i = 0; i < corner_arr.length; ++i)
    {
        rounded_corner_arr[i] = corner_arr[i].round();
    }
    geometry.planar.Shape result = new geometry.planar.PolygonShape(rounded_corner_arr);
    if (offset > 0)
    {
        result = result.bounding_tile().enlarge(offset);
    }
    return result;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:29,代码来源:PolygonPath.java

示例4: 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;
                    }
                }
            }
        }
    }
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:71,代码来源:PullTightAlgo.java

示例5: 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;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:60,代码来源:RoutingBoard.java

示例6: move_drill_item

import geometry.planar.IntOctagon; //导入方法依赖的package包/类
/**
 * Translates p_drill_item by p_vector and shoves obstacle
 * traces aside. Returns false, if that was not possible without creating
 * clearance violations. In this case the database may be damaged, so that an undo
 * becomes necessesary.
 */
public boolean move_drill_item(DrillItem p_drill_item, Vector p_vector,
        int p_max_recursion_depth, int p_max_via_recursion_depth,
        int p_tidy_width, int p_pull_tight_accuracy, int p_pull_tight_time_limit)
{
    clear_shove_failing_obstacle();
    // unfix the connected shove fixed traces.
    Collection<Item> contact_list = p_drill_item.get_normal_contacts();
    Iterator<Item> it = contact_list.iterator();
    while (it.hasNext())
    {
        Item curr_contact = it.next();
        if (curr_contact.get_fixed_state() == FixedState.SHOVE_FIXED)
        {
            curr_contact.set_fixed_state(FixedState.UNFIXED);
        }
    }

    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;
    }
    int[] net_no_arr = p_drill_item.net_no_arr;
    start_marking_changed_area();
    if (!MoveDrillItemAlgo.insert(p_drill_item, p_vector,
            p_max_recursion_depth, p_max_via_recursion_depth, tidy_region, this))
    {
        return false;
    }
    if (calculate_tidy_region)
    {
        tidy_region = tidy_region.enlarge(p_tidy_width);
    }
    int[] opt_net_no_arr;
    if (p_max_recursion_depth <= 0)
    {
        opt_net_no_arr = net_no_arr;
    }
    else
    {
        opt_net_no_arr = new int[0];
    }
    opt_changed_area(opt_net_no_arr, tidy_region, p_pull_tight_accuracy, null, null, p_pull_tight_time_limit);
    return true;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:59,代码来源:RoutingBoard.java


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