Source: raytracer/lightlist.h


Annotated List
Files
Globals
Hierarchy
Index
/* *************************************************************************
                          lightlist.h  -  description
                             -------------------
    begin                : Wed Oct 16 2002    
    copyright            : (C) 2002 by Micha Riser
    email                : mriser@gmx.net
 ************************************************************************* */

/* *************************************************************************
 *                                                                         *
 *   This program 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.                                   *
 *                                                                         *
 ************************************************************************* */

#ifndef LIGHTLIST_H
#define LIGHTLIST_H

#include "colour.h"

class LightSource;

/**List of lights shining to a certain point. Returned by LightCache lookups.
  *@author Micha Riser
  */  
class LightList {
public: // Public attributes
    Colour3 colour;
    LightSource* light;
    LightList* next;

public: // Constructor and destructor
    LightList(const Colour3& c, LightSource* l, LightList* n):
      colour(c), light(l), next(n) {}
  
    ~LightList() {delete(next);}

private:
    LightList(const LightList& l):colour(l.colour), light(l.light), next(l.next) {};
    LightList& operator=(const LightList&);

public: // Static methods
    /**Add the lights from the second light list to the first one. The lights'
      *colours of the second list are weightend by weight before adding to the
      *first one.
      *@param first First light list. May be 0.
      *@param second Second light list. May be 0.
      */
    static LightList* merge(LightList* first, const LightList* second, DBL weight);
    
};

#endif

Generated by: micha@laptop on Thu Oct 24 20:25:24 2002, using kdoc 2.0a53.