Remove deprecated BRIGHT_BOX preview item
This commit is contained in:
parent
c04e19f9ac
commit
6924b98bc3
|
@ -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
|
||||
|
|
|
@ -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 <maciej.suminski@cern.ch>
|
||||
*
|
||||
* 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 <preview_items/bright_box.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
|
||||
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;
|
||||
}
|
|
@ -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 <maciej.suminski@cern.ch>
|
||||
*
|
||||
* 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 <math/box2.h>
|
||||
#include <view/view.h>
|
||||
#include <eda_item.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <gal/color4d.h>
|
||||
|
||||
/**
|
||||
* 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
|
|
@ -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
|
||||
|
|
|
@ -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 <gal/graphics_abstraction_layer.h>
|
||||
#include <track.h>
|
||||
|
||||
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<const TRACK*>( 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 );
|
||||
}
|
||||
}
|
|
@ -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 <preview_items/bright_box.h>
|
||||
|
||||
/**
|
||||
* 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
|
|
@ -55,7 +55,6 @@ using namespace std::placeholders;
|
|||
#include <id.h>
|
||||
#include "tool_event_utils.h"
|
||||
#include "pcb_selection_tool.h"
|
||||
#include "pcb_bright_box.h"
|
||||
#include "pcb_actions.h"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue