mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 07:39:05 +08:00
After merge fixes
This commit is contained in:
parent
fbcdd4191b
commit
1c061dc7a1
@ -181,7 +181,7 @@ set(SLIC3R_SOURCES
|
||||
Model.hpp
|
||||
ModelArrange.hpp
|
||||
ModelArrange.cpp
|
||||
ModelVolumeType.hpp
|
||||
#ModelVolumeType.hpp
|
||||
MultiMaterialSegmentation.cpp
|
||||
MultiMaterialSegmentation.hpp
|
||||
MeshNormals.hpp
|
||||
|
@ -464,7 +464,7 @@ const Emboss::Glyph* priv::get_glyph(
|
||||
std::optional<stbtt_fontinfo> &font_info_opt)
|
||||
{
|
||||
// TODO: Use resolution by printer configuration, or add it into FontProp
|
||||
const float RESOLUTION = 0.0125; // [in mm]
|
||||
const float RESOLUTION = 0.0125f; // [in mm]
|
||||
auto glyph_item = cache.find(unicode);
|
||||
if (glyph_item != cache.end()) return &glyph_item->second;
|
||||
|
||||
@ -544,7 +544,8 @@ Point priv::to_point(const stbtt__point &point) {
|
||||
// Get system font file path
|
||||
std::optional<std::wstring> Emboss::get_font_path(const std::wstring &font_face_name)
|
||||
{
|
||||
static const LPWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
|
||||
// static const LPWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
|
||||
static const LPCWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
|
||||
HKEY hKey;
|
||||
LONG result;
|
||||
|
||||
@ -612,7 +613,8 @@ EmbossStyles Emboss::get_font_list()
|
||||
}
|
||||
|
||||
EmbossStyles Emboss::get_font_list_by_register() {
|
||||
static const LPWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
|
||||
// static const LPWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
|
||||
static const LPCWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
|
||||
HKEY hKey;
|
||||
LONG result;
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "Arrange.hpp"
|
||||
#include "CustomGCode.hpp"
|
||||
#include "enum_bitmask.hpp"
|
||||
#include "ModelVolumeType.hpp"
|
||||
//#include "ModelVolumeType.hpp"
|
||||
#include "TextConfiguration.hpp"
|
||||
|
||||
#include <map>
|
||||
|
@ -4182,13 +4182,12 @@ void ObjectList::change_part_type()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const bool is_cut_object = obj->is_cut();
|
||||
wxArrayString names;
|
||||
// names.Alloc(is_cut_object ? 3 : 5);
|
||||
if (!is_cut_object)
|
||||
for (const wxString& type : { _L("Part"), _L("Negative Volume") })
|
||||
names.Add(type);
|
||||
names.Add(_L("Modifier"))
|
||||
names.Add(_L("Modifier"));
|
||||
if (!volume->text_configuration.has_value())
|
||||
for (const wxString& name : { _L("Support Blocker"), _L("Support Enforcer") })
|
||||
names.Add(name);
|
||||
|
@ -28,6 +28,8 @@ class wxFont;
|
||||
namespace Slic3r{
|
||||
class AppConfig;
|
||||
class GLVolume;
|
||||
|
||||
enum class ModelVolumeType : int;
|
||||
}
|
||||
|
||||
namespace Slic3r::GUI {
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <libslic3r/Emboss.hpp>
|
||||
#include <libslic3r/ModelVolumeType.hpp>
|
||||
//#include <libslic3r/ModelVolumeType.hpp>
|
||||
#include "slic3r/Utils/RaycastManager.hpp"
|
||||
#include "slic3r/GUI/Camera.hpp"
|
||||
#include "Job.hpp"
|
||||
|
@ -349,7 +349,7 @@ void ObjectDataViewModel::UpdateBitmapForNode(ObjectDataViewModelNode* node)
|
||||
bool is_volume_node = vol_type >= 0;
|
||||
|
||||
if (!node->has_warning_icon() && !node->has_lock()) {
|
||||
node->SetBitmap(is_volume_node ? *m_volume_bmps.at(vol_type) : m_empty_bmp);
|
||||
node->SetBitmap(is_volume_node ? (node->is_text_volume() ? *m_text_volume_bmps.at(vol_type) : *m_volume_bmps.at(vol_type)) : m_empty_bmp);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -370,7 +370,7 @@ void ObjectDataViewModel::UpdateBitmapForNode(ObjectDataViewModelNode* node)
|
||||
if (node->has_lock())
|
||||
bmps.emplace_back(&m_lock_bmp);
|
||||
if (is_volume_node)
|
||||
bmps.emplace_back(m_volume_bmps[vol_type]);
|
||||
bmps.emplace_back(node->is_text_volume() ? m_text_volume_bmps[vol_type] : m_volume_bmps[vol_type]);
|
||||
bmp = m_bitmap_cache->insert_bndl(scaled_bitmap_name, bmps);
|
||||
}
|
||||
|
||||
@ -406,8 +406,8 @@ wxDataViewItem ObjectDataViewModel::AddVolumeChild( const wxDataViewItem &parent
|
||||
const wxString &name,
|
||||
const int volume_idx,
|
||||
const Slic3r::ModelVolumeType volume_type,
|
||||
const bool is_text_volume,
|
||||
const std::string& warning_icon_name,
|
||||
const bool is_text_volume = false,
|
||||
const wxString& extruder)
|
||||
{
|
||||
ObjectDataViewModelNode *root = static_cast<ObjectDataViewModelNode*>(parent_item.GetID());
|
||||
@ -418,7 +418,7 @@ wxDataViewItem ObjectDataViewModel::AddVolumeChild( const wxDataViewItem &parent
|
||||
if (insert_position < 0)
|
||||
insert_position = get_root_idx(root, itInstanceRoot);
|
||||
|
||||
const auto node = new ObjectDataViewModelNode(root, name, volume_type, extruder, volume_idx);
|
||||
const auto node = new ObjectDataViewModelNode(root, name, volume_type, is_text_volume, extruder, volume_idx);
|
||||
UpdateBitmapForNode(node, warning_icon_name, root->has_lock() && volume_type < ModelVolumeType::PARAMETER_MODIFIER);
|
||||
insert_position < 0 ? root->Append(node) : root->Insert(node, insert_position);
|
||||
|
||||
@ -1618,11 +1618,6 @@ void ObjectDataViewModel::UpdateSettingsDigest(const wxDataViewItem &item,
|
||||
ItemChanged(item);
|
||||
}
|
||||
|
||||
void ObjectDataViewModel::SetVolumeBitmap(ObjectDataViewModelNode* node)
|
||||
{
|
||||
node->SetBitmap(GetVolumeIcon(*node, node->m_warning_icon_name));
|
||||
}
|
||||
|
||||
ModelVolumeType ObjectDataViewModel::GetVolumeType(const wxDataViewItem& item)
|
||||
{
|
||||
if (!item.IsOk() || GetItemType(item) != itVolume)
|
||||
@ -1716,30 +1711,6 @@ void ObjectDataViewModel::UpdateBitmaps()
|
||||
}
|
||||
}
|
||||
|
||||
wxBitmapBundle ObjectDataViewModel::GetVolumeIcon(
|
||||
const ObjectDataViewModelNode &node,
|
||||
const std::string &warning_icon_name /* = std::string()*/)
|
||||
{
|
||||
const std::vector<wxBitmapBundle*>& bitmaps = node.is_text_volume() ? m_text_volume_bmps : m_volume_bmps;
|
||||
if (warning_icon_name.empty())
|
||||
return *bitmaps[static_cast<int>(node.GetVolumeType())];
|
||||
|
||||
std::string scaled_bitmap_name = warning_icon_name +
|
||||
std::to_string(node.GetType()) +
|
||||
(node.is_text_volume() ?"text": "");
|
||||
scaled_bitmap_name += "-em" + std::to_string(wxGetApp().em_unit()) + (wxGetApp().dark_mode() ? "-dm" : "-lm");
|
||||
|
||||
// TODO: use scale cache
|
||||
wxBitmapBundle *bmp = m_bitmap_cache->find_bndl(scaled_bitmap_name);
|
||||
if (bmp == nullptr) {
|
||||
std::vector<wxBitmapBundle*> bmps;
|
||||
bmps.emplace_back(&GetWarningBitmap(warning_icon_name));
|
||||
bmps.emplace_back(bitmaps[static_cast<int>(node.GetVolumeType())]);
|
||||
bmp = m_bitmap_cache->insert_bndl(scaled_bitmap_name, bmps);
|
||||
}
|
||||
return *bmp;
|
||||
}
|
||||
|
||||
void ObjectDataViewModel::AddWarningIcon(const wxDataViewItem& item, const std::string& warning_icon_name)
|
||||
{
|
||||
if (!item.IsOk())
|
||||
|
@ -285,8 +285,8 @@ public:
|
||||
const wxString &name,
|
||||
const int volume_idx,
|
||||
const Slic3r::ModelVolumeType volume_type,
|
||||
const bool is_text_volume,
|
||||
const std::string& warning_icon_name,
|
||||
const bool is_text_volume = false,
|
||||
const wxString& extruder);
|
||||
wxDataViewItem AddSettingsChild(const wxDataViewItem &parent_item);
|
||||
wxDataViewItem AddInfoChild(const wxDataViewItem &parent_item, InfoItemType info_type);
|
||||
@ -384,7 +384,6 @@ public:
|
||||
void UpdateObjectPrintable(wxDataViewItem parent_item);
|
||||
void UpdateInstancesPrintable(wxDataViewItem parent_item);
|
||||
|
||||
void SetVolumeBitmap(ObjectDataViewModelNode* node);
|
||||
ModelVolumeType GetVolumeType(const wxDataViewItem &item);
|
||||
wxDataViewItem SetPrintableState( PrintIndicator printable, int obj_idx,
|
||||
int subobj_idx = -1,
|
||||
@ -395,8 +394,6 @@ public:
|
||||
// Rescale bitmaps for existing Items
|
||||
void UpdateBitmaps();
|
||||
|
||||
wxBitmapBundle GetVolumeIcon(const ObjectDataViewModelNode& node,
|
||||
const std::string& warning_icon_name = std::string());
|
||||
void AddWarningIcon(const wxDataViewItem& item, const std::string& warning_name);
|
||||
void DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object = false);
|
||||
void UpdateWarningIcon(const wxDataViewItem& item, const std::string& warning_name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user