115 result.push_back({tri->element.p1, tri->element.p2, tri->element.p3}); |
115 result.push_back({tri->element.p1, tri->element.p2, tri->element.p3}); |
116 } |
116 } |
117 else if (const Colored<Quadrilateral>* quad = std::get_if<Colored<Quadrilateral>>(&newElement)) { |
117 else if (const Colored<Quadrilateral>* quad = std::get_if<Colored<Quadrilateral>>(&newElement)) { |
118 result.push_back({quad->element.p1, quad->element.p2, quad->element.p3, quad->element.p4}); |
118 result.push_back({quad->element.p1, quad->element.p2, quad->element.p3, quad->element.p4}); |
119 } |
119 } |
120 else if (const Colored<CircularPrimitive>* circ = std::get_if<Colored<CircularPrimitive>>(&newElement)) { |
120 else if (const Colored<circular_primitive>* circ = std::get_if<Colored<circular_primitive>>(&newElement)) { |
121 // rasterize the circle down to polygons, and append them to the result. |
121 // rasterize the circle down to polygons, and append them to the result. |
122 rasterize(circ->element, [&](const PlainPolygonElement& poly, const ColorIndex color){ |
122 circular_element_to_polygons(circ->element, [&](const PlainPolygonElement& poly, const ColorIndex color){ |
123 AppendToModel append{elementFromPolygonAndColor(poly, color)}; |
123 AppendToModel append{elementFromPolygonAndColor(poly, color)}; |
124 const auto& subpoints = polygonsToBeInserted(append); |
124 const auto& subpoints = polygonsToBeInserted(append); |
125 std::copy(subpoints.begin(), subpoints.end(), std::back_inserter(result)); |
125 std::copy(subpoints.begin(), subpoints.end(), std::back_inserter(result)); |
126 }); |
126 }); |
127 } |
127 } |
333 glm::vec4{x, 0}, |
333 glm::vec4{x, 0}, |
334 *cyliheight * this->gridMatrix[2], |
334 *cyliheight * this->gridMatrix[2], |
335 glm::vec4{glm::cross(glm::vec3{-this->gridMatrix[2]}, x), 0}, |
335 glm::vec4{glm::cross(glm::vec3{-this->gridMatrix[2]}, x), 0}, |
336 glm::vec4{this->inputPolygon[0], 1}, |
336 glm::vec4{this->inputPolygon[0], 1}, |
337 }; |
337 }; |
338 Colored<CircularPrimitive> circ{ |
338 Colored<circular_primitive> circ{ |
339 CircularPrimitive{ |
339 circular_primitive{ |
340 .type = this->circleToolOptions.type, |
340 .type = this->circleToolOptions.type, |
341 .fraction = this->circleToolOptions.fraction, |
341 .fraction = this->circleToolOptions.fraction, |
342 .transformation = transform, |
342 .transformation = transform, |
343 }, |
343 }, |
344 MAIN_COLOR |
344 MAIN_COLOR |