Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
ea8f9c61
Commit
ea8f9c61
authored
Jun 22, 2011
by
Vladimir Ur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small Update for physical length lib. - wxPoint supported
parent
35ec6ff5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletion
+40
-1
length.h
include/length.h
+40
-1
No files found.
include/length.h
View file @
ea8f9c61
...
...
@@ -7,6 +7,7 @@
#define UNITS_H_INCLUDED 1
#include <math.h>
#include <wx/gdicmn.h>
/**********************************************/
/*! I'm a physical length */
/**********************************************/
...
...
@@ -388,7 +389,7 @@ public:
}
/*!
* A point ( or vector ) given x and y multiplies of s
ome
unit.
* A point ( or vector ) given x and y multiplies of s
pecified
unit.
* Given just for a convenience, you can use ( x*unit, y*unit ) instead.
* @param x coordinate factor
* @param y coordinate factor
...
...
@@ -398,6 +399,24 @@ public:
{
}
/*!
* A point ( or vector ) given wxPoint and unit
* @param x wxPoint
* @param unit the unit
*/
LENGTH_XY
(
wxPoint
x
,
const
LENGTH
unit
)
:
m_X
(
unit
*
x
.
x
),
m_Y
(
unit
*
x
.
y
)
{
}
/*!
* A point ( or vector ) given wxRealPoint and unit
* @param x wxRealPoint
* @param unit the unit
*/
LENGTH_XY
(
wxRealPoint
x
,
const
LENGTH
unit
)
:
m_X
(
unit
*
x
.
x
),
m_Y
(
unit
*
x
.
y
)
{
}
/*!
* x coordinate
* @return x coordinate
...
...
@@ -612,6 +631,26 @@ public:
return
*
this
;
}
/*!
* Outputs wxPoint in specified scale.
* @param y scale
* @return wxPoint
*/
const
wxPoint
toWxPoint
(
LENGTH
y
)
const
{
return
wxPoint
(
m_X
.
idiv
(
y
),
m_Y
.
idiv
(
y
)
);
}
/*!
* Outputs wxRealPoint in specified scale.
* @param y scale
* @return wxPoint
*/
const
wxRealPoint
toWxRealPoint
(
LENGTH
y
)
const
{
return
wxRealPoint
(
m_X
/
y
,
m_Y
/
y
);
}
/*!
* Rotates vector 90 degrees ( X axis towards Y )
* @return rotated
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment