From 6924b98bc355b97e97a8dc0514e1c08bce5fcc9c Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 20 Mar 2021 11:40:34 -0400 Subject: [PATCH] Remove deprecated BRIGHT_BOX preview item --- common/CMakeLists.txt | 1 - common/preview_items/bright_box.cpp | 63 ------------------ include/preview_items/bright_box.h | 100 ---------------------------- pcbnew/CMakeLists.txt | 1 - pcbnew/tools/pcb_bright_box.cpp | 62 ----------------- pcbnew/tools/pcb_bright_box.h | 47 ------------- pcbnew/tools/pcb_selection_tool.cpp | 1 - 7 files changed, 275 deletions(-) delete mode 100644 common/preview_items/bright_box.cpp delete mode 100644 include/preview_items/bright_box.h delete mode 100644 pcbnew/tools/pcb_bright_box.cpp delete mode 100644 pcbnew/tools/pcb_bright_box.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 252d1696ee..7d19f214ce 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -259,7 +259,6 @@ set( COMMON_DRAWING_SHEET_SRCS set( COMMON_PREVIEW_ITEMS_SRCS preview_items/arc_assistant.cpp preview_items/arc_geom_manager.cpp - preview_items/bright_box.cpp preview_items/centreline_rect_item.cpp preview_items/draw_context.cpp preview_items/polygon_geom_manager.cpp diff --git a/common/preview_items/bright_box.cpp b/common/preview_items/bright_box.cpp deleted file mode 100644 index 45359cb438..0000000000 --- a/common/preview_items/bright_box.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2013 CERN - * @author Maciej Suminski - * - * 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 -#include - -using namespace KIGFX; - -const double BRIGHT_BOX::LINE_WIDTH = 10000.0; -const COLOR4D BRIGHT_BOX::BOX_COLOR = KIGFX::COLOR4D( 0.0, 1.0, 0.0, 1.0 ); - -BRIGHT_BOX::BRIGHT_BOX() : - EDA_ITEM( NOT_USED ), // this item is never added to a BOARD so it needs no type - m_item( nullptr ), - m_lineWidth( LINE_WIDTH ), - m_color( BOX_COLOR ) -{ -} - - -void BRIGHT_BOX::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const -{ - if( !m_item ) - return; - - KIGFX::GAL* gal = aView->GetGAL(); - - gal->SetIsStroke( true ); - gal->SetIsFill( false ); - gal->SetLineWidth( m_lineWidth ); - gal->SetStrokeColor( m_color ); - - BOX2I box = m_item->ViewBBox(); - - gal->DrawRectangle( box.GetOrigin(), box.GetOrigin() + box.GetSize() ); -} - - -void BRIGHT_BOX::SetItem( EDA_ITEM* aItem ) -{ - m_item = aItem; -} diff --git a/include/preview_items/bright_box.h b/include/preview_items/bright_box.h deleted file mode 100644 index 1a523e91e1..0000000000 --- a/include/preview_items/bright_box.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2013 CERN - * @author Maciej Suminski - * - * 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 - */ - -#ifndef __BRIGHT_BOX_H -#define __BRIGHT_BOX_H - -#include -#include -#include -#include -#include - -/** - * BRIGHT_BOX - * - * Draws a decoration to indicate a brightened item. - */ -class BRIGHT_BOX : public EDA_ITEM -{ -public: - BRIGHT_BOX(); - ~BRIGHT_BOX() {} - - virtual const BOX2I ViewBBox() const override - { - if( !m_item ) - { - BOX2I bb; - bb.SetMaximum(); - return bb; - } - - return m_item->ViewBBox(); - } - - void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override; - - void ViewGetLayers( int aLayers[], int& aCount ) const override - { - aLayers[0] = LAYER_GP_OVERLAY ; - aCount = 1; - } - -#if defined(DEBUG) - void Show( int x, std::ostream& st ) const override - { - } -#endif - - /** Get class name - * @return string "BRIGHT_BOX" - */ - virtual wxString GetClass() const override - { - return wxT( "BRIGHT_BOX" ); - } - - void SetItem( EDA_ITEM* aItem ); - - void SetLineWidth( double aWidth ) - { - m_lineWidth = aWidth; - } - - void SetColor( KIGFX::COLOR4D aColor ) - { - m_color = aColor; - } - -protected: - static const KIGFX::COLOR4D BOX_COLOR; - static const double LINE_WIDTH; - - EDA_ITEM* m_item; - double m_lineWidth; - KIGFX::COLOR4D m_color; -}; - -#endif diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 5eb725e589..32ccb68c5d 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -338,7 +338,6 @@ set( PCBNEW_CLASS_SRCS tools/group_tool.cpp tools/footprint_editor_control.cpp tools/pad_tool.cpp - tools/pcb_bright_box.cpp tools/pcb_control.cpp tools/pcb_picker_tool.cpp tools/pcb_selection.cpp diff --git a/pcbnew/tools/pcb_bright_box.cpp b/pcbnew/tools/pcb_bright_box.cpp deleted file mode 100644 index 5c62faf78e..0000000000 --- a/pcbnew/tools/pcb_bright_box.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2017 KiCad Developers, see change_log.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 "pcb_bright_box.h" -#include -#include - -using namespace KIGFX; - -const double PCB_BRIGHT_BOX::PCB_LINE_WIDTH = 100000.0; - - -PCB_BRIGHT_BOX::PCB_BRIGHT_BOX() : - BRIGHT_BOX() -{ - SetLineWidth( PCB_LINE_WIDTH ); -} - - -void PCB_BRIGHT_BOX::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const -{ - if( !m_item ) - return; - - if( m_item->Type() == PCB_TRACE_T ) - { - const TRACK* track = static_cast( m_item ); - - auto gal = aView->GetGAL(); - - gal->SetIsStroke( true ); - gal->SetIsFill( false ); - gal->SetLineWidth( m_lineWidth ); - gal->SetStrokeColor( m_color ); - - gal->DrawSegment( track->GetStart(), track->GetEnd(), track->GetWidth() ); - } - else - { - BRIGHT_BOX::ViewDraw( aLayer, aView ); - } -} diff --git a/pcbnew/tools/pcb_bright_box.h b/pcbnew/tools/pcb_bright_box.h deleted file mode 100644 index 6390a32a3a..0000000000 --- a/pcbnew/tools/pcb_bright_box.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2017 KiCad Developers, see change_log.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 - */ - -#ifndef __PCB_BRIGHT_BOX_H -#define __PCB_BRIGHT_BOX_H - -#include - -/** - * PCB_BRIGHT_BOX - * - * Draws a decoration to indicate a brightened item. - */ -class PCB_BRIGHT_BOX : public BRIGHT_BOX -{ -public: - PCB_BRIGHT_BOX(); - ~PCB_BRIGHT_BOX() {} - - void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override; - -private: - static const double PCB_LINE_WIDTH; - -}; - -#endif diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index fb868edc74..b5abfd186f 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -55,7 +55,6 @@ using namespace std::placeholders; #include #include "tool_event_utils.h" #include "pcb_selection_tool.h" -#include "pcb_bright_box.h" #include "pcb_actions.h"