Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //GraphicElement.cpp
- #include <iostream>
- #include <string>
- #include "GraphicElement.h"
- using namespace std;
- GraphicElement::GraphicElement(Shape** s, char* n, unsigned int i){
- //add each shape to the vector arry of shapes.
- double x_1, y_1, x_2, y_2;
- char* nameOfShape;
- char type;
- strcpy(name, n); // copy over the name of the element.
- for (int j = 0; j < i; j++){
- cout << "Please enter the type( L for line, R for rectangle, E for ellipse) for Shape #" << j << endl;
- cin >> type;
- type = toupper(type);
- if (type == 'L'){
- cout << "Please enter the name of the new line(<256 characters): ";
- cin >> name;
- cout << endl;
- cout << "please enter the coordinates of the start point: (x,y) ";
- cin >> x_1;
- cout << " ";
- cin >> y_1;
- cout << endl;
- cout << "please enter the coordinates of the end point: (x,y) ";
- cin >> x_2;
- cout << " ";
- cin >> y_2;
- cout << endl;
- this->push_back(Line*(nameOfShape, Pair(x_1, y_1), Pair(x_2, y_2)));
- }
- if (type == 'R'){
- }
- if (type == 'E'){
- }
- }
- }
- GraphicElement::GraphicElement(const GraphicElement& gElement){
- *this = gElement;
- }
- GraphicElement& GraphicElement::operator=(GraphicElement& gElement){
- return *this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement