1
/****************************************************************************
3
** This file is part of the LibreCAD project, a 2D CAD program
5
** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)
6
** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
9
** This file may be distributed and/or modified under the terms of the
10
** GNU General Public License version 2 as published by the Free Software
11
** Foundation and appearing in the file gpl-2.0.txt included in the
12
** packaging of this file.
14
** This program is distributed in the hope that it will be useful,
15
** but WITHOUT ANY WARRANTY; without even the implied warranty of
16
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
** GNU General Public License for more details.
19
** You should have received a copy of the GNU General Public License
20
** along with this program; if not, write to the Free Software
21
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
** This copyright notice MUST APPEAR in all copies of the script!
25
**********************************************************************/
27
#ifndef RS_SELECTION_H
28
#define RS_SELECTION_H
30
#include "rs_entitycontainer.h"
31
#include "rs_graphicview.h"
36
* API Class for selecting entities.
37
* There's no interaction handled in this class.
38
* This class is connected to an entity container and
39
* can be connected to a graphic view.
41
* @author Andrew Mustun
45
RS_Selection(RS_EntityContainer& entityContainer,
46
RS_GraphicView* graphicView=NULL);
48
void selectSingle(RS_Entity* e);
49
void selectAll(bool select=true);
53
void invertSelection();
54
void selectWindow(const RS_Vector& v1, const RS_Vector& v2,
55
bool select=true, bool cross=false);
56
void deselectWindow(const RS_Vector& v1, const RS_Vector& v2) {
57
selectWindow(v1, v2, false);
59
void selectIntersected(const RS_Vector& v1, const RS_Vector& v2,
61
void deselectIntersected(const RS_Vector& v1, const RS_Vector& v2) {
62
selectIntersected(v1, v2, false);
64
void selectContour(RS_Entity* e);
66
void selectLayer(RS_Entity* e);
67
void selectLayer(const QString& layerName, bool select=true);
68
void deselectLayer(QString& layerName) {
69
selectLayer(layerName, false);
73
RS_EntityContainer* container;
75
RS_GraphicView* graphicView;