| /******************************************************************************* |
| * Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Pierre Allard, |
| * Regent L'Archeveque - initial API and implementation |
| * |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.core.environment.surface.impl; |
| |
| import org.eclipse.apogy.common.math.ApogyCommonMathFacade; |
| import org.eclipse.apogy.common.math.Tuple3d; |
| |
| public class RectangularRegionCustomImpl extends RectangularRegionImpl { |
| |
| @Override |
| public double getXDimension() { |
| return getXMax() - getXMin(); |
| } |
| |
| @Override |
| public double getYDimension() { |
| return getYMax() - getYMin(); |
| } |
| |
| @Override |
| public Tuple3d getLowerLeftCorner() { |
| if (this.lowerLeftCorner == null) { |
| this.lowerLeftCorner = ApogyCommonMathFacade.INSTANCE.createTuple3d(getXMin(), getYMin(), 0); |
| } |
| |
| return this.lowerLeftCorner; |
| } |
| |
| @Override |
| public Tuple3d getUpperLeftCorner() { |
| if (this.upperLeftCorner == null) { |
| this.upperLeftCorner = ApogyCommonMathFacade.INSTANCE.createTuple3d(getXMin(), getYMax(), 0); |
| } |
| return this.upperLeftCorner; |
| } |
| |
| @Override |
| public Tuple3d getLowerRightCorner() { |
| if (this.lowerRightCorner == null) { |
| this.lowerRightCorner = ApogyCommonMathFacade.INSTANCE.createTuple3d(getXMax(), getYMin(), 0); |
| } |
| return this.lowerRightCorner; |
| } |
| |
| @Override |
| public Tuple3d getUpperRightCorner() { |
| if (this.upperRightCorner == null) { |
| this.upperRightCorner = ApogyCommonMathFacade.INSTANCE.createTuple3d(getXMax(), getYMax(), 0); |
| } |
| return this.upperRightCorner; |
| } |
| |
| } // RectangularRegionImpl |