Guest User

Untitled

a guest
Jun 17th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. class Vertex
  2. {
  3.     double x, y;
  4. };
  5.  
  6. class Node : Vertex
  7. {
  8.     massa;
  9.     specifika;
  10.     variabler;
  11. };
  12.  
  13. class Polygon
  14. {
  15.     virtual vector<Vertex*> vertices;   //<-- Typ nåt sånt, om det gick.
  16.                         //Dvs. alla barn har en vector med Vertex
  17.                         //eller med barn till Vertex.
  18. };
  19.  
  20. class Polygoon : Polygon
  21. {
  22.     vector<Node*> vertices;
  23. };
  24.  
  25. draw_polygon(Polygon* pol)
  26. {
  27.     Vertex a;
  28.     a.x = pol->vertices[1]->x - pol->vertices[0]->x;
  29.     a.y = pol->vertices[1]->y - pol->vertices[0]->y;
  30.    
  31.     ... //osv osv
  32. }
Add Comment
Please, Sign In to add comment