1st installment of ModelInstance 3D scale components

This commit is contained in:
Enrico Turri
2018-09-24 15:54:09 +02:00
parent e3d44b07fe
commit 0e1843a871
26 changed files with 558 additions and 9 deletions

View File

@@ -431,7 +431,14 @@ void Print::add_model_object(ModelObject* model_object, int idx)
std::vector<std::string> v_scale;
for (const PrintObject *object : m_objects) {
const ModelObject &mobj = *object->model_object();
v_scale.push_back(boost::lexical_cast<std::string>(mobj.instances[0]->scaling_factor*100) + "%");
#if ENABLE_MODELINSTANCE_3D_SCALE
// CHECK_ME -> Is the following correct ?
v_scale.push_back("x:" + boost::lexical_cast<std::string>(mobj.instances[0]->get_scaling_factor(X) * 100) +
"% y:" + boost::lexical_cast<std::string>(mobj.instances[0]->get_scaling_factor(Y) * 100) +
"% z:" + boost::lexical_cast<std::string>(mobj.instances[0]->get_scaling_factor(Z) * 100) + "%");
#else
v_scale.push_back(boost::lexical_cast<std::string>(mobj.instances[0]->scaling_factor * 100) + "%");
#endif // ENABLE_MODELINSTANCE_3D_SCALE
if (input_file.empty())
input_file = mobj.input_file;
}