void init1() { OGraphic *o1,*o2; o1 = new OPoint(1,1); o1->print(); o2 = new OLine(1,1,8,8); o2->print(); o1->~OGraphic(); o2->~OGraphic(); } //de
void copy() { OGraphic *o1 = new OPoint(1,2); o1->print(); OGraphic *o2 = o1->clone(); o1->~OGraphic(); // o2->print(); o2->~OGraphic(); } //de
void init2() { OPoint *o1 = new OPoint(5,1); cout << o1->getX() << endl; OLine *o2 = new OLine(1,1,8,8); cout << o2->getLength() << endl; o1->~OPoint(); o2->~OLine(); } //de
void init3() { OPoint o1(5,1); cout << o1.getX() << endl; OLine o2(1,1,8,8); cout << o2.getLength() << endl; } //de
void rw() { OGraphic* p; OPoint ptb(50,50),ptc(100,50),pte(100,100); p = new OArc(ptb,ptc,pte,false); gomWrite(p,"es.gom"); xmlWrite(p,"es.xml"); svgWrite(p,"es.svg"); p->~OGraphic(); p = gomRead("es.gom"); p->print(); } //de
void dynamic() { OGraphic* p; OPoint ptb(50,50),ptc(100,50),pte(100,100); p = new OArc(ptb,ptc,pte,false); gomWrite(p,"es.gom"); p->~OGraphic(); p = gomRead("es.gom"); if(p->getName()=="OArc") { OArc *a = castOArc(p); cout << a->getRadius() << endl; a->~OArc(); } else p->~OGraphic(); } //de