selection_area.h 1.89 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2013 CERN
 * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
 *
 * 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.
 *
 * 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, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

#ifndef __SELECTION_AREA_H
#define __SELECTION_AREA_H

#include <base_struct.h>
29
#include <layers_id_colors_and_visibility.h>
Maciej Suminski's avatar
Maciej Suminski committed
30 31
#include <math/box2.h>

32
namespace KIGFX
Maciej Suminski's avatar
Maciej Suminski committed
33 34 35
{
class GAL;
}
36 37 38 39 40 41 42 43

/**
 * Class SELECTION_AREA
 *
 * Represents a selection area (currently a rectangle) in a VIEW.
 */
class SELECTION_AREA : public EDA_ITEM
{
Maciej Suminski's avatar
Maciej Suminski committed
44
public:
45
    static const int SelectionLayer = ITEM_GAL_LAYER( GP_OVERLAY );
46

Maciej Suminski's avatar
Maciej Suminski committed
47 48
    SELECTION_AREA();
    ~SELECTION_AREA() {};
49

Maciej Suminski's avatar
Maciej Suminski committed
50
    virtual const BOX2I ViewBBox() const;
51

52
    void ViewDraw( int aLayer, KIGFX::GAL* aGal ) const;
53

Maciej Suminski's avatar
Maciej Suminski committed
54
    void ViewGetLayers( int aLayers[], int& aCount ) const;
55

56
    void SetOrigin( VECTOR2I aOrigin )
Maciej Suminski's avatar
Maciej Suminski committed
57 58 59
    {
        m_origin = aOrigin;
    }
60

61
    void SetEnd( VECTOR2I aEnd )
Maciej Suminski's avatar
Maciej Suminski committed
62 63 64
    {
        m_end = aEnd;
    }
65

66
    void Show( int x, std::ostream& st ) const
Maciej Suminski's avatar
Maciej Suminski committed
67 68
    {
    }
69

Maciej Suminski's avatar
Maciej Suminski committed
70 71
private:
    VECTOR2I m_origin, m_end;
72 73 74
};

#endif