55 changed files with 461 additions and 426 deletions
-
12cvpcb/tools/cvpcb_selection_tool.cpp
-
2eeschema/CMakeLists.txt
-
14eeschema/tools/ee_inspection_tool.cpp
-
2eeschema/tools/ee_point_editor.cpp
-
51eeschema/tools/ee_selection.cpp
-
36eeschema/tools/ee_selection.h
-
8eeschema/tools/ee_selection_tool.cpp
-
34eeschema/tools/ee_selection_tool.h
-
2eeschema/tools/ee_tool_base.h
-
16eeschema/tools/lib_edit_tool.cpp
-
6eeschema/tools/lib_move_tool.cpp
-
2eeschema/tools/lib_move_tool.h
-
6eeschema/tools/lib_pin_tool.cpp
-
8eeschema/tools/sch_drawing_tools.cpp
-
30eeschema/tools/sch_edit_tool.cpp
-
24eeschema/tools/sch_editor_control.cpp
-
8eeschema/tools/sch_move_tool.cpp
-
4eeschema/tools/sch_move_tool.h
-
2eeschema/tools/sch_wire_bus_tool.cpp
-
1gerbview/CMakeLists.txt
-
2gerbview/tools/gerbview_control.cpp
-
70gerbview/tools/gerbview_selection.cpp
-
38gerbview/tools/gerbview_selection.h
-
68gerbview/tools/gerbview_selection_tool.cpp
-
12gerbview/tools/gerbview_selection_tool.h
-
69include/tool/selection.h
-
2pagelayout_editor/CMakeLists.txt
-
12pagelayout_editor/tools/pl_edit_tool.cpp
-
2pagelayout_editor/tools/pl_edit_tool.h
-
2pagelayout_editor/tools/pl_editor_control.cpp
-
2pagelayout_editor/tools/pl_point_editor.cpp
-
51pagelayout_editor/tools/pl_selection.cpp
-
36pagelayout_editor/tools/pl_selection.h
-
8pagelayout_editor/tools/pl_selection_tool.cpp
-
13pagelayout_editor/tools/pl_selection_tool.h
-
2pcbnew/CMakeLists.txt
-
12pcbnew/tools/drawing_tool.cpp
-
8pcbnew/tools/edit_tool.cpp
-
4pcbnew/tools/edit_tool.h
-
6pcbnew/tools/footprint_editor_tools.cpp
-
8pcbnew/tools/global_edit_tool.cpp
-
13pcbnew/tools/pad_tool.cpp
-
18pcbnew/tools/pcb_editor_control.cpp
-
6pcbnew/tools/pcb_tool_base.cpp
-
6pcbnew/tools/pcb_tool_base.h
-
8pcbnew/tools/pcbnew_control.cpp
-
2pcbnew/tools/pcbnew_picker_tool.cpp
-
46pcbnew/tools/pcbnew_selection.cpp
-
38pcbnew/tools/pcbnew_selection.h
-
6pcbnew/tools/placement_tool.cpp
-
2pcbnew/tools/point_editor.cpp
-
2pcbnew/tools/position_relative_tool.cpp
-
16pcbnew/tools/selection_tool.cpp
-
27pcbnew/tools/selection_tool.h
-
2qa/gal/gal_pixel_alignment/CMakeLists.txt
@ -0,0 +1,36 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.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 EE_SELECTION_H |
|||
#define EE_SELECTION_H |
|||
|
|||
#include <tool/selection.h> |
|||
|
|||
|
|||
class EE_SELECTION : public SELECTION |
|||
{ |
|||
public: |
|||
EDA_ITEM* GetTopLeftItem( bool onlyModules = false ) const override; |
|||
}; |
|||
|
|||
#endif // EE_SELECTION_H |
@ -0,0 +1,70 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2019 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 3 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, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#include <base_struct.h>
|
|||
#include <view/view_group.h>
|
|||
#include <gerber_draw_item.h>
|
|||
#include <tools/gerbview_selection.h>
|
|||
|
|||
VECTOR2I GERBVIEW_SELECTION::GetCenter() const |
|||
{ |
|||
VECTOR2I centre; |
|||
|
|||
if( Size() == 1 ) |
|||
{ |
|||
centre = static_cast<GERBER_DRAW_ITEM*>( Front() )->GetPosition(); |
|||
} |
|||
else |
|||
{ |
|||
EDA_RECT bbox = Front()->GetBoundingBox(); |
|||
auto i = m_items.begin(); |
|||
++i; |
|||
|
|||
for( ; i != m_items.end(); ++i ) |
|||
bbox.Merge( (*i)->GetBoundingBox() ); |
|||
|
|||
centre = bbox.Centre(); |
|||
} |
|||
|
|||
return centre; |
|||
} |
|||
|
|||
|
|||
const BOX2I GERBVIEW_SELECTION::ViewBBox() const |
|||
{ |
|||
EDA_RECT eda_bbox; |
|||
|
|||
if( Size() == 1 ) |
|||
{ |
|||
eda_bbox = Front()->GetBoundingBox(); |
|||
} |
|||
else if( Size() > 1 ) |
|||
{ |
|||
eda_bbox = Front()->GetBoundingBox(); |
|||
auto i = m_items.begin(); |
|||
++i; |
|||
|
|||
for( ; i != m_items.end(); ++i ) |
|||
eda_bbox.Merge( (*i)->GetBoundingBox() ); |
|||
} |
|||
|
|||
return BOX2I( eda_bbox.GetOrigin(), eda_bbox.GetSize() ); |
|||
} |
|||
|
|||
|
@ -0,0 +1,38 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.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 GERBVIEW_SELECTION_H |
|||
#define GERBVIEW_SELECTION_H |
|||
|
|||
#include <tool/selection.h> |
|||
|
|||
|
|||
class GERBVIEW_SELECTION : public SELECTION |
|||
{ |
|||
public: |
|||
VECTOR2I GetCenter() const override; |
|||
|
|||
const BOX2I ViewBBox() const override; |
|||
}; |
|||
|
|||
#endif // GERBVIEW_SELECTION_H |
@ -0,0 +1,36 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.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 PL_SELECTION_H |
|||
#define PL_SELECTION_H |
|||
|
|||
#include <tool/selection.h> |
|||
|
|||
|
|||
class PL_SELECTION : public SELECTION |
|||
{ |
|||
public: |
|||
EDA_ITEM* GetTopLeftItem( bool onlyModules = false ) const override; |
|||
}; |
|||
|
|||
#endif // PL_SELECTION_H |
@ -0,0 +1,38 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.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 PCBNEW_SELECTION_H |
|||
#define PCBNEW_SELECTION_H |
|||
|
|||
#include <tool/selection.h> |
|||
|
|||
|
|||
class PCBNEW_SELECTION : public SELECTION |
|||
{ |
|||
public: |
|||
EDA_ITEM* GetTopLeftItem( bool onlyModules = false ) const override; |
|||
|
|||
const KIGFX::VIEW_GROUP::ITEMS updateDrawList() const override; |
|||
}; |
|||
|
|||
#endif // PCBNEW_SELECTION_H |
Write
Preview
Loading…
Cancel
Save
Reference in new issue