// conducteö - free software for 2d thermal bridges computation.
// Copyright (C) 2009-2019, Clément MARCEL.
//
// This file is part of conducteö software.
//
// 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 3 of the License,  or
// (at your option) any later version.
//
// This program is  distributed  in  the  hope that it  will be useful,
// but  WITHOUT ANY WARRANTY ;  without even  the  implied  warranty of
// MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR  PURPOSE.  See  the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU  General  Public  License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#ifndef _ARC_H
#define _ARC_H

#include <Entity.h>
#include <Point2d.h>

namespace DxfReader
{

class Arc: public Entity
{

public:

    Arc();
    virtual ~Arc();
    virtual Type getType() const;
    virtual bool containsPoint(double x, double y, double epsilon) const;
    virtual double minimalX() const;
    virtual double minimalY() const;
    virtual double maximalX() const;
    virtual double maximalY() const;

    void setCenter(double x, double y);
    void setRadius(double radius);
    void setBeginAngle(double angle);
    void setEndAngle(double end);

    double xCenter() const;
    double yCenter() const;
    double radius() const;
    double beginAngle() const;
    double endAngle() const;

    virtual std::string toConducteoElement() const;
    
private:

    Point2d ellipsePointAtAngle(double radius, double theta) const;

    double      _xCenter;
    double      _yCenter;
    double      _radius;
    double      _beginAngle;
    double      _endAngle;

};

}

#endif
