mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Another refactoring to simplify client code of GLModel::Geometry
(cherry picked from commit prusa3d/PrusaSlicer@fa1ff1c357)
This commit is contained in:
parent
8107057e17
commit
12dbbf2d1c
8 changed files with 26 additions and 26 deletions
|
@ -1661,8 +1661,7 @@ void TriangleSelectorGUI::update_paint_contour()
|
|||
|
||||
GLModel::Geometry init_data;
|
||||
const std::vector<Vec2i> contour_edges = this->get_seed_fill_contour();
|
||||
const GLModel::Geometry::EIndexType index_type = (2 * contour_edges.size() < 65536) ? GLModel::Geometry::EIndexType::USHORT : GLModel::Geometry::EIndexType::UINT;
|
||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, index_type };
|
||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::index_type(2 * contour_edges.size()) };
|
||||
init_data.reserve_vertices(2 * contour_edges.size());
|
||||
init_data.reserve_indices(2 * contour_edges.size());
|
||||
// vertices + indices
|
||||
|
@ -1671,7 +1670,7 @@ void TriangleSelectorGUI::update_paint_contour()
|
|||
init_data.add_vertex(m_vertices[edge(0)].v);
|
||||
init_data.add_vertex(m_vertices[edge(1)].v);
|
||||
vertices_count += 2;
|
||||
if (index_type == GLModel::Geometry::EIndexType::USHORT)
|
||||
if (init_data.format.index_type == GLModel::Geometry::EIndexType::USHORT)
|
||||
init_data.add_ushort_line((unsigned short)vertices_count - 2, (unsigned short)vertices_count - 1);
|
||||
else
|
||||
init_data.add_uint_line(vertices_count - 2, vertices_count - 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue