map2d_widget
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
src
core
size.h
Go to the documentation of this file.
1
12
/*
13
* This program is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 3 of the License, or
16
* (at your option) any later version.
17
*
18
* This program is distributed in the hope that it will be useful, but
19
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21
* for more details.
22
*
23
* You should have received a copy of the GNU General Public License along
24
* with this program; if not, write to the Free Software Foundation, Inc.,
25
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
*/
27
#ifndef SIZE_H
28
#define SIZE_H
29
30
#include "
point.h
"
31
#include <QString>
32
#include <QHash>
33
34
namespace
core
{
35
struct
Size
36
{
37
38
Size
();
39
Size
(
Point
pt){width=pt.
X
(); height=pt.
Y
();};
40
Size
(
int
Width
,
int
Height
){width=
Width
; height=
Height
;};
41
friend
uint
qHash
(
Size
const
& size);
42
// friend bool operator==(Size const& lhs,Size const& rhs);
43
Size
operator-
(
const
Size
&sz1){
return
Size
(width-sz1.width,height-sz1.height);}
44
Size
operator+
(
const
Size
&sz1){
return
Size
(sz1.width+width,sz1.height+height);}
45
46
int
GetHashCode
(){
return
width^height;}
47
uint
qHash
(
Size
const
&
/*rect*/
){
return
width^height;}
48
QString
ToString
(){
return
"With="
+QString::number(width)+
" ,Height="
+QString::number(height);}
49
int
Width
()
const
{
return
width;}
50
int
Height
()
const
{
return
height;}
51
void
SetWidth
(
int
const
& value){width=value;}
52
void
SetHeight
(
int
const
& value){height=value;}
53
private
:
54
int
width;
55
int
height;
56
};
57
}
58
#endif // SIZE_H
core::Size::SetHeight
void SetHeight(int const &value)
Definition:
size.h:52
core::Size::Size
Size()
Definition:
size.cpp:31
core::Size::Size
Size(Point pt)
Definition:
size.h:39
core::Size::operator-
Size operator-(const Size &sz1)
Definition:
size.h:43
core
Definition:
accessmode.h:35
core::Size::qHash
friend uint qHash(Size const &size)
point.h
core::Size
Definition:
size.h:35
core::Size::Size
Size(int Width, int Height)
Definition:
size.h:40
core::Point
Definition:
point.h:35
core::Size::operator+
Size operator+(const Size &sz1)
Definition:
size.h:44
core::Size::GetHashCode
int GetHashCode()
Definition:
size.h:46
core::Size::Width
int Width() const
Definition:
size.h:49
core::Size::Height
int Height() const
Definition:
size.h:50
core::Size::qHash
uint qHash(Size const &)
Definition:
size.h:47
core::Size::SetWidth
void SetWidth(int const &value)
Definition:
size.h:51
core::Point::X
int X() const
Definition:
point.h:47
core::Size::ToString
QString ToString()
Definition:
size.h:48
core::Point::Y
int Y() const
Definition:
point.h:48
Generated by
1.8.11