/* ColoredSquareSectorVob.java * * Copyright (c) 1999-2002, Ted Nelson and Tuomas Lukka * * This file is part of Gzz. * * Gzz 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. * * Gzz 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 Gzz; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * */ /* * Written by Tuomas Lukka, Tero Mäyränen and Asko Soukka */ package gzz.vob.vobs; import gzz.vob.*; import gzz.*; import gzz.util.*; import gzz.errors.*; import gzz.vob.*; import gzz.client.*; import gzz.gfx.gl.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.lang.Math; import gzz.client.GraphicsAPI; /** A vob with a square background and frame, but colors * drawn as sectors. */ public class ColoredSquareSectorVob extends ColoredSectorVob { public static final String rcsid = "$Id: ColoredSquareSectorVob.java,v 1.1 2003/03/04 16:38:44 humppake Exp $"; public ColoredSquareSectorVob() { super(90, 360, 10); start = 90; sector = 360; step = 10; } public void render(Graphics g, boolean fast, Vob.RenderInfo info1, Vob.RenderInfo info2) { info1.getExtRect(rect); int mx = rect.x, my=rect.y, mw = rect.width, mh = rect.height; Color oldfg = g.getColor(); g.setColor(info1.getBgColor()); if (mh > 14) g.fillRect(mx-2, my-2, mw+4, mh+4); else g.fillRect(mx-1, my-1, mw+2, mh+2); if(nsolids == 0) { g.setColor(bg); g.fillRect(mx, my, mw, mh); } else { g.clipRect(mx-1, my-1, mw+2, mh+2); int arc = sector / nsolids; int r = (int)Math.sqrt((mw/2)*(mw/2) + (mh/2)*(mh/2)); for(int i=0; i= 14) { g.drawRect(mx+1, my+1, mw-3, mh-3); } } g.setColor(oldfg); } public int putGL(VobScene vs, int coordsys1) { if(dbg) pa("Addtolistgl coloredsectorvob "+coordsys1); if(glList == null) { if (!circleGLReady) prepareCircleGL(); String bgcall = ""; if(nsolids > 0) { int arc = sector / nsolids; for(int i=0; i