Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vertex
- {
- double x, y;
- };
- class Node : Vertex
- {
- massa;
- specifika;
- variabler;
- };
- class Polygon
- {
- virtual vector<Vertex*> vertices; //<-- Typ nåt sånt, om det gick.
- //Dvs. alla barn har en vector med Vertex
- //eller med barn till Vertex.
- };
- class Polygoon : Polygon
- {
- vector<Node*> vertices;
- };
- draw_polygon(Polygon* pol)
- {
- Vertex a;
- a.x = pol->vertices[1]->x - pol->vertices[0]->x;
- a.y = pol->vertices[1]->y - pol->vertices[0]->y;
- ... //osv osv
- }
Add Comment
Please, Sign In to add comment