/* -*- C++ -*- * Copyright ©2008 Hugo Mills * * This software is distributed under the terms of the GNU GPL v3 * For more information on the GPL, see the file COPYING or * visit http://www.gnu.org/ * * This software is distributed without warranty */ #ifndef CONTENT_TERMINATOR_H #define CONTENT_TERMINATOR_H #include #include "magellan/configlexer.h" #include "magellan/content.h" #include "magellan/xforbit.h" class Content_Terminator : public Content { public: Content_Terminator(); virtual ~Content_Terminator(); static Content* parse( ConfigLexer* lex, const std::string& type, const std::string& subtype ); virtual void plot(Output*, XfView*, XfMap*, XfOrbit*, XfSphere*); virtual bool isbound(void) const; virtual Plugin* bind(Configuration*); private: Content* day; Content* night; XfOrbit* sunpos; int blend; double bwidth; void blendcolours(ivec3& result, const ivec3& day, const ivec3& night, double darkness) const; typedef double (Content_Terminator::*DarkFunction)(double) const; static DarkFunction darkfns[]; double dfn_linear(double) const; double dfn_quadratic(double) const; double dfn_normal(double) const; }; #endif