/*
    Copyright 2013 Lumerical Solutions, Inc. All rights reserved.
*/
#ifndef _STEPINDEX_H
#define _STEPINDEX_H

#include "imaterialplugin.h"

class StepIndexMaterialPlugin: public IMaterialPlugin
{
public:
    StepIndexMaterialPlugin(){};
    virtual ~StepIndexMaterialPlugin(){};

    const char* name() const {return "stepindex";};
    const char* uniqueId() const {return "{4263623D-03FA-41c8-9139-8E05C3D23433}";};
    const char** parameterNames() const {return names;};
    float calculateEx( float U, float V, float Ex, float* storage);
    float calculateEy( float U, float V, float Ey, float* storage);
    float calculateEz( float U, float V, float Ez, float* storage);
    void initialize(const double** parameters, double dt);
    void initializeStorageEx(float* storage){};
    void initializeStorageEy(float* storage){};
    void initializeStorageEz(float* storage){};
    size_t storageSizeE() const {return 1;};

private:
    float calculate(int axis, float U, float V, float E, float* storage);

    float delta_eps[3];
    double time_start;
    double time_stop;
    double time_dt;
    static const char* names[4];
};

#endif

