本文整理匯總了Java中geometry.planar.IntBox類的典型用法代碼示例。如果您正苦於以下問題:Java IntBox類的具體用法?Java IntBox怎麽用?Java IntBox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IntBox類屬於geometry.planar包,在下文中一共展示了IntBox類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: BasicBoard
import geometry.planar.IntBox; //導入依賴的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: surrounding_box
import geometry.planar.IntBox; //導入依賴的package包/類
public IntBox surrounding_box()
{
int llx = Integer.MAX_VALUE;
int lly = Integer.MAX_VALUE;
int urx = Integer.MIN_VALUE;
int ury = Integer.MIN_VALUE;
for (int i = 0; i < layer_count; ++i)
{
MutableOctagon curr = arr[i];
llx = Math.min (llx, (int)Math.floor(curr.lx));
lly = Math.min (lly, (int)Math.floor(curr.ly));
urx = Math.max (urx, (int)Math.ceil(curr.rx));
ury = Math.max (ury, (int)Math.ceil(curr.uy));
}
if (llx > urx || lly > ury)
{
return IntBox.EMPTY;
}
return new IntBox(llx, lly, urx, ury);
}
示例3: GraphicsContext
import geometry.planar.IntBox; //導入依賴的package包/類
public GraphicsContext( IntBox p_design_bounds,
Dimension p_panel_bounds, board.LayerStructure p_layer_structure, java.util.Locale p_locale)
{
coordinate_transform = new CoordinateTransform(p_design_bounds, p_panel_bounds);
item_color_table = new ItemColorTableModel(p_layer_structure, p_locale);
other_color_table = new OtherColorTableModel(p_locale);
color_intensity_table = new ColorIntensityTable();
layer_visibility_arr = new double [p_layer_structure.arr.length];
for (int i = 0; i < layer_visibility_arr.length; ++i)
{
if (p_layer_structure.arr[i].is_signal)
{
layer_visibility_arr [i] = 1;
}
else
{
layer_visibility_arr [i] = 0;
}
}
}
示例4: change_panel_size
import geometry.planar.IntBox; //導入依賴的package包/類
/**
* changes the size of the panel to p_new_bounds
*/
public void change_panel_size(Dimension p_new_bounds)
{
if (coordinate_transform == null)
{
return;
}
IntBox design_box = coordinate_transform.design_box;
boolean left_right_swapped = coordinate_transform.is_mirror_left_right();
boolean top_bottom_swapped = coordinate_transform.is_mirror_top_bottom();
double rotation = coordinate_transform.get_rotation();
coordinate_transform = new CoordinateTransform(design_box, p_new_bounds);
coordinate_transform.set_mirror_left_right(left_right_swapped);
coordinate_transform.set_mirror_top_bottom(top_bottom_swapped);
coordinate_transform.set_rotation(rotation);
}
示例5: line_outside_update_box
import geometry.planar.IntBox; //導入依賴的package包/類
/**
* filter lines, which cannot touch the update_box to improve the
* performance of the draw function by avoiding unnessesary calls
* of draw (line)
*/
private boolean line_outside_update_box(FloatPoint p_1,
FloatPoint p_2, double p_update_offset, IntBox p_update_box)
{
if (p_1 == null || p_2 == null)
{
return true;
}
if (Math.max(p_1.x, p_2.x) < p_update_box.ll.x - p_update_offset)
{
return true;
}
if (Math.max(p_1.y, p_2.y) < p_update_box.ll.y - p_update_offset )
{
return true;
}
if (Math.min(p_1.x, p_2.x) > p_update_box.ur.x + p_update_offset)
{
return true;
}
if (Math.min(p_1.y, p_2.y) > p_update_box.ur.y + p_update_offset)
{
return true;
}
return false;
}
示例6: join
import geometry.planar.IntBox; //導入依賴的package包/類
public void join(IntBox p_box, int p_layer)
{
if (p_layer == 0)
{
component_side_box = component_side_box.union(p_box);
component_side_box_is_empty = false;
}
else if (p_layer == layer_count - 1)
{
solder_side_box =solder_side_box.union(p_box);
solder_side_box_is_empty = false;
}
else
{
inner_side_box = inner_side_box.union(p_box);
inner_side_box_is_empty = false;
}
box_is_empty = false;
}
示例7: insert_incomplete_room
import geometry.planar.IntBox; //導入依賴的package包/類
private void insert_incomplete_room(AutorouteEngine p_autoroute_engine, int p_ll_x, int p_ll_y, int p_ur_x, int p_ur_y)
{
IntBox new_incomplete_room_shape = new IntBox(p_ll_x, p_ll_y, p_ur_x, p_ur_y);
if (new_incomplete_room_shape.dimension() == 2)
{
IntBox new_contained_shape = this.room_shape.intersection(new_incomplete_room_shape);
if (!new_contained_shape.is_empty())
{
int door_dimension = new_incomplete_room_shape.intersection(this.room_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);
}
}
}
}
示例8: get_graphics_update_rectangle
import geometry.planar.IntBox; //導入依賴的package包/類
/**
* Gets a surrounding rectangle of the area, where an update of the
* graphics is needed caused by the previous interactive actions.
*/
Rectangle2D get_graphics_update_rectangle()
{
Rectangle2D result;
IntBox update_box = board.get_graphics_update_box();
if (update_box == null || update_box.is_empty())
{
result = new Rectangle2D.Double(0, 0, 0, 0);
}
else
{
IntBox offset_box = update_box.offset(board.get_max_trace_half_width());
result = graphics_context.coordinate_transform.board_to_screen(offset_box);
}
return result;
}
示例9: get_graphics_update_rectangle
import geometry.planar.IntBox; //導入依賴的package包/類
/**
* Gets a surrounding rectangle of the area, where an update of the
* graphics is needed caused by the previous interactive actions.
*/
Rectangle get_graphics_update_rectangle()
{
Rectangle result;
IntBox update_box = board.get_graphics_update_box();
if (update_box == null || update_box.is_empty())
{
result = new Rectangle(0, 0, 0, 0);
}
else
{
IntBox offset_box = update_box.offset(board.get_max_trace_half_width());
result = graphics_context.coordinate_transform.board_to_screen(offset_box);
}
return result;
}
示例10: divide_large_room
import geometry.planar.IntBox; //導入依賴的package包/類
/**
* Makes shure that on each layer there will be more than 1 IncompleteFreeSpaceExpansionRoom,
* even if there are no objects on the layer. Otherwise the maze search algprithm gets problems
* with vias.
*/
protected Collection<IncompleteFreeSpaceExpansionRoom> divide_large_room(
Collection<IncompleteFreeSpaceExpansionRoom> p_room_list, IntBox p_board_bounding_box)
{
if (p_room_list.size() != 1)
{
return p_room_list;
}
IncompleteFreeSpaceExpansionRoom curr_room = p_room_list.iterator().next();
IntBox room_bounding_box = curr_room.get_shape().bounding_box();
if (2 * room_bounding_box.height() <= p_board_bounding_box.height() || 2 * room_bounding_box.width() <= p_board_bounding_box.width())
{
return p_room_list;
}
double max_section_width = 0.5 * Math.max(p_board_bounding_box.height(), p_board_bounding_box.width());
TileShape[] section_arr = curr_room.get_shape().divide_into_sections(max_section_width);
Collection<IncompleteFreeSpaceExpansionRoom> result = new LinkedList<IncompleteFreeSpaceExpansionRoom>();
for (TileShape curr_section : section_arr)
{
TileShape curr_shape_to_be_contained = curr_section.intersection(curr_room.get_contained_shape());
IncompleteFreeSpaceExpansionRoom curr_section_room =
new IncompleteFreeSpaceExpansionRoom(curr_section, curr_room.get_layer(),
curr_shape_to_be_contained);
result.add(curr_section_room);
}
return result;
}
示例11: get_bounding_box
import geometry.planar.IntBox; //導入依賴的package包/類
/**
* Returns a box containing all items in p_item_list.
*/
public IntBox get_bounding_box(Collection<Item> p_item_list)
{
IntBox result = IntBox.EMPTY;
for (Item curr_item : p_item_list)
{
result = result.union(curr_item.bounding_box());
}
return result;
}
示例12: join_graphics_update_box
import geometry.planar.IntBox; //導入依賴的package包/類
/**
* enlarges the graphics update box, so that it contains p_box
*/
public void join_graphics_update_box(IntBox p_box)
{
if (update_box == null)
{
reset_graphics_update_box();
}
update_box = update_box.union(p_box);
}
示例13: bounding_box
import geometry.planar.IntBox; //導入依賴的package包/類
public IntBox bounding_box()
{
IntBox result = IntBox.EMPTY;
for (PolylineShape curr_shape : this.shapes)
{
result = result.union(curr_shape.bounding_box());
}
return result;
}
示例14: calculate_tree_shapes
import geometry.planar.IntBox; //導入依賴的package包/類
TileShape[] calculate_tree_shapes(DrillItem p_drill_item)
{
if (this.board == null)
{
return new TileShape[0];
}
TileShape[] result = new TileShape [p_drill_item.tile_shape_count()];
for (int i = 0; i < result.length; ++i)
{
Shape curr_shape = p_drill_item.get_shape(i);
if (curr_shape == null)
{
result[i] = null;
}
else
{
IntBox curr_tile_shape = curr_shape.bounding_box();
int offset_width = this.clearance_compensation_value(p_drill_item.clearance_class_no(), p_drill_item.shape_layer(i));
if (curr_tile_shape == null)
{
System.out.println("BoxShapeSearchTree.calculate_tree_shapes: shape is null");
}
else
{
curr_tile_shape = curr_tile_shape.offset(offset_width);
}
result [i] = curr_tile_shape;
}
}
return result;
}
示例15: bounding_box
import geometry.planar.IntBox; //導入依賴的package包/類
public IntBox bounding_box()
{
IntBox result = IntBox.EMPTY;
for (int i = 0; i < tile_shape_count(); ++i)
{
Shape curr_shape = this.get_shape(i);
if (curr_shape != null)
{
result = result.union(curr_shape.bounding_box());
}
}
return result;
}