00001 /* ************************************************************************* 00002 lightlist.h - description 00003 ------------------- 00004 begin : Wed Oct 16 2002 00005 copyright : (C) 2002 by Micha Riser 00006 email : mriser@gmx.net 00007 00008 $Id: lightlist_8h-source.html,v 1.1 2005/02/04 21:02:27 micha Exp $ 00009 00010 ************************************************************************* */ 00011 00012 /* ************************************************************************* 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 ************************************************************************* */ 00020 00021 #ifndef LIGHTLIST_H 00022 #define LIGHTLIST_H 00023 00024 #include "colour.h" 00025 #include <cassert> 00026 00027 class LightSource; 00028 00032 class LightList { 00033 00034 public: // Constructor and destructor 00035 LightList(const Colour& c, LightSource* l, LightList* n): 00036 colour(c), light(l), next(n) { 00037 00038 assert( next==0 || light>next->light ); 00039 00040 } 00041 00042 ~LightList() {delete(next);} 00043 00044 private: 00045 LightList(const LightList& l):colour(l.colour), light(l.light), next(l.next) {}; 00046 LightList& operator=(const LightList&); 00047 00048 public: // Public attributes 00049 00050 /* Store "higher" light sources at the front of the list, so 00051 * invariant is: light > next->light 00052 * *change me* make those things private and provide an iterator through it 00053 */ 00054 Colour colour; 00055 LightSource* light; 00056 LightList* next; 00057 00058 public: // Static methods 00065 static LightList* merge(LightList* first, const LightList* second, CLR weight); 00066 00069 static CLR calculateLightListDifference(const LightList& l1, const LightList& l2); 00070 00071 }; 00072 00073 #endif
1.3.8