Main Page
Namespaces
Classes
Files
File List
File Members
Coordinate.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/*
3
* This file is part of the libmspub project.
4
*
5
* This Source Code Form is subject to the terms of the Mozilla Public
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
7
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
*/
9
10
#ifndef __COORDINATE_H__
11
#define __COORDINATE_H__
12
#include "
MSPUBConstants.h
"
13
namespace
libmspub
14
{
15
struct
Coordinate
16
{
17
Coordinate
(
int
xs,
int
ys,
int
xe,
int
ye) :
m_xs
(xs),
m_ys
(ys),
m_xe
(xe),
m_ye
(ye) { }
18
Coordinate
() :
m_xs
(0),
m_ys
(0),
m_xe
(0),
m_ye
(0) { }
19
int
m_xs
,
m_ys
,
m_xe
,
m_ye
;
20
double
getXIn
(
double
pageWidth)
const
21
{
22
return
pageWidth / 2 + double(
m_xs
) /
EMUS_IN_INCH
;
23
}
24
double
getYIn
(
double
pageHeight)
const
25
{
26
return
pageHeight / 2 + double(
m_ys
) /
EMUS_IN_INCH
;
27
}
28
double
getWidthIn
()
const
29
{
30
return
double(
m_xe
-
m_xs
) /
EMUS_IN_INCH
;
31
}
32
double
getHeightIn
()
const
33
{
34
return
double(
m_ye
-
m_ys
) /
EMUS_IN_INCH
;
35
}
36
};
37
}
38
#endif
39
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Generated for libmspub by
doxygen
1.8.4