Advertisement
LegoSosiska

Shiny Graphs

Apr 28th, 2022
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 24.32 KB | None | 0 0
  1. #include <SFML/Graphics.hpp>
  2. #include <SFML/Window.hpp>
  3. #include <algorithm>
  4. #include <cmath>
  5. #include <iostream>
  6. #include <queue>
  7. #include <vector>
  8. #include <stack>
  9.  
  10. sf::Color BackgroundColor = sf::Color(34, 40, 49), ElementColor = sf::Color(254, 233, 225),
  11. TextColor = sf::Color(232, 197, 71), ActionColor = sf::Color(217, 3, 104), GraphColor1 = sf::Color(80, 220, 100),
  12. GraphColor2 = sf::Color(70, 130, 191), GraphColor3 = sf::Color(157, 62, 70),
  13. FillColor = sf::Color(57, 62, 70), MeshColor = sf::Color(54, 60, 69);
  14.  
  15. const int plus = 1, minus = 2, mult = 3, divide = 4, power = 5, sinus = 6, cosinus = 7, sqarert = 8, lg = 9;
  16.  
  17.  
  18. struct cord {
  19.     double x = 0;
  20.     double y = 0;
  21.     int contains = 0;
  22. };
  23.  
  24. struct OperationTree {
  25.     float num = 0;
  26.     int sign = 0;
  27.     // -1 -- x, 0 -- none, 1 -- +, 2 -- -, 3 -- *, 4 -- /, 5 -- ^, 6 -- sin, 7 -- cos, 8 -- sqrt, 9 -- lg.
  28.  
  29.     OperationTree* root = nullptr;
  30.  
  31.     OperationTree* left = nullptr;
  32.     OperationTree* right = nullptr;
  33.     OperationTree* next = nullptr;
  34.  
  35.     bool check(cord& point, double precision) {
  36.         double y = value(root, point.x);
  37.         return y <= point.y + precision || y >= point.y - precision;
  38.     }
  39.  
  40.     float value(OperationTree* search, float x) {
  41.         if (search == nullptr) return 0;
  42.         if (search->sign > 0) {
  43.             if (search->sign == plus) {
  44.                 return value(search->left, x) + value(search->right, x);
  45.             }
  46.             if (search->sign == minus) {
  47.                 return value(search->left, x) - value(search->right, x);
  48.             }
  49.             if (search->sign == mult) {
  50.                 return value(search->left, x) * value(search->right, x);
  51.             }
  52.             if (search->sign == divide) {
  53.                 float left = value(search->left, x), right = value(search->right, x);
  54.                 if (right == 0) throw right;
  55.                 return left / right;
  56.             }
  57.             if (search->sign == power) {
  58.                 return pow(value(search->left, x), trunc(value(search->right, x)));
  59.             }
  60.             if (search->sign == sinus) {
  61.                 return std::sin(value(search->left, x));
  62.             }
  63.             if (search->sign == cosinus) {
  64.                 return std::cos(value(search->left, x));
  65.             }
  66.             if (search->sign == sqarert) {
  67.                 return std::sqrt(value(search->left, x));
  68.             }
  69.             if (search->sign == lg) {
  70.                 float val = value(search->left, x);
  71.                 if (val <= 0) throw val;
  72.                 return std::log10(val);
  73.             }
  74.         }
  75.         else {
  76.             return search->num;
  77.         }
  78.     }
  79.  
  80.     void placeValues(float x, OperationTree* search) {
  81.         if (search == nullptr) return;
  82.         if (search->sign == -1) search->num = x;
  83.         placeValues(x, search->left);
  84.         placeValues(x, search->right);
  85.     }
  86.  
  87.     int create(std::string string) {
  88.         std::stack<int> stack;
  89.  
  90.         OperationTree* process = nullptr;
  91.  
  92.         int num = 0;
  93.         bool lastnum = false;
  94.  
  95.         for (int i = 0; i < string.size(); ++i) {
  96.             char let = string[i];
  97.             if (let == ' ') continue;
  98.             if (let >= '0' && let <= '9') {
  99.                 num *= 10;
  100.                 num += let - '0';
  101.                 lastnum = true;
  102.             }
  103.             else if (let == 'x') {
  104.                 lastnum = true;
  105.                 if (num != 0) {
  106.                     OperationTree* numAdd = new OperationTree;
  107.                     numAdd->sign = -1;
  108.                     numAdd->next = process;
  109.                     process = numAdd;
  110.                 }
  111.                 else {
  112.                     num = -1;
  113.                 }
  114.             }
  115.             else {
  116.                 if (let == '(') {
  117.                     stack.push(-2);
  118.                     continue;
  119.                 }
  120.                 if (let == ')') {
  121.                     if (lastnum) {
  122.                         OperationTree* numAdd = new OperationTree;
  123.                         if (num == -1) {
  124.                             numAdd->sign = -1;
  125.                             numAdd->next = process;
  126.                             process = numAdd;
  127.                             num = 0;
  128.                         }
  129.                         else {
  130.                             numAdd->num = num;
  131.                             numAdd->next = process;
  132.                             process = numAdd;
  133.                             num = 0;
  134.                         }
  135.                         lastnum = false;
  136.                     }
  137.                     while (stack.size() != 0 && stack.top() != -2) {
  138.                         if (stack.top() < sinus) {
  139.                             if (process == nullptr) return 1;
  140.                             if (process->next == nullptr) return 2;
  141.                             OperationTree* left = process->next, * right = process;
  142.                             process = process->next->next;
  143.                             left->next = nullptr;
  144.                             right->next = nullptr;
  145.  
  146.                             OperationTree* newNode = new OperationTree;
  147.                             newNode->sign = stack.top();
  148.                             newNode->left = left;
  149.                             newNode->right = right;
  150.                             newNode->next = process;
  151.  
  152.                             process = newNode;
  153.  
  154.                             stack.pop();
  155.                             continue;
  156.                         }
  157.                         if (stack.top() >= sinus) {
  158.                             if (process == nullptr) return 1;
  159.                             OperationTree* left = process;
  160.                             process = process->next;
  161.                             left->next = nullptr;
  162.  
  163.                             OperationTree* newNode = new OperationTree;
  164.                             newNode->sign = stack.top();
  165.                             newNode->left = left;
  166.                             newNode->next = process;
  167.  
  168.                             process = newNode;
  169.  
  170.                             stack.pop();
  171.                             continue;
  172.                         }
  173.                     }
  174.                     if (stack.size() == 0) {
  175.                         return 4;
  176.                     }
  177.                     stack.pop();
  178.                     continue;
  179.                 }
  180.  
  181.                 int sign = -4;
  182.                 if (let == '+') sign = plus;
  183.                 if (let == '-') sign = minus;
  184.                 if (let == '*') sign = mult;
  185.                 if (let == '/') sign = divide;
  186.                 if (let == '^') sign = power;
  187.  
  188.                 if (let == 's') {
  189.                     let = string[++i];
  190.                     if (let == 'i') {
  191.                         let = string[++i];
  192.                         if (let == 'n') {
  193.                             sign = sinus;
  194.                         }
  195.                         else {
  196.                             return 3;
  197.                         }
  198.                     }
  199.                     else if (let == 'q') {
  200.                         let = string[++i];
  201.                         if (let == 'r') {
  202.                             let = string[++i];
  203.                             if (let == 't') {
  204.                                 sign = sqarert;
  205.                             }
  206.                             else {
  207.                                 return 7;
  208.                             }
  209.                         }
  210.                         else {
  211.                             return 8;
  212.                         }
  213.                     }
  214.                     else {
  215.                         return 9;
  216.                     }
  217.                 }
  218.                 else if (let == 'c') {
  219.                     let = string[++i];
  220.                     if (let == 'o') {
  221.                         let = string[++i];
  222.                         if (let == 's') {
  223.                             sign = cosinus;
  224.                         }
  225.                         else {
  226.                             return 10;
  227.                         }
  228.                     }
  229.                     else {
  230.                         return 11;
  231.                     }
  232.                 }
  233.                 else if (let == 'l') {
  234.                     let = string[++i];
  235.                     if (let == 'g') {
  236.                         sign = lg;
  237.                     }
  238.                     else {
  239.                         return 12;
  240.                     }
  241.                 }
  242.  
  243.                 if (lastnum) {
  244.                     OperationTree* numAdd = new OperationTree;
  245.                     if (num == -1) {
  246.                         numAdd->sign = -1;
  247.                         numAdd->next = process;
  248.                         process = numAdd;
  249.                         num = 0;
  250.                     }
  251.                     else {
  252.                         numAdd->num = num;
  253.                         numAdd->next = process;
  254.                         process = numAdd;
  255.                         num = 0;
  256.                     }
  257.                     lastnum = false;
  258.                 }
  259.  
  260.                 if (stack.size() == 0) {
  261.                     stack.push(sign);
  262.                     continue;
  263.                 }
  264.  
  265.                 if (sign == -4) {
  266.                     return 6;
  267.                 }
  268.  
  269.                 if (stack.top() >= sign && stack.top() < sinus) {
  270.                     if (process == nullptr) return 1;
  271.                     if (process->next == nullptr) return 2;
  272.                     OperationTree* left = process->next, * right = process;
  273.                     process = process->next->next;
  274.                     left->next = nullptr;
  275.                     right->next = nullptr;
  276.  
  277.                     OperationTree* newNode = new OperationTree;
  278.                     newNode->sign = stack.top();
  279.                     newNode->left = left;
  280.                     newNode->right = right;
  281.                     newNode->next = process;
  282.  
  283.                     process = newNode;
  284.  
  285.                     stack.pop();
  286.                     stack.push(sign);
  287.                     continue;
  288.                 }
  289.                 if (stack.top() >= sinus) {
  290.                     if (process == nullptr) return 1;
  291.                     OperationTree* left = process;
  292.                     process = process->next;
  293.                     left->next = nullptr;
  294.  
  295.                     OperationTree* newNode = new OperationTree;
  296.                     newNode->sign = stack.top();
  297.                     newNode->left = left;
  298.                     newNode->next = process;
  299.  
  300.                     process = newNode;
  301.  
  302.                     stack.pop();
  303.                     stack.push(sign);
  304.                     continue;
  305.                 }
  306.                 stack.push(sign);
  307.  
  308.             }
  309.         }
  310.         if (stack.size() != 0) {
  311.             if (lastnum) {
  312.                 OperationTree* numAdd = new OperationTree;
  313.                 if (num == -1) {
  314.                     numAdd->sign = -1;
  315.                     numAdd->next = process;
  316.                     process = numAdd;
  317.                     num = 0;
  318.                 }
  319.                 else {
  320.                     numAdd->num = num;
  321.                     numAdd->next = process;
  322.                     process = numAdd;
  323.                     num = 0;
  324.                 }
  325.                 lastnum = false;
  326.             }
  327.             while (stack.size() != 0) {
  328.                 if (stack.top() < 0) {
  329.                     return 5;
  330.                 }
  331.                 if (stack.top() < sinus) {
  332.                     if (process == nullptr) return 1;
  333.                     if (process->next == nullptr) return 2;
  334.                     OperationTree* left = process->next, * right = process;
  335.                     process = process->next->next;
  336.                     left->next = nullptr;
  337.                     right->next = nullptr;
  338.  
  339.                     OperationTree* newNode = new OperationTree;
  340.                     newNode->sign = stack.top();
  341.                     newNode->left = left;
  342.                     newNode->right = right;
  343.                     newNode->next = process;
  344.  
  345.                     process = newNode;
  346.  
  347.                     stack.pop();
  348.                     continue;
  349.                 }
  350.                 if (stack.top() >= sinus) {
  351.                     if (process == nullptr) return 1;
  352.                     OperationTree* left = process;
  353.                     process = process->next;
  354.                     left->next = nullptr;
  355.  
  356.                     OperationTree* newNode = new OperationTree;
  357.                     newNode->sign = stack.top();
  358.                     newNode->left = left;
  359.                     newNode->next = process;
  360.  
  361.                     process = newNode;
  362.  
  363.                     stack.pop();
  364.                     continue;
  365.                 }
  366.             }
  367.         }
  368.         if (lastnum) {
  369.             OperationTree* numAdd = new OperationTree;
  370.             if (num == -1) {
  371.                 numAdd->sign = -1;
  372.                 numAdd->next = process;
  373.                 process = numAdd;
  374.                 num = 0;
  375.             }
  376.             else {
  377.                 numAdd->num = num;
  378.                 numAdd->next = process;
  379.                 process = numAdd;
  380.                 num = 0;
  381.             }
  382.             lastnum = false;
  383.         }
  384.         root = process;
  385.         return 0;
  386.     }
  387.    
  388. };
  389.  
  390. /*void Recolor(sf::VertexArray& field, std::vector<cord> matrix, cord start, cord finish, double precision) {
  391.     for (double i = start.x / precision; i < finish.x / precision; ++i) {
  392.         for (double j = start.y; j < finish.y * precision; ++j) {
  393.             if (matrix[i * j].contains == 1) {
  394.                 field[i * j].color = GraphColor1;
  395.             }
  396.             else if (matrix[i * j].contains == 2) {
  397.                 field[i * j].color = GraphColor2;
  398.             }
  399.             else if (matrix[i * j].contains == 3) {
  400.                 field[i * j].color = GraphColor3;
  401.             }
  402.             else {
  403.                 field[i * j].color = BackgroundColor;
  404.             }
  405.         }
  406.     }
  407. }*/
  408.  
  409. void ColorGraphs(sf::VertexArray& graph1, sf::VertexArray& graph2, sf::VertexArray& graph3, cord range, float precision) {
  410.     for (int i = 0; i < range.x * 2 / precision; ++i) {
  411.         graph1[i].color = GraphColor1;
  412.     }
  413.     for (int i = 0; i < range.x * 2 / precision; ++i) {
  414.         graph2[i].color = GraphColor2;
  415.     }
  416.     for (int i = 0; i < range.x * 2 / precision; ++i) {
  417.         graph3[i].color = GraphColor3;
  418.     }
  419. }
  420.  
  421. void BuildGraph(std::string string, sf::VertexArray& graph, cord range, float precision) {
  422.     OperationTree* tree = new OperationTree;
  423.     int k = tree->create(string);
  424.     if (k != 0) {
  425.         std::cout << "error number " << k;
  426.         return;
  427.     }
  428.     int i = 0;
  429.     for (float x = -range.x; x < range.x /*&& i < range.x * 2 / precision*/; x += precision) {
  430.         tree->placeValues(x, tree->root);
  431.         float y;
  432.         try {
  433.             y = tree->value(tree->root, x);
  434.         }
  435.         catch (float err) {
  436.             y = 0;
  437.         }
  438.         sf::Vector2f pos = { x / precision, -y / precision };
  439.         graph[i].position = pos;
  440.         ++i;
  441.     }
  442. }
  443.  
  444. void CreateMesh(sf::VertexArray& mesh1, sf::VertexArray& mesh2, cord range, float precision) {
  445.     int i = 0;
  446.     for (float x = -range.x; x < range.x /*&& i < range.x * 2 / precision*/; x += precision * 512) {
  447.         if (x == 0) {
  448.             mesh1[i].position = sf::Vector2f(x, -range.y);
  449.             mesh1[i].color = TextColor;
  450.             ++i;
  451.             mesh1[i].position = sf::Vector2f(x, range.y);
  452.             mesh1[i].color = TextColor;
  453.             ++i;
  454.             continue;
  455.         }
  456.         mesh1[i].position = sf::Vector2f(x, -range.y);
  457.         mesh1[i].color = MeshColor;
  458.         ++i;
  459.         mesh1[i].position = sf::Vector2f(x, range.y);
  460.         mesh1[i].color = MeshColor;
  461.         ++i;
  462.     }
  463.     i = 0;
  464.     for (float x = -range.x; x < range.x /*&& i < range.x * 2 / precision*/; x += precision * 512) {
  465.         if (x == 0) {
  466.             mesh2[i].position = sf::Vector2f(-range.y, x);
  467.             mesh2[i].color = TextColor;
  468.             ++i;
  469.             mesh2[i].position = sf::Vector2f(range.y, x);
  470.             mesh2[i].color = TextColor;
  471.             ++i;
  472.             continue;
  473.         }
  474.         mesh2[i].position = sf::Vector2f(-range.y, x);
  475.         mesh2[i].color = MeshColor;
  476.         ++i;
  477.         mesh2[i].position = sf::Vector2f(range.y, x);
  478.         mesh2[i].color = MeshColor;
  479.         ++i;
  480.     }
  481. }
  482.  
  483. void UpdateText(sf::Text& text, std::string s) { text.setString(s); }
  484.  
  485. int main() {
  486.     float precision = 0.03125;
  487.     cord range;
  488.     range.x = 512;
  489.     range.y = 512;
  490.     int selected = 0;
  491.  
  492.     sf::RenderWindow window(sf::VideoMode(1000, 1000), "FREE CUPA CHUPA", sf::Style::Titlebar | sf::Style::Close);
  493.  
  494.     std::string graphString1, graphString2, graphString3;
  495.     sf::VertexArray graph1(sf::LinesStrip, range.x * 2 / precision), graph2(sf::LinesStrip, range.x * 2 / precision), graph3(sf::LinesStrip, range.x * 2 / precision);
  496.     std::vector<cord> matrix(range.x * range.y * 4 / precision);
  497.     sf::VertexArray mesh1(sf::Lines, range.x * 4 / precision / 512), mesh2(sf::Lines, range.x * 4 / precision / 512);
  498.  
  499.     sf::RectangleShape addNodeBox, removeNodeBox, addNBox;
  500.     sf::Text grapText1, grapText2, grapText3;
  501.  
  502.     grapText1.setPosition(22, 944);
  503.     grapText2.setPosition(342, 944);
  504.     grapText3.setPosition(662, 944);
  505.  
  506.     grapText3.setOutlineThickness(2);
  507.     grapText1.setOutlineThickness(2);
  508.     grapText1.setFillColor(TextColor);
  509.     grapText3.setFillColor(TextColor);
  510.     grapText2.setOutlineThickness(2);
  511.     grapText2.setFillColor(TextColor);
  512.  
  513.     addNodeBox.setSize(sf::Vector2f(300, 30));
  514.     removeNodeBox.setSize(sf::Vector2f(300, 30));
  515.     addNBox.setSize(sf::Vector2f(300, 30));
  516.  
  517.     addNodeBox.setPosition(20, 950);
  518.     removeNodeBox.setPosition(340, 950);
  519.     addNBox.setPosition(660, 950);
  520.  
  521.     addNodeBox.setOutlineThickness(2);
  522.     addNodeBox.setOutlineColor(ElementColor);
  523.     addNodeBox.setFillColor(FillColor);
  524.     removeNodeBox.setOutlineThickness(2);
  525.     removeNodeBox.setOutlineColor(ElementColor);
  526.     removeNodeBox.setFillColor(FillColor);
  527.     addNBox.setOutlineThickness(2);
  528.     addNBox.setOutlineColor(ElementColor);
  529.     addNBox.setFillColor(FillColor);
  530.  
  531.     sf::Font* font = new sf::Font;
  532.     if (!font->loadFromFile("UbuntuMono-Regular.ttf")) {
  533.         std::cout << "err\n";
  534.     }
  535.  
  536.     grapText3.setFont(*font);
  537.     grapText1.setFont(*font);
  538.     grapText2.setFont(*font);
  539.  
  540.     ColorGraphs(graph1, graph2, graph3, range, precision);
  541.     CreateMesh(mesh1, mesh2, range, precision);
  542.  
  543.     sf::View view(sf::Vector2f(0, 0), sf::Vector2f(1000, 1000));
  544.     view.zoom(0.6);
  545.  
  546.     /*std::string s;
  547.     std::cin >> s;
  548.     OperationTree* tree = new OperationTree;
  549.     int k = tree->create(s);
  550.     if (k != 0) {
  551.         std::cout << k << " err";
  552.         return 0;
  553.     }
  554.     while (true) {
  555.         float i;
  556.         std::cin >> i;
  557.         tree->placeValues(i, tree->root);
  558.         std::cout << tree->value(tree->root, i) << "\n";
  559.     }*/
  560.  
  561.     while (window.isOpen()) {
  562.         sf::Event event;
  563.  
  564.         while (window.pollEvent(event))
  565.         {
  566.             if (event.type == sf::Event::TextEntered) {
  567.                 if (event.text.unicode != 8 && event.text.unicode != 9 && event.text.unicode != 13) {
  568.                     if (selected == 1) {
  569.                         graphString1 += event.text.unicode;
  570.                         UpdateText(grapText1, graphString1);
  571.                     }
  572.                     if (selected == 2) {
  573.                         graphString2 += event.text.unicode;
  574.                         UpdateText(grapText2, graphString2);
  575.                     }
  576.                     if (selected == 3) {
  577.                         graphString3 += event.text.unicode;
  578.                         UpdateText(grapText3, graphString3);
  579.                     }
  580.                 }
  581.             }
  582.  
  583.             if (event.type == sf::Event::KeyPressed) {
  584.                 if (event.key.code == sf::Keyboard::BackSpace) {
  585.                     if (selected == 1) {
  586.                         if (graphString1.size() > 0) {
  587.                             graphString1.pop_back();
  588.                             UpdateText(grapText1, graphString1);
  589.                         }
  590.                     }
  591.                     if (selected == 2) {
  592.                         if (graphString2.size() > 0) {
  593.                             graphString2.pop_back();
  594.                             UpdateText(grapText2, graphString2);
  595.                         }
  596.                     }
  597.                     if (selected == 3) {
  598.                         if (graphString3.size() > 0) {
  599.                             graphString3.pop_back();
  600.                             UpdateText(grapText3, graphString3);
  601.                         }
  602.                     }
  603.                 }
  604.                 if (event.key.code == sf::Keyboard::Enter) {
  605.                     if (selected == 1) {
  606.                         BuildGraph(graphString1, graph1, range, precision);
  607.                     }
  608.                     if (selected == 2) {
  609.                         BuildGraph(graphString2, graph2, range, precision);
  610.                     }
  611.                     if (selected == 3) {
  612.                         BuildGraph(graphString3, graph3, range, precision);
  613.                     }
  614.                     selected = 0;
  615.                     removeNodeBox.setOutlineColor(ElementColor);
  616.                     addNodeBox.setOutlineColor(ElementColor);
  617.                     addNBox.setOutlineColor(ElementColor);
  618.                 }
  619.                 if (event.key.code == sf::Keyboard::P) {
  620.                     view.zoom(0.9);          
  621.                 }
  622.                 if (event.key.code == sf::Keyboard::O) {
  623.                     view.zoom(1.1);
  624.                 }
  625.                 if (event.key.code == sf::Keyboard::Up) {
  626.                     view.move(0, -10 * view.getSize().x / 500);
  627.                    
  628.                 }
  629.                 if (event.key.code == sf::Keyboard::Down) {
  630.                     view.move(0, 10 * view.getSize().x / 500);
  631.                 }
  632.                 if (event.key.code == sf::Keyboard::Left) {
  633.                     view.move(-10 * view.getSize().x / 500, 0);
  634.                 }
  635.                 if (event.key.code == sf::Keyboard::Right) {
  636.                     view.move(10 * view.getSize().x / 500, 0);
  637.                 }
  638.             }
  639.  
  640.             if (event.type == sf::Event::MouseButtonPressed) {
  641.                 if (addNodeBox.getGlobalBounds().contains(event.mouseButton.x,
  642.                     event.mouseButton.y)) {
  643.                     selected = 1;
  644.                     addNodeBox.setOutlineColor(ActionColor);
  645.                     removeNodeBox.setOutlineColor(ElementColor);
  646.                     addNBox.setOutlineColor(ElementColor);
  647.                 }
  648.                 else if (removeNodeBox.getGlobalBounds().contains(event.mouseButton.x,
  649.                     event.mouseButton.y)) {
  650.                     selected = 2;
  651.                     removeNodeBox.setOutlineColor(ActionColor);
  652.                     addNodeBox.setOutlineColor(ElementColor);
  653.                     addNBox.setOutlineColor(ElementColor);
  654.                 }
  655.                 else if (addNBox.getGlobalBounds().contains(event.mouseButton.x,
  656.                     event.mouseButton.y)) {
  657.                     selected = 3;
  658.                     addNBox.setOutlineColor(ActionColor);
  659.                     addNodeBox.setOutlineColor(ElementColor);
  660.                     removeNodeBox.setOutlineColor(ElementColor);
  661.                 }
  662.                 else {
  663.                     selected = 0;
  664.                     removeNodeBox.setOutlineColor(ElementColor);
  665.                     addNodeBox.setOutlineColor(ElementColor);
  666.                     addNBox.setOutlineColor(ElementColor);
  667.                 }
  668.             }
  669.  
  670.             if (event.type == sf::Event::Closed) {
  671.                 window.close();
  672.             }
  673.         }
  674.  
  675.         window.clear(BackgroundColor);
  676.  
  677.         window.setView(view);
  678.  
  679.         window.draw(mesh1);
  680.         window.draw(mesh2);
  681.         window.draw(graph1);
  682.         window.draw(graph2);
  683.         window.draw(graph3);
  684.  
  685.         window.setView(window.getDefaultView());
  686.  
  687.         window.draw(addNodeBox);
  688.         window.draw(addNBox);
  689.         window.draw(removeNodeBox);
  690.  
  691.         window.draw(grapText1);
  692.         window.draw(grapText3);
  693.         window.draw(grapText2);
  694.  
  695.         window.display();
  696.     }
  697. }
  698.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement