KiCad PCB EDA Suite
Loading...
Searching...
No Matches
router_status_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) 2024 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef ROUTER_STATUS_VIEW_ITEM_H
25#define ROUTER_STATUS_VIEW_ITEM_H
26
27#include <cstdio>
28
29#include <view/view.h>
30#include <view/view_item.h>
31#include <view/view_group.h>
32
33#include <math/vector2d.h>
34#include <math/box2.h>
35
38
39#include <gal/color4d.h>
40
41#include <eda_item.h>
42
43
45{
46public:
48 EDA_ITEM( NOT_USED ) // Never added to anything - just a preview
49 { }
50
51 wxString GetClass() const override { return wxT( "ROUTER_STATUS" ); }
52
53#if defined(DEBUG)
54 void Show( int nestLevel, std::ostream& os ) const override {}
55#endif
56
57 VECTOR2I GetPosition() const override { return m_pos; }
58 void SetPosition( const VECTOR2I& aPos ) override { m_pos = aPos; };
59
60 void SetMessage( const wxString& aStatus )
61 {
62 m_status = aStatus;
63 }
64
65 void SetHint( const wxString& aHint )
66 {
67 m_hint = aHint;
68 }
69
70 const BOX2I ViewBBox() const override;
71 void ViewGetLayers( int aLayers[], int& aCount ) const override;
72 void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override;
73
74protected:
76 wxString m_status;
77 wxString m_hint;
78};
79
80
81
82#endif // ROUTER_STATUS_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
void SetMessage(const wxString &aStatus)
void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override
Draw the parts of the object belonging to layer aLayer.
wxString GetClass() const override
Return the class name.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void SetHint(const wxString &aHint)
void SetPosition(const VECTOR2I &aPos) override
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
VECTOR2I GetPosition() const override
@ NOT_USED
the 3d code uses this value
Definition: typeinfo.h:79