KiCad PCB EDA Suite
selection_area.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2013 CERN
5  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef PREVIEW_ITEMS_SELECTION_AREA_H
26 #define PREVIEW_ITEMS_SELECTION_AREA_H
27 
29 
30 
31 namespace KIGFX
32 {
33 class GAL;
34 
35 namespace PREVIEW
36 {
37 
47 {
48 public:
49 
51 
52  const BOX2I ViewBBox() const override;
53 
55  void SetOrigin( VECTOR2I aOrigin )
56  {
57  m_origin = aOrigin;
58  }
59 
64  void SetEnd( VECTOR2I aEnd )
65  {
66  m_end = aEnd;
67  }
68 
73  wxString GetClass() const override
74  {
75  return wxT( "SELECTION_AREA" );
76  }
77 
78 private:
79 
83  void drawPreviewShape( KIGFX::GAL& aGal ) const override;
84 
86 };
87 
88 } // PREVIEW
89 } // KIGFX
90 
91 #endif // PREVIEW_ITEMS_SELECTION_AREA_H
void SetEnd(VECTOR2I aEnd)
Set the current end of the rectangle (the corner that moves with the cursor.
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:56
void SetOrigin(VECTOR2I aOrigin)
Set the origin of the rectange (the fixed corner)
SIMPLE_OVERLAY_ITEM is class that represents a visual area drawn on a canvas, used to temporarily dem...
const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers. ...
void drawPreviewShape(KIGFX::GAL &aGal) const override
Draw the selection rectangle onto the GAL.
wxString GetClass() const override
Get class name.
Class SELECTION_AREA.
Class GAL is the abstract interface for drawing on a 2D-surface.