本文整理汇总了Java中geometry.planar.Limits类的典型用法代码示例。如果您正苦于以下问题:Java Limits类的具体用法?Java Limits怎么用?Java Limits使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Limits类属于geometry.planar包,在下文中一共展示了Limits类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remove_border_line
import geometry.planar.Limits; //导入依赖的package包/类
private static IntBox remove_border_line( IntBox p_room_box, int p_remove_edge_no)
{
IntBox result;
if (p_remove_edge_no == 0)
{
result = new IntBox(p_room_box.ll.x, -Limits.CRIT_INT, p_room_box.ur.x, p_room_box.ur.y);
}
else if (p_remove_edge_no == 1)
{
result = new IntBox(p_room_box.ll.x, p_room_box.ll.y, Limits.CRIT_INT, p_room_box.ur.y);
}
else if (p_remove_edge_no == 2)
{
result = new IntBox(p_room_box.ll.x, p_room_box.ll.y, p_room_box.ur.x, Limits.CRIT_INT);
}
else if (p_remove_edge_no == 3)
{
result = new IntBox(-Limits.CRIT_INT, p_room_box.ll.y, p_room_box.ur.x, p_room_box.ur.y);
}
else
{
System.out.println("SortedOrthogonalRoomNeighbours.remove_border_line: illegal p_remove_edge_no");
result = null;
}
return result;
}
示例2: CoordinateTransform
import geometry.planar.Limits; //导入依赖的package包/类
public CoordinateTransform(IntBox p_design_box, Dimension p_panel_bounds )
{
this.screen_bounds = p_panel_bounds;
this.design_box = p_design_box;
this.rotation_pole = p_design_box.centre_of_gravity();
int min_ll = Math.min(p_design_box.ll.x, p_design_box.ll.y);
int max_ur = Math.max(p_design_box.ur.x, p_design_box.ur.y);
if (Math.max(Math.abs(min_ll), Math.abs(max_ur)) <= 0.3 * Limits.CRIT_INT)
{
// create an offset to p_design_box to enable deep zoom out
double design_offset = Math.max(p_design_box.width(), p_design_box.height());
design_box_with_offset = p_design_box.offset(design_offset);
}
else
{
// no offset because of danger of integer overflow
design_box_with_offset = p_design_box;
}
double x_scale_factor = screen_bounds.getWidth()/design_box_with_offset.width();
double y_scale_factor = screen_bounds.getHeight()/design_box_with_offset.height();
scale_factor = Math.min(x_scale_factor, y_scale_factor) ;
display_x_offset = scale_factor * design_box_with_offset.ll.x;
display_y_offset = scale_factor * design_box_with_offset.ll.y ;
}