X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.scenegraph%2Fsrc%2Fcom%2Finfomatiq%2Fjsi%2FPoint.java;h=3664bc7c0dcb119c98203556c601f5a4a5cec1c0;hb=2e21c89c81d449bcc2301b3cf3cce4f2cd403a60;hp=929b8314b833d76b2c1daec8407a3a6b2fae79f3;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scenegraph/src/com/infomatiq/jsi/Point.java b/bundles/org.simantics.scenegraph/src/com/infomatiq/jsi/Point.java index 929b8314b..3664bc7c0 100644 --- a/bundles/org.simantics.scenegraph/src/com/infomatiq/jsi/Point.java +++ b/bundles/org.simantics.scenegraph/src/com/infomatiq/jsi/Point.java @@ -1,72 +1,72 @@ -// Point.java -// Java Spatial Index Library -// Copyright (C) 2002-2005 Infomatiq Limited. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -package com.infomatiq.jsi; - -/** - * Currently hardcoded to 2 dimensions, but could be extended. - * - * @author aled@sourceforge.net - * @version 1.0b8 - */ -public class Point { - /** - * The (x, y) coordinates of the point. - */ - public float x, y; - - /** - * Constructor. - * - * @param x The x coordinate of the point - * @param y The y coordinate of the point - */ - public Point(float x, float y) { - this.x = x; - this.y = y; - } - - /** - * Copy from another point into this one - */ - public void set(Point other) { - x = other.x; - y = other.y; - } - - /** - * Print as a string in format "(x, y)" - */ - public String toString() { - return "(" + x + ", " + y + ")"; - } - - /** - * @return X coordinate rounded to an int - */ - public int xInt() { - return (int) Math.round(x); - } - - /** - * @return Y coordinate rounded to an int - */ - public int yInt() { - return (int) Math.round(y); - } -} +// Point.java +// Java Spatial Index Library +// Copyright (C) 2002-2005 Infomatiq Limited. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +package com.infomatiq.jsi; + +/** + * Currently hardcoded to 2 dimensions, but could be extended. + * + * @author aled@sourceforge.net + * @version 1.0b8 + */ +public class Point { + /** + * The (x, y) coordinates of the point. + */ + public float x, y; + + /** + * Constructor. + * + * @param x The x coordinate of the point + * @param y The y coordinate of the point + */ + public Point(float x, float y) { + this.x = x; + this.y = y; + } + + /** + * Copy from another point into this one + */ + public void set(Point other) { + x = other.x; + y = other.y; + } + + /** + * Print as a string in format "(x, y)" + */ + public String toString() { + return "(" + x + ", " + y + ")"; + } + + /** + * @return X coordinate rounded to an int + */ + public int xInt() { + return (int) Math.round(x); + } + + /** + * @return Y coordinate rounded to an int + */ + public int yInt() { + return (int) Math.round(y); + } +}