Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __COORDINATE_H__
00011 #define __COORDINATE_H__
00012 #include "MSPUBConstants.h"
00013 namespace libmspub
00014 {
00015 struct Coordinate
00016 {
00017 Coordinate(int xs, int ys, int xe, int ye) : m_xs(xs), m_ys(ys), m_xe(xe), m_ye(ye) { }
00018 Coordinate() : m_xs(0), m_ys(0), m_xe(0), m_ye(0) { }
00019 int m_xs, m_ys, m_xe, m_ye;
00020 double getXIn(double pageWidth) const
00021 {
00022 return pageWidth / 2 + double(m_xs) / EMUS_IN_INCH;
00023 }
00024 double getYIn(double pageHeight) const
00025 {
00026 return pageHeight / 2 + double(m_ys) / EMUS_IN_INCH;
00027 }
00028 double getWidthIn() const
00029 {
00030 return double(m_xe - m_xs) / EMUS_IN_INCH;
00031 }
00032 double getHeightIn() const
00033 {
00034 return double(m_ye - m_ys) / EMUS_IN_INCH;
00035 }
00036 };
00037 }
00038 #endif
00039