intersection.java

来自「world wind java sdk 源码」· Java 代码 · 共 84 行

JAVA
84
字号
/*Copyright (C) 2001, 2006 United States Governmentas represented by the Administrator of theNational Aeronautics and Space Administration.All Rights Reserved.*/package gov.nasa.worldwind.geom;import gov.nasa.worldwind.util.Logging;/** * @author Tom Gaskins * @version $Id: Intersection.java 2471 2007-07-31 21:50:57Z tgaskins $ */public final class Intersection // Instances are immutable{    private final Vec4 intersectionPoint;    private final boolean isTangent;    /**     * @param intersectionPoint     * @param isTangent     * @throws IllegalArgumentException if <code>intersectionpoint</code> is null     */    public Intersection(Vec4 intersectionPoint, boolean isTangent)    {        if (intersectionPoint == null)        {            String message = Logging.getMessage("nullValue.IntersectionPointIsNull");            Logging.logger().severe(message);            throw new IllegalArgumentException(message);        }        this.intersectionPoint = intersectionPoint;        this.isTangent = isTangent;    }    public final Vec4 getIntersectionPoint()    {        return intersectionPoint;    }    public final boolean isTangent()    {        return isTangent;    }    @Override    public boolean equals(Object o)    {        if (this == o)            return true;        if (o == null || getClass() != o.getClass())            return false;        final gov.nasa.worldwind.geom.Intersection that = (gov.nasa.worldwind.geom.Intersection) o;        if (isTangent != that.isTangent)            return false;        //noinspection RedundantIfStatement        if (!intersectionPoint.equals(that.intersectionPoint))            return false;        return true;    }    @Override    public int hashCode()    {        int result;        result = intersectionPoint.hashCode();        result = 29 * result + (isTangent ? 1 : 0);        return result;    }    @Override    public String toString()    {        String pt = "Intersection Point: " + this.intersectionPoint;        String tang = this.isTangent ? " is a tangent." : " not a tangent";        return pt + tang;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?