-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshape.h
More file actions
57 lines (48 loc) · 2.38 KB
/
Copy pathshape.h
File metadata and controls
57 lines (48 loc) · 2.38 KB
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
50
51
52
53
54
55
56
57
//
// shape.h
// lab3
//
// Created by Tarek Abdelrahman on 2018-08-25.
// Copyright © 2018 Tarek Abdelrahman. All rights reserved.
//
// *********** ECE244 Student: DO NOT MODIFY THIS FILE ***********
#ifndef shape_h
#define shape_h
#include <iostream>
#include <string>
using namespace std;
#endif /* shape_h */
class shape {
private:
string name; // The name of the shape
string type; // The type of the shape (see globals.h)
int x_location; // The location of the shape on the x-axis
int y_location; // The location of the shape on the y-axis
int x_size; // The size of the shape in the x-dimension
int y_size; // The size of the shape in the y-dimension
int rotation = 0; // The rotations of the shape (integer degrees)
public:
// Build a shape object with its properties
shape(string n, string t, int x_loc, int y_loc, int x_sz, int y_sz);
// Accessors
string getType(); // Returns the type
string getName(); // Returns the name of the shape
int getXlocation(); // Returns location of the shape on the x-axis
int getYlocation(); // Returns location of the shape on the y-axis
int getXsize(); // Returns the size of the shape in the x-dimension
int getYsize(); // Returns the size of the shape in the y-dimension
// Mutators
void setType(string t); // Sets the type (see globals.h)
// No error checking done inside the method
// The calling program must ensure the type
// is correct
void setName(string n); // Sets the name of the shape
void setXlocation(int x_loc); // Sets location of the shape on the x-axis
void setYlocation(int y_loc); // Sets location of the shape on the y-axis
void setXsize(int x_sz); // Sets size of the shape in the x-dimension
void setYsize(int y_sz); // Sets size of the shape in the y-dimension
void setRotate(int angle); // sets the rotation of the shape
// Utility methods
void draw(); // Draws a shape; for this assignment it
// only prints the information of the shape
};