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 (C) 2012-2023 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 VECTOR2WX_H_
25#define VECTOR2WX_H_
26
27#include <wx/gdicmn.h>
28#include "vector2d.h"
29
30inline VECTOR2I ToVECTOR2I(const wxSize& aSize)
31{
32 return { aSize.x, aSize.y };
33}
34
35inline VECTOR2I ToVECTOR2I( const wxPoint & aSize )
36{
37 return { aSize.x, aSize.y };
38}
39
40inline VECTOR2D ToVECTOR2D( const wxPoint& aPoint )
41{
42 return VECTOR2D( aPoint.x, aPoint.y );
43}
44
45inline VECTOR2D ToVECTOR2D( const wxSize& aPoint )
46{
47 return VECTOR2D( aPoint.x, aPoint.y );
48}
49
50inline wxPoint ToWxPoint( const VECTOR2I& aSize )
51{
52 return wxPoint( aSize.x, aSize.y );
53}
54
55inline wxSize ToWxSize( const VECTOR2I& aSize )
56{
57 return wxSize( aSize.x, aSize.y );
58}
59
60#endif
VECTOR2< double > VECTOR2D
Definition: vector2d.h:587
VECTOR2I ToVECTOR2I(const wxSize &aSize)
Definition: vector2wx.h:30
wxPoint ToWxPoint(const VECTOR2I &aSize)
Definition: vector2wx.h:50
VECTOR2D ToVECTOR2D(const wxPoint &aPoint)
Definition: vector2wx.h:40
wxSize ToWxSize(const VECTOR2I &aSize)
Definition: vector2wx.h:55