kicad/eeschema/sch_view.h

112 lines
3.1 KiB
C
Raw Normal View History

2018-10-23 07:55:03 +00:00
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
2021-06-10 18:51:46 +00:00
* Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
2018-10-23 07:55:03 +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
*/
#ifndef SCH_VIEW_H_
#define SCH_VIEW_H_
#include <layer_ids.h>
#include <math/vector2d.h>
#include <view/view.h>
#include <memory>
#include <vector>
class SCH_SHEET;
class SCH_SCREEN;
2021-06-10 18:51:46 +00:00
class LIB_SYMBOL;
class LIB_PIN;
class SCH_BASE_FRAME;
2021-02-22 23:47:17 +00:00
class DS_PROXY_VIEW_ITEM;
// Eeschema 100nm as the internal units
constexpr double SCH_WORLD_UNIT ( 1e-7 / 0.0254 );
2021-07-21 23:14:56 +00:00
static const int SCH_LAYER_ORDER[] =
{
LAYER_GP_OVERLAY, LAYER_SELECT_OVERLAY,
LAYER_ERC_ERR, LAYER_ERC_WARN, LAYER_ERC_EXCLUSION, LAYER_DANGLING,
LAYER_REFERENCEPART, LAYER_VALUEPART, LAYER_FIELDS,
LAYER_INTERSHEET_REFS, LAYER_NETCLASS_REFS,
LAYER_BUS_JUNCTION, LAYER_JUNCTION, LAYER_NOCONNECT,
LAYER_HIERLABEL, LAYER_GLOBLABEL, LAYER_LOCLABEL,
LAYER_WIRE, LAYER_BUS,
LAYER_DEVICE,
LAYER_NOTES,
LAYER_SHEET,
LAYER_SELECTION_SHADOWS,
LAYER_DRAW_BITMAPS,
LAYER_DEVICE_BACKGROUND,
LAYER_SHEET_BACKGROUND,
LAYER_NOTES_BACKGROUND,
LAYER_DRAWINGSHEET
};
namespace KIGFX
{
class VIEW_GROUP;
namespace PREVIEW
{
class SELECTION_AREA;
};
class SCH_VIEW : public KIGFX::VIEW
{
public:
// Note: aFrame is used to know the sheet path name when drawing the drawing sheet.
// It can be null.
SCH_VIEW( bool aIsDynamic, SCH_BASE_FRAME* aFrame );
~SCH_VIEW();
void Cleanup();
2020-12-20 18:44:13 +00:00
void DisplaySheet( const SCH_SCREEN* aScreen );
void DisplaySymbol( LIB_SYMBOL* aSymbol );
// Call it to set new draw area limits (max working and draw area size)
2020-12-20 18:44:13 +00:00
void ResizeSheetWorkingArea( const SCH_SCREEN *aScreen );
void SetScale( double aScale, VECTOR2D aAnchor = { 0, 0 } ) override;
/**
* Clear the hide flag of all items in the view
*/
void ClearHiddenFlags();
void HideDrawingSheet();
2021-02-22 23:47:17 +00:00
DS_PROXY_VIEW_ITEM* GetDrawingSheet() const { return m_drawingSheet.get(); }
private:
SCH_BASE_FRAME* m_frame; // The frame using this view. Can be null. Used mainly
// to know the sheet path name when drawing the drawing sheet
2021-02-22 23:47:17 +00:00
std::unique_ptr<DS_PROXY_VIEW_ITEM> m_drawingSheet;
};
}; // namespace
#endif