本文整理汇总了Java中geometry.planar.Area.translate_by方法的典型用法代码示例。如果您正苦于以下问题:Java Area.translate_by方法的具体用法?Java Area.translate_by怎么用?Java Area.translate_by使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geometry.planar.Area
的用法示例。
在下文中一共展示了Area.translate_by方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get_area
import geometry.planar.Area; //导入方法依赖的package包/类
public Area get_area()
{
if (this.precalculated_absolute_area == null)
{
if (this.relative_area == null)
{
System.out.println("ObstacleArea.get_area: area is null");
return null;
}
Area turned_area = this.relative_area;
if (!this.is_front && !this.board.components.get_flip_style_rotate_first())
{
turned_area = turned_area.mirror_vertical(Point.ZERO);
}
if (this.rotation_in_degree != 0)
{
double rotation = this.rotation_in_degree;
if (rotation % 90 == 0)
{
turned_area = turned_area.turn_90_degree(((int) rotation) / 90, Point.ZERO);
}
else
{
turned_area = turned_area.rotate_approx(Math.toRadians(rotation), FloatPoint.ZERO);
}
}
if (!this.is_front && this.board.components.get_flip_style_rotate_first())
{
turned_area = turned_area.mirror_vertical(Point.ZERO);
}
this.precalculated_absolute_area = turned_area.translate_by(this.translation);
}
return this.precalculated_absolute_area;
}
示例2: get_area
import geometry.planar.Area; //导入方法依赖的package包/类
public Area get_area()
{
if (this.precalculated_absolute_area == null)
{
if (this.relative_area == null)
{
System.out.println("ObstacleArea.get_area: area is null");
return null;
}
Area turned_area = this.relative_area;
if (this.side_changed && !this.board.components.get_flip_style_rotate_first())
{
turned_area = turned_area.mirror_vertical(Point.ZERO);
}
if (this.rotation_in_degree != 0)
{
double rotation = this.rotation_in_degree;
if (rotation % 90 == 0)
{
turned_area = turned_area.turn_90_degree(((int) rotation )/ 90, Point.ZERO);
}
else
{
turned_area = turned_area.rotate_approx(Math.toRadians(rotation), FloatPoint.ZERO);
}
}
if (this.side_changed && this.board.components.get_flip_style_rotate_first())
{
turned_area = turned_area.mirror_vertical(Point.ZERO);
}
this.precalculated_absolute_area = turned_area.translate_by(this.translation);
}
return this.precalculated_absolute_area;
}