/************************************************************************** ** Title: demo program for some inheritance in reference elements ** Date: 7.11.2007 ** Copyright: Bernard Haasdonk **************************************************************************/ /************** desired output after class implementation: *************** --------------------------------------- type information : polygon number of vertices: 6 vertex 0 has coordinates (x,y) = (0,0) vertex 1 has coordinates (x,y) = (1,0) vertex 2 has coordinates (x,y) = (2,1) vertex 3 has coordinates (x,y) = (1,2) vertex 4 has coordinates (x,y) = (0,2) vertex 5 has coordinates (x,y) = (-1,1) circumference : 7.65685 --------------------------------------- type information : reference triangle number of vertices: 3 vertex 0 has coordinates (x,y) = (0,0) vertex 1 has coordinates (x,y) = (1,0) vertex 2 has coordinates (x,y) = (0,1) circumference : 3.41421 --------------------------------------- type information : reference square number of vertices: 4 vertex 0 has coordinates (x,y) = (0,0) vertex 1 has coordinates (x,y) = (1,0) vertex 2 has coordinates (x,y) = (1,1) vertex 3 has coordinates (x,y) = (0,1) circumference : 4 ***************** end of desired output **********************/ #include "reference_elements.hh" #include using namespace std; void print_info(Polygon& poly) { cout << "type information : "; poly.print_type(); cout << "\n"; int nvertices = poly.nvertices(); cout << "number of vertices: " << nvertices << "\n"; double x,y; for (int v=0; v