ShaderGroup::~ShaderGroup ()
{
#if 0
    if (m_layers.size()) {
        ustring name = m_layers.back()->layername();
        std::cerr << "Shader group " << this 
                  << " id #" << m_layers.back()->id() << " (" 
                  << (name.c_str() ? name.c_str() : "<unnamed>")
                  << ") executed on " << executions() << " points\n";
    } else {
        std::cerr << "Shader group " << this << " (no layers?) " 
                  << "executed on " << executions() << " points\n";
    }
#endif
}
DynamicList<scalar> liggghtsCommandModel::executionsWithinPeriod(scalar TSstart,scalar TSend)
{
    Info << "liggghtsCommandModel::executionsWithinPeriod TSstart" << TSstart << endl;
    Info << "liggghtsCommandModel::executionsWithinPeriod TSend" << TSend << endl;
    Info << "startTime =" << startTime_ << endl;
    Info << "endTime =" << endTime_ << endl;

    // init exec times array
    DynamicList<scalar> executions(0);

    // current TS within active period
    if(startTime_+SMALL<TSend && endTime_>TSstart-SMALL )
    {
        Info << "working time within this TS" << endl;

        // find first execution within TS (better routine with modulo)
        int startNr = 0;
        scalar t = startTime_ + startNr * timeInterval_;

        if(timeInterval_ > SMALL)
        {
            while (TSend - t > SMALL)
            {
                t = startTime_ + startNr * timeInterval_;
                startNr++;
            }
            t -= timeInterval_;
        }
        // check if first exec found within TS
        if(TSstart < t + SMALL && t +SMALL < TSend)
        {
            // check for more executions
            while (t < endTime_ + SMALL && TSend - t > SMALL)
            {
                executions.append(t);
                t += timeInterval_;
            }
        }
        //else
        //    Info << "liggghtsCommandModel::executionsWithinPeriod error???" << endl;     

        // debug
        Info << "liggghtsCommandModel::executionsWithinPeriod executions=" << executions << endl;
    }

    // return dummy

    return executions;
}