mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 06:04:01 -06:00
Code cleanup and small refactoring
This commit is contained in:
parent
39ec1a6318
commit
c471c3c7c4
2 changed files with 51 additions and 41 deletions
|
@ -288,6 +288,7 @@ class GCodeViewer
|
|||
#if ENABLE_SEAMS_USING_MODELS
|
||||
struct Model
|
||||
{
|
||||
#if !ENABLE_SEAMS_USING_INSTANCED_MODELS
|
||||
struct Instance
|
||||
{
|
||||
Vec3f position;
|
||||
|
@ -296,12 +297,14 @@ class GCodeViewer
|
|||
size_t s_id;
|
||||
};
|
||||
using Instances = std::vector<Instance>;
|
||||
#endif // !ENABLE_SEAMS_USING_INSTANCED_MODELS
|
||||
|
||||
GLModel model;
|
||||
Color color;
|
||||
Instances instances;
|
||||
#if ENABLE_SEAMS_USING_INSTANCED_MODELS
|
||||
InstanceVBuffer instances2;
|
||||
InstanceVBuffer instances;
|
||||
#else
|
||||
Instances instances;
|
||||
#endif // ENABLE_SEAMS_USING_INSTANCED_MODELS
|
||||
|
||||
void reset();
|
||||
|
@ -367,7 +370,11 @@ class GCodeViewer
|
|||
case ERenderPrimitiveType::Triangle: {
|
||||
return !vertices.vbos.empty() && vertices.vbos.front() != 0 && !indices.empty() && indices.front().ibo != 0;
|
||||
}
|
||||
#if ENABLE_SEAMS_USING_INSTANCED_MODELS
|
||||
case ERenderPrimitiveType::Model: { return model.model.is_initialized() && !model.instances.buffer.empty(); }
|
||||
#else
|
||||
case ERenderPrimitiveType::Model: { return model.model.is_initialized() && !model.instances.empty(); }
|
||||
#endif // ENABLE_SEAMS_USING_INSTANCED_MODELS
|
||||
default: { return false; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue