-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshape.h
More file actions
39 lines (29 loc) · 714 Bytes
/
shape.h
File metadata and controls
39 lines (29 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef SHAPE_H
#define SHAPE_H
#include <string>
#include <vector>
#include <iostream>
#include "BoundingBox.h"
using std::string;
using std::vector;
using std::ostream;
class Shape{
private:
string _name;
protected:
BoundingBox _boundingBox;
//A pure virtual function generates the bounding box
virtual void generateBoundingBox(){}
public:
Shape(string name);
string name();
virtual string print();
virtual int area() const;
inline virtual BoundingBox getBoundingBox(){ return _boundingBox; }
};
//Global Function
string printShape(vector<Shape *> shapes);
int totalArea(vector<Shape *> shapes);
ostream & operator << (ostream &, Shape & s);
double areaSum(std::vector<Shape*> shapes);
#endif