2024-04-02 18:28:17 +01:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <symbol.h>
|
|
|
|
|
|
|
|
|
2024-11-21 13:18:36 -08:00
|
|
|
std::vector<int> SYMBOL::ViewGetLayers() const
|
2024-04-02 18:28:17 +01:00
|
|
|
{
|
2024-11-21 13:18:36 -08:00
|
|
|
// Pins and op point currents are drawn by their parent symbol,
|
|
|
|
// so the parent must draw to LAYER_DANGLING and LAYER_OP_CURRENTS
|
2024-04-02 18:28:17 +01:00
|
|
|
if( Type() == SCH_SYMBOL_T )
|
2025-01-01 19:44:46 +00:00
|
|
|
return { LAYER_DANGLING, LAYER_OP_CURRENTS, LAYER_DEVICE,
|
|
|
|
LAYER_REFERENCEPART, LAYER_VALUEPART, LAYER_FIELDS,
|
|
|
|
LAYER_DEVICE_BACKGROUND, LAYER_SHAPES_BACKGROUND, LAYER_NOTES_BACKGROUND,
|
|
|
|
LAYER_SELECTION_SHADOWS };
|
2024-04-02 18:28:17 +01:00
|
|
|
|
2024-11-21 13:18:36 -08:00
|
|
|
// Library symbols must include LAYER_PRIVATE_NOTES
|
2024-04-02 18:28:17 +01:00
|
|
|
if( Type() == LIB_SYMBOL_T )
|
2025-01-01 19:44:46 +00:00
|
|
|
return { LAYER_DEVICE,
|
|
|
|
LAYER_REFERENCEPART,
|
|
|
|
LAYER_VALUEPART,
|
|
|
|
LAYER_FIELDS,
|
|
|
|
LAYER_PRIVATE_NOTES,
|
|
|
|
LAYER_DEVICE_BACKGROUND,
|
|
|
|
LAYER_SHAPES_BACKGROUND,
|
|
|
|
LAYER_NOTES_BACKGROUND,
|
|
|
|
LAYER_SELECTION_SHADOWS };
|
2024-11-21 13:18:36 -08:00
|
|
|
|
|
|
|
// This should never happen but if it does, return a reasonable default
|
|
|
|
return { LAYER_DEVICE, LAYER_REFERENCEPART, LAYER_VALUEPART,
|
2025-01-01 19:44:46 +00:00
|
|
|
LAYER_FIELDS, LAYER_DEVICE_BACKGROUND, LAYER_SHAPES_BACKGROUND,
|
|
|
|
LAYER_NOTES_BACKGROUND, LAYER_SELECTION_SHADOWS };
|
2024-04-02 18:28:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|