KiCad PCB EDA Suite
Loading...
Searching...
No Matches
view_group.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 * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Maciej Suminski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
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.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 *
26 */
27
32#ifndef VIEW_GROUP_H_
33#define VIEW_GROUP_H_
34
35#include <gal/gal.h>
36#include <view/view_item.h>
37#include <deque>
38
39namespace KIGFX
40{
48{
49public:
50 VIEW_GROUP( VIEW* aView = nullptr );
51 virtual ~VIEW_GROUP();
52
56 virtual unsigned int GetSize() const;
57
61 virtual void Add( VIEW_ITEM* aItem );
62
66 virtual void Remove( VIEW_ITEM* aItem );
67
71 virtual void Clear();
72
73 virtual VIEW_ITEM* GetItem( unsigned int aIdx ) const;
74
78 virtual const BOX2I ViewBBox() const override;
79
86 virtual void ViewDraw( int aLayer, VIEW* aView ) const override;
87
94 virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
95
99 inline virtual void SetLayer( int aLayer )
100 {
101 m_layer = aLayer;
102 }
103
107 void FreeItems();
108
109protected:
110 virtual const std::vector<VIEW_ITEM*> updateDrawList() const;
111
112protected:
114 std::vector<VIEW_ITEM*> m_groupItems;
115};
116
117} // namespace KIGFX
118
119#endif // VIEW_GROUP_H_
Extend VIEW_ITEM by possibility of grouping items into a single object.
Definition: view_group.h:48
std::vector< VIEW_ITEM * > m_groupItems
Definition: view_group.h:114
virtual void SetLayer(int aLayer)
Set layer used to draw the group.
Definition: view_group.h:99
An abstract base class for deriving all objects that can be added to a VIEW.
Definition: view_item.h:84
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
#define GAL_API
Definition: gal.h:28
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247