KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ratsnest_view_item.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) 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
31#ifndef RATSNEST_VIEW_ITEM_H
32#define RATSNEST_VIEW_ITEM_H
33
34#include <memory>
35#include <eda_item.h>
36#include <math/vector2d.h>
37
38class GAL;
40
41
43{
44public:
45 RATSNEST_VIEW_ITEM( std::shared_ptr<CONNECTIVITY_DATA> aData );
46
48 const BOX2I ViewBBox() const override;
49
51 void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override;
52
54 void ViewGetLayers( int aLayers[], int& aCount ) const override;
55
56 bool HitTest( const VECTOR2I& aPoint, int aAccuracy = 0 ) const override
57 {
58 return false; // Not selectable
59 }
60
61#if defined(DEBUG)
63 void Show( int x, std::ostream& st ) const override { }
64#endif
65
66 virtual wxString GetClass() const override
67 {
68 return wxT( "RATSNEST_VIEW_ITEM" );
69 }
70
71protected:
72 std::shared_ptr<CONNECTIVITY_DATA> m_data;
73};
74
75
76#endif /* RATSNEST_VIEW_ITEM_H */
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:88
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
const BOX2I ViewBBox() const override
std::shared_ptr< CONNECTIVITY_DATA > m_data
Object containing ratsnest data.
void ViewGetLayers(int aLayers[], int &aCount) const override
bool HitTest(const VECTOR2I &aPoint, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
virtual wxString GetClass() const override
Return the class name.
void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override