Home
API
Releases
Github
example_src
shape.h
1
#ifndef SHAPE_H_
2
#define SHAPE_H_
3
4
#include <iostream>
5
#include "point.h"
6
16
class
Shape
17
{
18
protected
:
19
21
Point
center
;
22
23
public
:
24
31
Shape
(
int
x,
int
y);
32
38
Shape
(
Point
c);
39
47
Point
getCenter
()
const
;
48
56
void
setCenter
(
Point
c);
57
65
virtual
std::string
getType
()
const
= 0;
66
75
virtual
double
getArea
()
const
= 0;
76
};
77
78
#endif
Shape::getArea
virtual double getArea() const =0
Shape::center
Point center
Definition:
shape.h:21
Shape
Definition:
shape.h:16
Shape::Shape
Shape(int x, int y)
Definition:
shape.cpp:6
Shape::setCenter
void setCenter(Point c)
Definition:
shape.cpp:26
Point
Definition:
point.h:12
Shape::getType
virtual std::string getType() const =0
Shape::getCenter
Point getCenter() const
Definition:
shape.cpp:20