/***************************************************************************
                          parabolas.h  -  description
                             -------------------
    begin                : Sam Mai 4 2002
    copyright            : (C) 2002 by Birgit Schulz
    email                : B.Schulz@Superlehrer.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 PARABOLAS_H
#define PARABOLAS_H

#include "ui_ParabolasD.h"
#include "ui_ParabolaInputD.h"
//Added by qt3to4:
#include <QPaintEvent>

class QWidget;

class KPlotWidget;

/**
  *@author Birgit Schulz
  */

class Parabolas : public ParabolasD
{

    Q_OBJECT
public:
    Parabolas(QWidget *parent=0, const char *name=0);

    ~Parabolas();
    enum EFunctions {TurnPoint, AxisSection, ThreePoints, TurnPointAndPoint,
                     Intersect_Parabola_Line, Intersect_Parabola_Parabola};

protected:
    EFunctions m_eSelected;
    double Determinant(double d11,double d12, double d13, double d21, double d22, double d23, double d31, double d32, double d33);
    void clearBoxes();

    virtual void paintEvent( QPaintEvent* );

protected slots:
    void slotCalculate();
    void slotClear();
    void slotShowParabolaAxisSection();
    void slotShowParabola3Points();
    void slotShowParabolaFindTurnPoint();
    void slotShowParabolaPointandTurnPoint();
    void slotShowParabolaLineSection();
    void slotShowParabolaParabola();

    void slotUpdateParabolas();

private:
    void initObjects();
    void allDisconnect();
    KPlotWidget *pw;
    ParabolaInputD *pi;
    double p3_a;
    double p3_b;
    double p3_c;
};

#endif
