mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-01 16:38:43 +03:00
PRUSA 2.7.0
This commit is contained in:
@@ -26,14 +26,6 @@ struct FontProp
|
||||
// When not set value is zero and is not stored
|
||||
std::optional<int> line_gap; // [in font point]
|
||||
|
||||
// Z depth of text
|
||||
float emboss; // [in mm]
|
||||
|
||||
// Flag that text should use surface cutted from object
|
||||
// FontProp::distance should without value
|
||||
// FontProp::emboss should be positive number
|
||||
// Note: default value is false
|
||||
bool use_surface;
|
||||
|
||||
// positive value mean wider character shape
|
||||
// negative value mean tiner character shape
|
||||
@@ -45,16 +37,6 @@ struct FontProp
|
||||
// When not set value is zero and is not stored
|
||||
std::optional<float> skew; // [ration x:y]
|
||||
|
||||
// distance from surface point
|
||||
// used for move over model surface
|
||||
// When not set value is zero and is not stored
|
||||
std::optional<float> distance; // [in mm]
|
||||
|
||||
// Angle of rotation around emboss direction (Z axis)
|
||||
// It is calculate on the fly from volume world transformation
|
||||
// only StyleManager keep actual value for comparision with style
|
||||
// When not set value is zero and is not stored
|
||||
std::optional<float> angle; // [in radians] form -Pi to Pi
|
||||
|
||||
// Parameter for True Type Font collections
|
||||
// Select index of font in collection
|
||||
@@ -92,54 +74,38 @@ struct FontProp
|
||||
/// </summary>
|
||||
/// <param name="line_height">Y size of text [in mm]</param>
|
||||
/// <param name="depth">Z size of text [in mm]</param>
|
||||
FontProp(float line_height = 10.f, float depth = 2.f) : emboss(depth), size_in_mm(line_height), use_surface(false), per_glyph(false)
|
||||
FontProp(float line_height = 10.f) : size_in_mm(line_height), per_glyph(false)
|
||||
{}
|
||||
|
||||
bool operator==(const FontProp& other) const {
|
||||
return
|
||||
char_gap == other.char_gap &&
|
||||
line_gap == other.line_gap &&
|
||||
use_surface == other.use_surface &&
|
||||
per_glyph == other.per_glyph &&
|
||||
align == other.align &&
|
||||
is_approx(emboss, other.emboss) &&
|
||||
is_approx(size_in_mm, other.size_in_mm) &&
|
||||
is_approx(boldness, other.boldness) &&
|
||||
is_approx(skew, other.skew) &&
|
||||
is_approx(distance, other.distance) &&
|
||||
is_approx(angle, other.angle);
|
||||
is_approx(skew, other.skew);
|
||||
}
|
||||
|
||||
// undo / redo stack recovery
|
||||
template<class Archive> void save(Archive &ar) const
|
||||
{
|
||||
ar(emboss, use_surface, size_in_mm, per_glyph, align.first, align.second);
|
||||
ar(size_in_mm, per_glyph, align.first, align.second);
|
||||
cereal::save(ar, char_gap);
|
||||
cereal::save(ar, line_gap);
|
||||
cereal::save(ar, boldness);
|
||||
cereal::save(ar, skew);
|
||||
cereal::save(ar, distance);
|
||||
cereal::save(ar, angle);
|
||||
cereal::save(ar, collection_number);
|
||||
cereal::save(ar, family);
|
||||
cereal::save(ar, face_name);
|
||||
cereal::save(ar, style);
|
||||
cereal::save(ar, weight);
|
||||
}
|
||||
template<class Archive> void load(Archive &ar)
|
||||
{
|
||||
ar(emboss, use_surface, size_in_mm, per_glyph, align.first, align.second);
|
||||
ar(size_in_mm, per_glyph, align.first, align.second);
|
||||
cereal::load(ar, char_gap);
|
||||
cereal::load(ar, line_gap);
|
||||
cereal::load(ar, boldness);
|
||||
cereal::load(ar, skew);
|
||||
cereal::load(ar, distance);
|
||||
cereal::load(ar, angle);
|
||||
cereal::load(ar, collection_number);
|
||||
cereal::load(ar, family);
|
||||
cereal::load(ar, face_name);
|
||||
cereal::load(ar, style);
|
||||
cereal::load(ar, weight);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -193,9 +159,7 @@ struct EmbossStyle
|
||||
}
|
||||
|
||||
// undo / redo stack recovery
|
||||
template<class Archive> void serialize(Archive &ar){
|
||||
ar(name, path, type, prop);
|
||||
}
|
||||
template<class Archive> void serialize(Archive &ar){ ar(name, path, type, prop); }
|
||||
};
|
||||
|
||||
// Emboss style name inside vector is unique
|
||||
@@ -216,21 +180,9 @@ struct TextConfiguration
|
||||
// Embossed text value
|
||||
std::string text = "None";
|
||||
|
||||
// !!! Volume stored in .3mf has transformed vertices.
|
||||
// (baked transformation into vertices position)
|
||||
// Only place for fill this is when load from .3mf
|
||||
// This is correct volume transformation
|
||||
std::optional<Transform3d> fix_3mf_tr;
|
||||
|
||||
// undo / redo stack recovery
|
||||
template<class Archive> void save(Archive &ar) const{
|
||||
ar(text, style);
|
||||
cereal::save(ar, fix_3mf_tr);
|
||||
}
|
||||
template<class Archive> void load(Archive &ar){
|
||||
ar(text, style);
|
||||
cereal::load(ar, fix_3mf_tr);
|
||||
}
|
||||
template<class Archive> void serialize(Archive &ar) { ar(style, text); }
|
||||
};
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
Reference in New Issue
Block a user