KiCad PCB EDA Suite
Loading...
Searching...
No Matches
vector2wx.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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef VECTOR2WX_H_
21#define VECTOR2WX_H_
22
23#include <wx/gdicmn.h>
24#include "vector2d.h"
25
26inline VECTOR2I ToVECTOR2I(const wxSize& aSize)
27{
28 return { aSize.x, aSize.y };
29}
30
31inline VECTOR2I ToVECTOR2I( const wxPoint & aSize )
32{
33 return { aSize.x, aSize.y };
34}
35
36inline VECTOR2D ToVECTOR2D( const wxPoint& aPoint )
37{
38 return VECTOR2D( aPoint.x, aPoint.y );
39}
40
41inline VECTOR2D ToVECTOR2D( const wxSize& aPoint )
42{
43 return VECTOR2D( aPoint.x, aPoint.y );
44}
45
46inline wxPoint ToWxPoint( const VECTOR2I& aSize )
47{
48 return wxPoint( aSize.x, aSize.y );
49}
50
51inline wxSize ToWxSize( const VECTOR2I& aSize )
52{
53 return wxSize( aSize.x, aSize.y );
54}
55
56#endif
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683
VECTOR2< double > VECTOR2D
Definition vector2d.h:682
VECTOR2I ToVECTOR2I(const wxSize &aSize)
Definition vector2wx.h:26
wxPoint ToWxPoint(const VECTOR2I &aSize)
Definition vector2wx.h:46
VECTOR2D ToVECTOR2D(const wxPoint &aPoint)
Definition vector2wx.h:36
wxSize ToWxSize(const VECTOR2I &aSize)
Definition vector2wx.h:51