2020-08-31 14:11:54 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2020-10-01 21:21:10 +00:00
|
|
|
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
2020-08-31 14:11:54 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file sch_iref.h
|
|
|
|
* @brief Definitions of the SCH_IREF class and derivatives for Eeschema.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CLASS_IREF_H
|
|
|
|
#define CLASS_IREF_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <macros.h>
|
2020-10-01 21:21:10 +00:00
|
|
|
#include <sch_text.h>
|
2020-08-31 14:11:54 +00:00
|
|
|
|
|
|
|
class SCH_GLOBALLABEL;
|
|
|
|
|
|
|
|
class SCH_IREF : public SCH_TEXT
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SCH_IREF( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
|
2020-10-05 10:54:37 +00:00
|
|
|
SCH_GLOBALLABEL* aParent = nullptr );
|
2020-08-31 14:11:54 +00:00
|
|
|
|
|
|
|
~SCH_IREF() { }
|
|
|
|
|
|
|
|
static inline bool ClassOf( const EDA_ITEM* aItem )
|
|
|
|
{
|
|
|
|
return aItem && SCH_IREF_T == aItem->Type();
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString GetClass() const override
|
|
|
|
{
|
|
|
|
return wxT( "SCH_IREF" );
|
|
|
|
}
|
|
|
|
|
|
|
|
EDA_ITEM* Clone() const override;
|
|
|
|
|
|
|
|
std::vector<int>* GetRefTable() { return &m_refTable; }
|
|
|
|
|
|
|
|
bool IsDangling() const override { return false; }
|
|
|
|
|
|
|
|
void CopyParentStyle();
|
|
|
|
void PlaceAtDefaultPosition();
|
|
|
|
|
|
|
|
wxPoint GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const override;
|
|
|
|
|
2020-10-03 20:40:36 +00:00
|
|
|
SCH_GLOBALLABEL* GetParentLabel() { return m_parentLabel; }
|
2020-08-31 14:11:54 +00:00
|
|
|
|
2020-10-03 20:40:36 +00:00
|
|
|
void SetParentLabel( SCH_GLOBALLABEL* parent ) { m_parentLabel = parent; }
|
2020-08-31 14:11:54 +00:00
|
|
|
|
|
|
|
SCH_SCREEN* GetScreen() { return m_screen; }
|
|
|
|
|
|
|
|
void SetScreen( SCH_SCREEN* screen ) { m_screen = screen; }
|
|
|
|
|
2020-10-02 20:18:07 +00:00
|
|
|
void BuildHypertextMenu( wxMenu* aMenu );
|
|
|
|
|
2020-08-31 14:11:54 +00:00
|
|
|
private:
|
|
|
|
void SetIrefOrientation( LABEL_SPIN_STYLE aSpinStyle );
|
|
|
|
|
2020-10-01 21:21:10 +00:00
|
|
|
// We create a different set parent function for this class, so we hide
|
|
|
|
// the inherited one.
|
|
|
|
using EDA_ITEM::SetParent;
|
|
|
|
|
2020-08-31 14:11:54 +00:00
|
|
|
std::vector<int> m_refTable;
|
2020-10-03 20:40:36 +00:00
|
|
|
SCH_GLOBALLABEL* m_parentLabel;
|
2020-08-31 14:11:54 +00:00
|
|
|
SCH_SCREEN* m_screen;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|