Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <Rectangle.h>
- #include <regex>
- using namespace std;
- #include <SVG.h>
- void printMenu()
- {
- cout<<"1. load from default file"<<endl;
- cout<<"2. print objects"<<endl;
- cout<<"3.create by command"<<endl;
- cout<<"4.translate by command"<<endl;
- cout<<"5.erase by index"<<endl;
- cout<<"7.exit"<<endl;
- }
- void create(SVG &svg)
- {
- string command;
- std::getline(std::cin, command);
- cout<<"COMMAND WAS "<<command<<endl;
- svg.createByCommand(command);
- }
- int main()
- {
- SVG svg = SVG();
- while(true)
- {
- printMenu();
- cout<<"---Enter option---"<<endl;
- string line;
- int choice;
- cin>> choice;
- switch(choice)
- {
- case 1:
- svg.readFromFile("C:\\Users\\Tankz\\Music\\ha.txt");
- break;
- case 2:
- svg.printObjects();
- break;
- case 3:
- cout<<"Enter command"<<endl;
- create(svg);
- break;
- case 4:
- cout<<"Enter command"<<endl;
- cin>>line;
- svg.translate(line);
- break;
- case 5:
- int index;
- cout<<"Enter index"<<endl;
- cin>>index;
- svg.erase(index);
- break;
- case 6:
- case 7:
- break;
- }
- }
- /*
- SVG svg = SVG();
- svg.readFromFile("C:\\Users\\Tankz\\Music\\ha.txt");
- svg.createByCommand("create rectangle -1000 -1000 10 20 yellow");
- svg.printObjects();
- svg.erase(4);
- svg.translate("translate vertical=10 horizontal=100 1");
- svg.printObjects();
- svg.erase(1);
- svg.printObjects();
- svg.erase(4);
- svg.translate("translate vertical=10 horizontal=100 ");
- svg.printObjects();
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement