mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Layers editing profile's background texture rendering
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - A few fixes in layers editing profile rendering (cherry picked from commit prusa3d/PrusaSlicer@a939d8e4c0) (cherry picked from commit prusa3d/PrusaSlicer@8c807dbcc4)
This commit is contained in:
parent
354f8e20fb
commit
35899b96ba
6 changed files with 89 additions and 97 deletions
|
@ -24,6 +24,15 @@ void GLModel::Geometry::add_vertex(const Vec2f& position)
|
|||
vertices.emplace_back(position.y());
|
||||
}
|
||||
|
||||
void GLModel::Geometry::add_vertex(const Vec2f& position, const Vec2f& tex_coord)
|
||||
{
|
||||
assert(format.vertex_layout == EVertexLayout::P2T2);
|
||||
vertices.emplace_back(position.x());
|
||||
vertices.emplace_back(position.y());
|
||||
vertices.emplace_back(tex_coord.x());
|
||||
vertices.emplace_back(tex_coord.y());
|
||||
}
|
||||
|
||||
void GLModel::Geometry::add_vertex(const Vec3f& position)
|
||||
{
|
||||
assert(format.vertex_layout == EVertexLayout::P3);
|
||||
|
@ -331,8 +340,11 @@ bool GLModel::Geometry::has_tex_coord(const Format& format)
|
|||
|
||||
void GLModel::init_from(Geometry&& data)
|
||||
{
|
||||
if (is_initialized()) // call reset() if you want to reuse this model
|
||||
if (is_initialized()) {
|
||||
// call reset() if you want to reuse this model
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.vertices.empty() || data.indices.empty()) {
|
||||
assert(false);
|
||||
|
@ -353,10 +365,18 @@ void GLModel::init_from(Geometry&& data)
|
|||
}
|
||||
}
|
||||
|
||||
void GLModel::init_from(const TriangleMesh& mesh)
|
||||
{
|
||||
init_from(mesh.its);
|
||||
}
|
||||
|
||||
void GLModel::init_from(const indexed_triangle_set& its)
|
||||
{
|
||||
if (is_initialized()) // call reset() if you want to reuse this model
|
||||
if (is_initialized()) {
|
||||
// call reset() if you want to reuse this model
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (its.vertices.empty() || its.indices.empty()){
|
||||
assert(false);
|
||||
|
@ -389,8 +409,11 @@ void GLModel::init_from(const indexed_triangle_set& its)
|
|||
|
||||
void GLModel::init_from(const Polygons& polygons, float z)
|
||||
{
|
||||
if (is_initialized()) // call reset() if you want to reuse this model
|
||||
if (is_initialized()) {
|
||||
// call reset() if you want to reuse this model
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (polygons.empty()) {
|
||||
assert(false);
|
||||
|
@ -443,8 +466,7 @@ bool GLModel::init_from_file(const std::string& filename)
|
|||
return false;
|
||||
}
|
||||
|
||||
const TriangleMesh mesh = model.mesh();
|
||||
init_from(mesh.its);
|
||||
init_from(model.mesh());
|
||||
|
||||
m_filename = filename;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue