KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_view.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef SCH_VIEW_H_
25#define SCH_VIEW_H_
26
27#include <layer_ids.h>
28#include <math/vector2d.h>
29#include <view/view.h>
30
31#include <memory>
32#include <vector>
33
34class SCH_SHEET;
35class SCH_SCREEN;
36class LIB_SYMBOL;
37class SCH_PIN;
38class SCH_BASE_FRAME;
40
41
42// Eeschema 100nm as the internal units
43constexpr double SCH_WORLD_UNIT ( 1e-7 / 0.0254 );
44
45static const int SCH_LAYER_ORDER[] = { LAYER_GP_OVERLAY,
84
85
86namespace KIGFX
87{
88 class VIEW_GROUP;
89
90 namespace PREVIEW
91 {
92 class SELECTION_AREA;
93 };
94
95class SCH_VIEW : public KIGFX::VIEW
96{
97public:
98 // Note: aFrame is used to know the sheet path name when drawing the drawing sheet.
99 // It can be null.
100 SCH_VIEW( SCH_BASE_FRAME* aFrame );
101 ~SCH_VIEW();
102
103 void Cleanup();
104
105 void DisplaySheet( const SCH_SCREEN* aScreen );
106 void DisplaySymbol( LIB_SYMBOL* aSymbol );
107
108 // Call it to set new draw area limits (max working and draw area size)
109 void ResizeSheetWorkingArea( const SCH_SCREEN *aScreen );
110
111 void SetScale( double aScale, VECTOR2D aAnchor = { 0, 0 } ) override;
112
116 void ClearHiddenFlags();
117
118 void HideDrawingSheet();
119
121
122private:
123 SCH_BASE_FRAME* m_frame; // The frame using this view. Can be null. Used mainly
124 // to know the sheet path name when drawing the drawing sheet
125
126 std::unique_ptr<DS_PROXY_VIEW_ITEM> m_drawingSheet;
127};
128
129}; // namespace
130
131#endif
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Definition: sch_view.h:126
void DisplaySymbol(LIB_SYMBOL *aSymbol)
Definition: sch_view.cpp:138
void ResizeSheetWorkingArea(const SCH_SCREEN *aScreen)
Definition: sch_view.cpp:85
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
Definition: sch_view.h:120
void DisplaySheet(const SCH_SCREEN *aScreen)
Definition: sch_view.cpp:95
void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 }) override
Set the scaling factor, zooming around a given anchor point.
Definition: sch_view.cpp:75
void HideDrawingSheet()
Definition: sch_view.cpp:191
void Cleanup()
Definition: sch_view.cpp:67
SCH_BASE_FRAME * m_frame
Definition: sch_view.h:123
void ClearHiddenFlags()
Clear the hide flag of all items in the view.
Definition: sch_view.cpp:179
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
Define a library symbol object.
Definition: lib_symbol.h:84
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:59
@ LAYER_DRAWINGSHEET
Sheet frame and title block.
Definition: layer_ids.h:276
@ LAYER_DRAW_BITMAPS
Draw images.
Definition: layer_ids.h:282
@ LAYER_GP_OVERLAY
General purpose overlay.
Definition: layer_ids.h:277
@ LAYER_SELECT_OVERLAY
Selected items overlay.
Definition: layer_ids.h:278
@ LAYER_DANGLING
Definition: layer_ids.h:465
@ LAYER_SHAPES_BACKGROUND
Definition: layer_ids.h:471
@ LAYER_SHEETNAME
Definition: layer_ids.h:460
@ LAYER_ERC_WARN
Definition: layer_ids.h:467
@ LAYER_SHEETLABEL
Definition: layer_ids.h:463
@ LAYER_PINNUM
Definition: layer_ids.h:446
@ LAYER_RULE_AREAS
Definition: layer_ids.h:453
@ LAYER_DEVICE
Definition: layer_ids.h:454
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:473
@ LAYER_ERC_EXCLUSION
Definition: layer_ids.h:469
@ LAYER_HIERLABEL
Definition: layer_ids.h:445
@ LAYER_PINNAM
Definition: layer_ids.h:447
@ LAYER_PRIVATE_NOTES
Definition: layer_ids.h:456
@ LAYER_GLOBLABEL
Definition: layer_ids.h:444
@ LAYER_WIRE
Definition: layer_ids.h:440
@ LAYER_NOTES
Definition: layer_ids.h:455
@ LAYER_ERC_ERR
Definition: layer_ids.h:468
@ LAYER_VALUEPART
Definition: layer_ids.h:449
@ LAYER_BUS
Definition: layer_ids.h:441
@ LAYER_FIELDS
Definition: layer_ids.h:450
@ LAYER_DEVICE_BACKGROUND
Definition: layer_ids.h:472
@ LAYER_LOCLABEL
Definition: layer_ids.h:443
@ LAYER_JUNCTION
Definition: layer_ids.h:442
@ LAYER_SHEETFIELDS
Definition: layer_ids.h:462
@ LAYER_REFERENCEPART
Definition: layer_ids.h:448
@ LAYER_NETCLASS_REFS
Definition: layer_ids.h:452
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:457
@ LAYER_OP_CURRENTS
Definition: layer_ids.h:489
@ LAYER_SHEET
Definition: layer_ids.h:459
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:482
@ LAYER_INTERSHEET_REFS
Definition: layer_ids.h:451
@ LAYER_OP_VOLTAGES
Definition: layer_ids.h:488
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:461
@ LAYER_BUS_JUNCTION
Definition: layer_ids.h:485
@ LAYER_NOCONNECT
Definition: layer_ids.h:464
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247
constexpr double SCH_WORLD_UNIT(1e-7/0.0254)
static const int SCH_LAYER_ORDER[]
Definition: sch_view.h:45