Elements
5.10
A C++ base framework for the Euclid Software.
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
ElementsExamples
src
lib
Rectangle.cpp
Go to the documentation of this file.
1
18
#include "
ElementsExamples/Rectangle.h
"
19
20
namespace
Elements {
21
namespace
Examples {
22
23
Rectangle::Rectangle
(
int
X0,
int
Y0,
int
X1,
int
Y1) {
24
x0
= X0;
25
y0
= Y0;
26
x1
= X1;
27
y1
= Y1;
28
}
29
30
Rectangle::~Rectangle
() {
31
}
32
33
int
Rectangle::getLength
() {
34
return
(
x1
-
x0
);
35
}
36
37
int
Rectangle::getHeight
() {
38
return
(
y1
-
y0
);
39
}
40
41
int
Rectangle::getArea
() {
42
return
(
x1
-
x0
) * (
y1
-
y0
);
43
}
44
45
void
Rectangle::move
(
int
dx,
int
dy) {
46
x0
+= dx;
47
y0
+= dy;
48
x1
+= dx;
49
y1
+= dy;
50
}
51
52
}
// namespace Examples
53
}
// namespace Elements
Elements::Examples::Rectangle::y1
int y1
Definition:
Rectangle.h:34
Elements::Examples::Rectangle::y0
int y0
Definition:
Rectangle.h:34
Elements::Examples::Rectangle::move
void move(int dx, int dy)
Definition:
Rectangle.cpp:45
Elements::Examples::Rectangle::x1
int x1
Definition:
Rectangle.h:34
Elements::Examples::Rectangle::getLength
int getLength()
Definition:
Rectangle.cpp:33
Elements::Examples::Rectangle::getArea
int getArea()
Definition:
Rectangle.cpp:41
Elements::Examples::Rectangle::x0
int x0
Definition:
Rectangle.h:34
Elements::Examples::Rectangle::Rectangle
Rectangle(int x0, int y0, int x1, int y1)
Definition:
Rectangle.cpp:23
Rectangle.h
Elements::Examples::Rectangle::~Rectangle
~Rectangle()
Definition:
Rectangle.cpp:30
Elements::Examples::Rectangle::getHeight
int getHeight()
Definition:
Rectangle.cpp:37
Generated by
1.8.5