KiCad PCB EDA Suite
Loading...
Searching...
No Matches
transform.h
Go to the documentation of this file.
1
5
/*
6
* This program source code file is part of KiCad, a free EDA CAD application.
7
*
8
* Copyright (C) 2007-2010 Wayne Stambaugh <
[email protected]
>
9
* Copyright (C) 2007-2021 KiCad Developers, see AUTHORS.txt for contributors.
10
*
11
* This program is free software; you can redistribute it and/or
12
* modify it under the terms of the GNU General Public License
13
* as published by the Free Software Foundation; either version 2
14
* of the License, or (at your option) any later version.
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
20
*
21
* You should have received a copy of the GNU General Public License
22
* along with this program; if not, you may find one here:
23
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24
* or you may search the http://www.gnu.org website for the version 2 license,
25
* or you may write to the Free Software Foundation, Inc.,
26
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27
*/
28
29
30
#ifndef _TRANSFORM_H_
31
#define _TRANSFORM_H_
32
33
#include <
geometry/eda_angle.h
>
34
#include <
math/box2.h
>
35
36
45
class
TRANSFORM
46
{
47
public
:
48
int
x1
;
49
int
y1
;
50
int
x2
;
51
int
y2
;
52
56
TRANSFORM
() :
57
x1
( 1 ),
58
y1
( 0 ),
59
x2
( 0 ),
60
y2
( 1 )
61
{}
62
63
TRANSFORM
(
int
ax1,
int
ay1,
int
ax2,
int
ay2 ) :
64
x1
( ax1 ),
65
y1
( ay1 ),
66
x2
( ax2 ),
67
y2
( ay2 )
68
{}
69
70
bool
operator==
(
const
TRANSFORM
& aTransform )
const
;
71
72
bool
operator!=
(
const
TRANSFORM
& aTransform )
const
{
return
!( *
this
== aTransform ); }
73
81
VECTOR2I
TransformCoordinate
(
const
VECTOR2I
& aPoint )
const
;
82
90
BOX2I
TransformCoordinate
(
const
BOX2I
& aRect )
const
;
91
98
TRANSFORM
InverseTransform
( )
const
;
99
107
bool
MapAngles
(
EDA_ANGLE
* aAngle1,
EDA_ANGLE
* aAngle2 )
const
;
108
};
109
110
namespace
std
111
{
112
template
<>
struct
hash<
TRANSFORM
>
113
{
114
size_t
operator() (
const
TRANSFORM
& k )
const
;
115
};
116
}
117
118
#endif
// _TRANSFORM_H_
box2.h
BOX2< VECTOR2I >
EDA_ANGLE
Definition:
eda_angle.h:37
TRANSFORM
for transforming drawing coordinates for a wxDC device context.
Definition:
transform.h:46
TRANSFORM::TRANSFORM
TRANSFORM(int ax1, int ay1, int ax2, int ay2)
Definition:
transform.h:63
TRANSFORM::x2
int x2
Definition:
transform.h:50
TRANSFORM::y1
int y1
Definition:
transform.h:49
TRANSFORM::MapAngles
bool MapAngles(EDA_ANGLE *aAngle1, EDA_ANGLE *aAngle2) const
Calculate new angles according to the transform.
Definition:
transform.cpp:81
TRANSFORM::InverseTransform
TRANSFORM InverseTransform() const
Calculate the Inverse mirror/rotation transform.
Definition:
transform.cpp:59
TRANSFORM::operator==
bool operator==(const TRANSFORM &aTransform) const
Definition:
transform.cpp:35
TRANSFORM::TransformCoordinate
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition:
transform.cpp:44
TRANSFORM::TRANSFORM
TRANSFORM()
The default construct creates a transform that draws object is the normal orientation.
Definition:
transform.h:56
TRANSFORM::operator!=
bool operator!=(const TRANSFORM &aTransform) const
Definition:
transform.h:72
TRANSFORM::y2
int y2
Definition:
transform.h:51
TRANSFORM::x1
int x1
Definition:
transform.h:48
VECTOR2< int32_t >
eda_angle.h
std
STL namespace.
src
libs
kimath
include
transform.h
Generated on Thu Nov 21 2024 00:06:44 for KiCad PCB EDA Suite by
1.9.6