本文整理汇总了Java中geometry.planar.PolylineShape类的典型用法代码示例。如果您正苦于以下问题:Java PolylineShape类的具体用法?Java PolylineShape怎么用?Java PolylineShape使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PolylineShape类属于geometry.planar包,在下文中一共展示了PolylineShape类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BasicBoard
import geometry.planar.PolylineShape; //导入依赖的package包/类
/**
* Creates a new instance of a routing Board with surrrounding box
* p_bounding_box
* Rules contains the restrictions to obey when inserting items.
* Among other things it may contain a clearance matrix.
* p_observers is used for syncronisation, if the board is generated
* by a host database. Otherwise it is null.
* If p_test_level != RELEASE_VERSION,, some features may be used, which are still in experimental state.
* Also warnings for debugging may be printed depending on the size of p_test_level.
*/
public BasicBoard(IntBox p_bounding_box, LayerStructure p_layer_structure, PolylineShape[] p_outline_shapes,
int p_outline_cl_class_no, BoardRules p_rules, Communication p_communication, TestLevel p_test_level)
{
layer_structure = p_layer_structure;
rules = p_rules;
library = new BoardLibrary();
item_list = new UndoableObjects();
components = new Components();
communication = p_communication;
bounding_box = p_bounding_box;
this.test_level = p_test_level;
search_tree_manager = new SearchTreeManager(this);
p_rules.nets.set_board(this);
insert_outline(p_outline_shapes, p_outline_cl_class_no);
}
示例2: draw_boundary
import geometry.planar.PolylineShape; //导入依赖的package包/类
/**
* Draws the boundary of p_shape.
*/
public void draw_boundary(Shape p_shape, double p_draw_half_width, Color p_color, Graphics p_g, double p_translucency_factor)
{
if (p_shape instanceof PolylineShape)
{
FloatPoint[] draw_corners = p_shape.corner_approx_arr();
if (draw_corners.length <= 1)
{
return;
}
FloatPoint[] closed_draw_corners = new FloatPoint[draw_corners.length + 1];
System.arraycopy(draw_corners, 0, closed_draw_corners, 0, draw_corners.length);
closed_draw_corners[closed_draw_corners.length - 1] = draw_corners [0];
this.draw( closed_draw_corners, p_draw_half_width, p_color, p_g, p_translucency_factor);
}
else if (p_shape instanceof Circle)
{
Circle curr_circle = (Circle) p_shape;
this.draw_circle(curr_circle.center.to_float(), curr_circle.radius, p_draw_half_width,
p_color, p_g, p_translucency_factor);
}
}
示例3: create_board
import geometry.planar.PolylineShape; //导入依赖的package包/类
/**
* Creates the Routingboard, the graphic context and the interactive settings.
*/
@Override
public void create_board(IntBox p_bounding_box, LayerStructure p_layer_structure,
PolylineShape[] p_outline_shapes, String p_outline_clearance_class_name,
BoardRules p_rules, board.Communication p_board_communication, TestLevel p_test_level)
{
super.create_board(p_bounding_box, p_layer_structure, p_outline_shapes, p_outline_clearance_class_name, p_rules,
p_board_communication, p_test_level);
// create the interactive settings with default
double unit_factor = p_board_communication.coordinate_transform.board_to_dsn(1);
this.coordinate_transform = new CoordinateTransform(1, p_board_communication.unit, unit_factor, p_board_communication.unit);
// create a graphics context for the board
Dimension panel_size = panel.getPreferredSize();
graphics_context = new GraphicsContext(p_bounding_box, panel_size, p_layer_structure, this.locale);
}
示例4: insert_outline
import geometry.planar.PolylineShape; //导入依赖的package包/类
/**
* Inserts an Outline into the board.
*/
public BoardOutline insert_outline(PolylineShape[] p_outline_shapes, int p_clearance_class_no)
{
BoardOutline result = new BoardOutline(p_outline_shapes, p_clearance_class_no, 0, this);
insert_item(result);
return result;
}
示例5: bounding_box
import geometry.planar.PolylineShape; //导入依赖的package包/类
public IntBox bounding_box()
{
IntBox result = IntBox.EMPTY;
for (PolylineShape curr_shape : this.shapes)
{
result = result.union(curr_shape.bounding_box());
}
return result;
}
示例6: translate_by
import geometry.planar.PolylineShape; //导入依赖的package包/类
public void translate_by(Vector p_vector)
{
for (PolylineShape curr_shape : this.shapes)
{
curr_shape = curr_shape.translate_by(p_vector);
}
if (keepout_area != null)
{
keepout_area = keepout_area.translate_by(p_vector);
}
keepout_lines = null;
}
示例7: turn_90_degree
import geometry.planar.PolylineShape; //导入依赖的package包/类
public void turn_90_degree(int p_factor, IntPoint p_pole)
{
for (PolylineShape curr_shape : this.shapes)
{
curr_shape = curr_shape.turn_90_degree(p_factor, p_pole);
}
if (keepout_area != null)
{
keepout_area = keepout_area.turn_90_degree(p_factor, p_pole);
}
keepout_lines = null;
}
示例8: rotate_approx
import geometry.planar.PolylineShape; //导入依赖的package包/类
public void rotate_approx(double p_angle_in_degree, FloatPoint p_pole)
{
double angle = Math.toRadians(p_angle_in_degree);
for (PolylineShape curr_shape : this.shapes)
{
curr_shape = curr_shape.rotate_approx(angle, p_pole);
}
if (keepout_area != null)
{
keepout_area = keepout_area.rotate_approx(angle, p_pole);
}
keepout_lines = null;
}
示例9: change_placement_side
import geometry.planar.PolylineShape; //导入依赖的package包/类
public void change_placement_side(IntPoint p_pole)
{
for (PolylineShape curr_shape : this.shapes)
{
curr_shape = curr_shape.mirror_vertical(p_pole);
}
if (keepout_area != null)
{
keepout_area = keepout_area.mirror_vertical(p_pole);
}
keepout_lines = null;
}
示例10: get_shape
import geometry.planar.PolylineShape; //导入依赖的package包/类
public PolylineShape get_shape(int p_index)
{
if (p_index < 0 || p_index >= this.shapes.length)
{
System.out.println("BoardOutline.get_shape: p_index out of range");
return null;
}
return this.shapes[p_index];
}
示例11: draw
import geometry.planar.PolylineShape; //导入依赖的package包/类
public void draw(java.awt.Graphics p_g, GraphicsContext p_graphics_context, java.awt.Color[] p_color_arr, double p_intensity)
{
if (p_graphics_context == null || p_intensity <= 0)
{
return;
}
for (PolylineShape curr_shape : this.shapes)
{
FloatPoint[] draw_corners = curr_shape.corner_approx_arr();
FloatPoint[] closed_draw_corners = new FloatPoint[draw_corners.length + 1];
System.arraycopy(draw_corners, 0, closed_draw_corners, 0, draw_corners.length);
closed_draw_corners[closed_draw_corners.length - 1] = draw_corners[0];
p_graphics_context.draw(closed_draw_corners, HALF_WIDTH, p_color_arr[0], p_g, p_intensity);
}
}
示例12: line_count
import geometry.planar.PolylineShape; //导入依赖的package包/类
/**
* Returns the sum of the lines of all outline poligons.
*/
public int line_count()
{
int result = 0;
for (PolylineShape curr_shape : this.shapes)
{
result += curr_shape.border_line_count();
}
return result;
}
示例13: RoutingBoard
import geometry.planar.PolylineShape; //导入依赖的package包/类
/**
* Creates a new instance of a routing Board with surrrounding box
* p_bounding_box
* Rules contains the restrictions to obey when inserting items.
* Among other things it may contain a clearance matrix.
*/
public RoutingBoard(IntBox p_bounding_box, LayerStructure p_layer_structure, PolylineShape[] p_outline_shapes,
int p_outline_cl_class_no, BoardRules p_rules, Communication p_board_communication, TestLevel p_test_level)
{
super(p_bounding_box, p_layer_structure, p_outline_shapes, p_outline_cl_class_no,
p_rules, p_board_communication, p_test_level);
}
示例14: separate_holes
import geometry.planar.PolylineShape; //导入依赖的package包/类
/**
* Calculates shapes in p_outline_shapes, which are holes in the outline and returns
* them in the result list.
*/
private static Collection<PolylineShape> separate_holes(Collection<PolylineShape> p_outline_shapes)
{
OutlineShape shape_arr[] = new OutlineShape[p_outline_shapes.size()];
Iterator<PolylineShape> it = p_outline_shapes.iterator();
for (int i = 0; i < shape_arr.length; ++i)
{
shape_arr[i] = new OutlineShape(it.next());
}
for (int i = 0; i < shape_arr.length; ++i)
{
OutlineShape curr_shape = shape_arr[i];
for (int j = 0; j < shape_arr.length; ++j)
{
// check if shape_arr[j] may be contained in shape_arr[i]
OutlineShape other_shape = shape_arr[j];
if (i == j || other_shape.is_hole)
{
continue;
}
if (!other_shape.bounding_box.contains(curr_shape.bounding_box))
{
continue;
}
curr_shape.is_hole = other_shape.contains_all_corners(curr_shape);
}
}
Collection<PolylineShape> hole_list = new LinkedList<PolylineShape>();
for (int i = 0; i < shape_arr.length; ++i)
{
if (shape_arr[i].is_hole)
{
p_outline_shapes.remove(shape_arr[i].shape);
hole_list.add(shape_arr[i].shape);
}
}
return hole_list;
}
示例15: OutlineShape
import geometry.planar.PolylineShape; //导入依赖的package包/类
public OutlineShape(PolylineShape p_shape)
{
shape = p_shape;
bounding_box = p_shape.bounding_box();
convex_shapes = p_shape.split_to_convex();
is_hole = false;
}