This repository has been archived by the owner on Jun 22, 2019. It is now read-only.
forked from Moridi/AP-Spring-98-CA-6-Inheritance
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert int to unsigned int for size comparison
- Loading branch information
Showing
8 changed files
with
30 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "../header/cuboid.h" | ||
#include "cuboid.h" | ||
|
||
using namespace std; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
#include <vector> | ||
#include <iostream> | ||
|
||
#include "../header/shape.h" | ||
#include "../header/sphere.h" | ||
#include "../header/cone.h" | ||
#include "../header/cuboid.h" | ||
#include "shape.h" | ||
#include "sphere.h" | ||
#include "cone.h" | ||
#include "cuboid.h" | ||
|
||
using namespace std; | ||
|
||
|
||
int main() | ||
{ | ||
vector<Shape*> shapes; | ||
shapes.push_back(new Sphere(10, 10, 10, 2)); | ||
shapes.push_back(new Cuboid(10, 10, 10, 1, 2, 3)); | ||
shapes.push_back(new Cone(10, 10, 10, 2, 5)); | ||
shapes.push_back(new Sphere(0, -5, 2, 3)); | ||
shapes.push_back(new Cuboid(-15, 11, -50, 1, 10, 7)); | ||
shapes.push_back(new Sphere(5, 1, 5, 2)); | ||
shapes.push_back(new Cone(5, 7, -1, 4, 3)); | ||
shapes.push_back(new Cone(-20, 0, 5, 5, 2)); | ||
shapes.push_back(new Cuboid(-5, 5, -5, 2, 6, 3)); | ||
|
||
for (int i = 0; i < shapes.size(); ++i) | ||
for (unsigned int i = 0; i < shapes.size(); ++i) | ||
cout << shapes[i] << endl; | ||
|
||
for (int i = 0; i < shapes.size(); ++i) { | ||
shapes[i]->move(-5, -10, 0); | ||
shapes[i]->scale(2); | ||
for (unsigned int i = 0; i < shapes.size(); ++i) { | ||
shapes[i]->move(-5, -10, -5); | ||
shapes[i]->scale(3); | ||
shapes[i]->move(5, -10, 5); | ||
} | ||
|
||
for (int i = 0; i < shapes.size(); ++i) | ||
for (unsigned int i = 0; i < shapes.size(); ++i) | ||
cout << shapes[i] << endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "../header/shape.h" | ||
#include "shape.h" | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters