////////////////////////////////////////////////////////////////////// // // Pixie // // Copyright © 1999 - 2003, Okan Arikan // // Contact: okan@cs.berkeley.edu // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public // License as published by the Free Software Foundation; either // version 2 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 // General Public License for more details. // // You should have received a copy of the GNU 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 // /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // // File : gatherview.h // Classes : CGatherView // Description : The gather cache viewer // //////////////////////////////////////////////////////////////////////// #include #include "photonView.h" #include "./ri/photonMap.h" /////////////////////////////////////////////////////////////////////// // Class : CPhotonView // Method : CPhotonView // Description : Ctor // Return Value : - // Comments : // Date last edited : 1/14/2002 CPhotonView::CPhotonView(FILE *in) : CInterface() { int numPhotons,maxPhotons; vector bmin,bmax; CPhoton *photons; int i; vector mid; float maxDim; fread(&numPhotons,1,sizeof(int),in); fread(&maxPhotons,1,sizeof(int),in); printf("Photons: %d\n",numPhotons); photons = new CPhoton[numPhotons]; fread(photons,numPhotons,sizeof(CPhoton),in); fread(bmin,3,sizeof(float),in); fread(bmax,3,sizeof(float),in); addvv(mid,bmin,bmax); mulvf(mid,(float) 0.5); subvv(bmax,bmin); maxDim = max(bmax[0],bmax[1]); maxDim = max(bmax[2],maxDim); maxDim *= 5; photonList = glGenLists(1); glNewList(photonList,GL_COMPILE); glScalef(1/maxDim,1/maxDim,1/maxDim); glTranslatef(-mid[0],-mid[1],-mid[2]); glBegin(GL_POINTS); for (i=1;i