/* GLVobCoorder.java * * Copyright (c) 2001-2003, Tuomas Lukka * * This file is part of Libvob. * * Libvob 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 of the License, or * (at your option) any later version. * * Libvob 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 Libvob; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * */ /* * Written by Tuomas J. Lukka */ package org.nongnu.libvob.impl.gl; import org.nongnu.libvob.*; import org.nongnu.libvob.impl.*; import org.nongnu.libvob.gl.*; import java.util.HashMap; /** This is an internal base class for GLVobCoorder. * The generated class GLVobCoorder_Gen inherits from this * and GLVobCoorder proper inherits from that. */ public abstract class GLVobCoorderBase extends AffineVobCoorder { public static final String rcsid = "$Id: GLVobCoorderBase.java,v 1.1 2003/08/05 10:08:09 tjl Exp $"; public static boolean dbg = false; private static void pa(String s) { System.err.println(s); } float[] floats = new float[10000*2]; int nfloats = 0; int[] inds = new int[5000*2]; int ninds = 1; // zero is special (the root) public void activate(int cs) { inds[cs] |= GL.CSFLAG_ACTIVE; } private boolean isActive(int cs) { return (inds[cs] & GL.CSFLAG_ACTIVE) != 0; } public int getCSAt(int parent, float x, float y, float[] targetcoords) { if(dbg) pa("getCSAt "+parent+" "+x+" "+y); int[] inds = GL.getAllCSAt(ninds, this.inds, floats, parent, x, y); if (dbg) { for (int i=0; i