KiCad PCB EDA Suite
Loading...
Searching...
No Matches
zone_preview_canvas.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 (C) 2023 Ethan Chien <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21
22#pragma once
23
24#include <board_item.h>
25#include <math/vector2d.h>
26#include <wx/gdicmn.h>
27#include <zone.h>
28#include <memory>
29#include <wx/string.h>
31#include "pcb_draw_panel_gal.h"
32
33
35{
36public:
37 ZONE_PREVIEW_CANVAS( BOARD* aPcb, std::unique_ptr<ZONE> aZone, PCB_LAYER_ID aLayer, wxWindow* aParentWindow,
38 KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType );
39 ~ZONE_PREVIEW_CANVAS() override = default;
40
41 const wxSize GetPageSizeIU() const;
42
43 void ZoomFitScreen();
44 BOX2I GetBoardBoundingBox( bool aBoardEdgesOnly ) const;
45
46 const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const;
47
48 void LockZoom( double aScale, const VECTOR2D& aCenter );
49 void UnlockZoom();
50
51private:
53 std::unique_ptr<BOARD_EDGES_BOUNDING_ITEM> m_pcb_bounding_box;
54 std::unique_ptr<ZONE> m_zone;
56};
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
PCB_DRAW_PANEL_GAL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
const wxSize GetPageSizeIU() const
std::unique_ptr< ZONE > m_zone
ZONE_PREVIEW_CANVAS(BOARD *aPcb, std::unique_ptr< ZONE > aZone, PCB_LAYER_ID aLayer, wxWindow *aParentWindow, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType)
std::unique_ptr< BOARD_EDGES_BOUNDING_ITEM > m_pcb_bounding_box
~ZONE_PREVIEW_CANVAS() override=default
void LockZoom(double aScale, const VECTOR2D &aCenter)
BOX2I GetBoardBoundingBox(bool aBoardEdgesOnly) const
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
VECTOR2< double > VECTOR2D
Definition vector2d.h:707