-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstar.h
49 lines (40 loc) · 953 Bytes
/
star.h
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
40
41
42
43
44
45
46
47
48
49
/*
* star.h
* 4/19/2016
*
* CS 372 Sp16
* Group Project 2: Postscript Generator
*/
#ifndef STAR_H
#define STAR_H
#include "shape.h"
class Star : public Shape
{
public:
Star(): Shape(), outerRadius_(0), innerRadius_(0) {};
Star(int x, int y, int n, double oRadius, double iRadius)
: Shape(x, y, 2* (oRadius<iRadius ? iRadius : oRadius), 2*(oRadius<iRadius ? iRadius : oRadius)),
numOfPoints_(n),
outerRadius_(oRadius),
innerRadius_(iRadius)
{};
Star(int n, double oRadius, double iRadius) : Star(0,0,n,oRadius,iRadius) {};
string draw() const;
string draw(int x, int y) const;
double outerRadius();
double innerRadius();
private:
/**
* number of points on star
*/
double numOfPoints_;
/**
* distance from center of star to tip of point
*/
double outerRadius_;
/**
* distance from center of star to bottom of vertex between points
*/
double innerRadius_;
}; //end of class Star
#endif // STAR_H