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, ZONE* aZone, PCB_LAYER_ID aLayer, wxWindow* aParentWindow,
38 KIGFX::GAL_DISPLAY_OPTIONS& aOptions, wxWindowID aWindowId = 0,
39 const wxPoint& aPosition = wxDefaultPosition, const wxSize& aSize = wxDefaultSize,
40 GAL_TYPE aGalType = GAL_TYPE_OPENGL );
41 ~ZONE_PREVIEW_CANVAS() override = default;
42
43 const wxSize GetPageSizeIU() const;
44
45 void ZoomFitScreen();
46 BOX2I GetBoardBoundingBox( bool aBoardEdgesOnly ) const;
47
48 const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const;
49
50 void LockZoom( double aScale, const VECTOR2D& aCenter );
51 void UnlockZoom();
52
53private:
55 std::unique_ptr<BOARD_EDGES_BOUNDING_ITEM> m_pcb_bounding_box;
57};
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
@ GAL_TYPE_OPENGL
OpenGL implementation.
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< BOARD_EDGES_BOUNDING_ITEM > m_pcb_bounding_box
~ZONE_PREVIEW_CANVAS() override=default
void LockZoom(double aScale, const VECTOR2D &aCenter)
ZONE_PREVIEW_CANVAS(BOARD *aPcb, ZONE *aZone, PCB_LAYER_ID aLayer, wxWindow *aParentWindow, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, wxWindowID aWindowId=0, const wxPoint &aPosition=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
BOX2I GetBoardBoundingBox(bool aBoardEdgesOnly) const
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const
Handle a list of polygons defining a copper zone.
Definition zone.h:70
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
VECTOR2< double > VECTOR2D
Definition vector2d.h:682