mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 02:25:51 +08:00
added getString() methods to ConfigOptionFloat and ConfigOptionInt
This commit is contained in:
parent
49f123ca20
commit
28504f9658
@ -11,6 +11,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "libslic3r.h"
|
#include "libslic3r.h"
|
||||||
|
#include "utils.hpp"
|
||||||
#include "Point.hpp"
|
#include "Point.hpp"
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
@ -104,6 +105,7 @@ class ConfigOptionFloat : public ConfigOptionSingle<double>
|
|||||||
double getFloat() const { return this->value; };
|
double getFloat() const { return this->value; };
|
||||||
void setFloat(double val) { this->value = val; }
|
void setFloat(double val) { this->value = val; }
|
||||||
void setInt(int val) { this->value = val; }
|
void setInt(int val) { this->value = val; }
|
||||||
|
std::string getString() const override { return trim_zeroes(std::to_string(this->value)); }
|
||||||
|
|
||||||
std::string serialize() const {
|
std::string serialize() const {
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
@ -169,6 +171,7 @@ class ConfigOptionInt : public ConfigOptionSingle<int>
|
|||||||
|
|
||||||
int getInt() const { return this->value; };
|
int getInt() const { return this->value; };
|
||||||
void setInt(int val) { this->value = val; };
|
void setInt(int val) { this->value = val; };
|
||||||
|
std::string getString() const override { return std::to_string(this->value); }
|
||||||
|
|
||||||
std::string serialize() const {
|
std::string serialize() const {
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user