mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 06:04:01 -06:00
Fix Compile Warnings (#5963)
* Fix calls to depreciated wxPen constructor * Fix use of wxTimerEvent * Fix unrecognized character escape sequence * Fix signed/unsigned mismatch At least as much as possible without significantly altering parts of the application * Clean unreferenced variables * fix mistyped namespace selector * Update deprecated calls * Fix preprocessor statement * Remove empty switch statements * Change int vector used as bool to bool vector * Remove empty control statements and related unused code * Change multi character constant to string constant * Fix discarded return value json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured. * Rename ICON_SIZE def used by MultiMachine By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future. * Remove unused includes * Fix linux/macOS compilation * Hide unused-function errors on non-Windows systems * Disable signed/unsigned comparison mismatch error * Remove/Disable more unused variables Still TODO: check double for loop in Print.cpp * Remove unused variable that was missed * Remove unused variables in libraries in the src folder * Apply temporary fix for subobject linkage error * Remove/Disable last set of unused variables reported by GCC * remove redundant for loop * fix misspelled ifdef check * Update message on dialog * Fix hard-coded platform specific modifier keys * Remove duplicate for loop * Disable -Wmisleading-indentation warning * disable -Wswitch warning * Remove unused local typedefs * Fix -Wunused-value * Fix pragma error on Windows from subobject linkage fix * Fix -Waddress * Fix null conversions (-Wconversion-null) --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
b40853af94
commit
b83e16dbdd
187 changed files with 494 additions and 1101 deletions
|
@ -713,7 +713,6 @@ void ObjectList::update_plate_values_for_items()
|
|||
Unselect(item);
|
||||
|
||||
bool is_old_parent_expanded = IsExpanded(old_parent);
|
||||
bool is_expanded = IsExpanded(item);
|
||||
m_objects_model->OnPlateChange(plate_idx, item);
|
||||
if (is_old_parent_expanded)
|
||||
Expand(old_parent);
|
||||
|
@ -739,7 +738,6 @@ void ObjectList::object_config_options_changed(const ObjectVolumeID& ov_id)
|
|||
if (ov_id.object == nullptr)
|
||||
return;
|
||||
|
||||
ModelObjectPtrs& objects = wxGetApp().model().objects;
|
||||
ModelObject* mo = ov_id.object;
|
||||
ModelVolume* mv = ov_id.volume;
|
||||
|
||||
|
@ -846,8 +844,6 @@ void ObjectList::update_filament_colors()
|
|||
void ObjectList::update_name_column_width() const
|
||||
{
|
||||
wxSize client_size = this->GetClientSize();
|
||||
bool p_vbar = this->GetParent()->HasScrollbar(wxVERTICAL);
|
||||
bool p_hbar = this->GetParent()->HasScrollbar(wxHORIZONTAL);
|
||||
|
||||
auto em = em_unit(const_cast<ObjectList*>(this));
|
||||
// BBS: walkaround for wxDataViewCtrl::HasScrollbar() does not return correct status
|
||||
|
@ -936,7 +932,6 @@ void ObjectList::update_name_in_model(const wxDataViewItem& item) const
|
|||
if (m_objects_model->GetItemType(item) & itPlate) {
|
||||
std::string name = m_objects_model->GetName(item).ToUTF8().data();
|
||||
int plate_idx = -1;
|
||||
const ItemType type0 = m_objects_model->GetItemType(item, plate_idx);
|
||||
if (plate_idx >= 0) {
|
||||
auto plate = wxGetApp().plater()->get_partplate_list().get_plate(plate_idx);
|
||||
if (plate->get_plate_name() != name) {
|
||||
|
@ -1351,8 +1346,7 @@ void ObjectList::show_context_menu(const bool evt_context_menu)
|
|||
plater->SetPlateIndexByRightMenuInLeftUI(-1);
|
||||
if (type & itPlate) {
|
||||
int plate_idx = -1;
|
||||
const ItemType type0 = m_objects_model->GetItemType(item, plate_idx);
|
||||
if (plate_idx >= 0) {
|
||||
if (plate_idx >= 0) {
|
||||
plater->SetPlateIndexByRightMenuInLeftUI(plate_idx);
|
||||
}
|
||||
}
|
||||
|
@ -2006,7 +2000,7 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
|
|||
try {
|
||||
model = Model::read_from_file(input_file, nullptr, nullptr, LoadStrategy::LoadModel);
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
catch (std::exception&) {
|
||||
// auto msg = _L("Error!") + " " + input_file + " : " + e.what() + ".";
|
||||
auto msg = _L("Error!") + " " + _L("Failed to get the model data in the current file.");
|
||||
show_error(parent, msg);
|
||||
|
@ -2905,7 +2899,7 @@ void ObjectList::boolean()
|
|||
new_object->config.assign_config(object->config);
|
||||
if (new_object->instances.empty())
|
||||
new_object->add_instance();
|
||||
ModelVolume* new_volume = new_object->add_volume(mesh);
|
||||
new_object->add_volume(mesh);
|
||||
|
||||
// BBS: ensure on bed but no need to ensure locate in the center around origin
|
||||
new_object->ensure_on_bed();
|
||||
|
@ -2952,9 +2946,9 @@ DynamicPrintConfig ObjectList::get_default_layer_config(const int obj_idx)
|
|||
wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("layer_height");
|
||||
config.set_key_value("layer_height",new ConfigOptionFloat(layer_height));
|
||||
// BBS
|
||||
int extruder = object(obj_idx)->config.has("extruder") ?
|
||||
object(obj_idx)->config.opt_int("extruder") :
|
||||
wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("extruder");
|
||||
// int extruder = object(obj_idx)->config.has("extruder") ?
|
||||
// object(obj_idx)->config.opt_int("extruder") :
|
||||
// wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("extruder");
|
||||
config.set_key_value("extruder", new ConfigOptionInt(0));
|
||||
|
||||
return config;
|
||||
|
@ -3176,8 +3170,8 @@ void ObjectList::part_selection_changed()
|
|||
bool update_and_show_settings = false;
|
||||
bool update_and_show_layers = false;
|
||||
|
||||
bool enable_manipulation{true};
|
||||
bool disable_ss_manipulation{false};
|
||||
// bool enable_manipulation{true}; Orca: Removed because not used
|
||||
// bool disable_ss_manipulation{false}; Orca: Removed because not used
|
||||
bool disable_ununiform_scale{false};
|
||||
|
||||
const auto item = GetSelection();
|
||||
|
@ -3185,7 +3179,7 @@ void ObjectList::part_selection_changed()
|
|||
og_name = _L("Cut Connectors information");
|
||||
|
||||
update_and_show_manipulations = true;
|
||||
enable_manipulation = false;
|
||||
// enable_manipulation = false;
|
||||
disable_ununiform_scale = true;
|
||||
}
|
||||
else if (item && (m_objects_model->GetItemType(item) & itPlate)) {
|
||||
|
@ -3202,7 +3196,7 @@ void ObjectList::part_selection_changed()
|
|||
obj_idx = selection.get_object_idx();
|
||||
ModelObject *object = (*m_objects)[obj_idx];
|
||||
m_config = &object->config;
|
||||
disable_ss_manipulation = object->is_cut();
|
||||
// disable_ss_manipulation = object->is_cut();
|
||||
}
|
||||
else {
|
||||
og_name = _L("Group manipulation");
|
||||
|
@ -3211,17 +3205,17 @@ void ObjectList::part_selection_changed()
|
|||
update_and_show_manipulations = !selection.is_single_full_instance();
|
||||
|
||||
if (int obj_idx = selection.get_object_idx(); obj_idx >= 0) {
|
||||
if (selection.is_any_volume() || selection.is_any_modifier())
|
||||
enable_manipulation = !(*m_objects)[obj_idx]->is_cut();
|
||||
else // if (item && m_objects_model->GetItemType(item) == itInstanceRoot)
|
||||
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
// if (selection.is_any_volume() || selection.is_any_modifier())
|
||||
// enable_manipulation = !(*m_objects)[obj_idx]->is_cut();
|
||||
// else // if (item && m_objects_model->GetItemType(item) == itInstanceRoot)
|
||||
// disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
}
|
||||
else {
|
||||
wxDataViewItemArray sels;
|
||||
GetSelections(sels);
|
||||
if (selection.is_single_full_object() || selection.is_multiple_full_instance()) {
|
||||
int obj_idx = m_objects_model->GetObjectIdByItem(sels.front());
|
||||
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
// int obj_idx = m_objects_model->GetObjectIdByItem(sels.front());
|
||||
// disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
} else if (selection.is_mixed() || selection.is_multiple_full_object()) {
|
||||
std::map<CutObjectBase, std::set<int>> cut_objects;
|
||||
|
||||
|
@ -3240,7 +3234,7 @@ void ObjectList::part_selection_changed()
|
|||
// check if selected cut objects are "full selected"
|
||||
for (auto cut_object : cut_objects)
|
||||
if (cut_object.first.check_sum() != cut_object.second.size()) {
|
||||
disable_ss_manipulation = true;
|
||||
// disable_ss_manipulation = true;
|
||||
break;
|
||||
}
|
||||
disable_ununiform_scale = !cut_objects.empty();
|
||||
|
@ -3288,7 +3282,7 @@ void ObjectList::part_selection_changed()
|
|||
// BBS: select object to edit config
|
||||
m_config = &(*m_objects)[obj_idx]->config;
|
||||
update_and_show_settings = true;
|
||||
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
// disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -3316,8 +3310,8 @@ void ObjectList::part_selection_changed()
|
|||
m_config = &(*m_objects)[obj_idx]->volumes[volume_id]->config;
|
||||
update_and_show_settings = true;
|
||||
|
||||
const ModelVolume *volume = (*m_objects)[obj_idx]->volumes[volume_id];
|
||||
enable_manipulation = !((*m_objects)[obj_idx]->is_cut() && (volume->is_cut_connector() || volume->is_model_part()));
|
||||
// const ModelVolume *volume = (*m_objects)[obj_idx]->volumes[volume_id];
|
||||
// enable_manipulation = !((*m_objects)[obj_idx]->is_cut() && (volume->is_cut_connector() || volume->is_model_part()));
|
||||
}
|
||||
else if (type & itInstance) {
|
||||
og_name = _L("Instance manipulation");
|
||||
|
@ -3325,7 +3319,7 @@ void ObjectList::part_selection_changed()
|
|||
|
||||
// fill m_config by object's values
|
||||
m_config = &(*m_objects)[obj_idx]->config;
|
||||
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
// disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
}
|
||||
else if (type & (itLayerRoot | itLayer)) {
|
||||
og_name = type & itLayerRoot ? _L("Height ranges") : _L("Settings for height range");
|
||||
|
@ -3368,7 +3362,7 @@ void ObjectList::part_selection_changed()
|
|||
if (printer_technology() == ptSLA)
|
||||
update_and_show_layers = false;
|
||||
else if (update_and_show_layers) {
|
||||
;//wxGetApp().obj_layers()->get_og()->set_name(" " + og_name + " ");
|
||||
//wxGetApp().obj_layers()->get_og()->set_name(" " + og_name + " ");
|
||||
}
|
||||
|
||||
update_min_height();
|
||||
|
@ -3400,7 +3394,6 @@ wxDataViewItem ObjectList::add_settings_item(wxDataViewItem parent_item, const D
|
|||
return ret;
|
||||
|
||||
const bool is_object_settings = m_objects_model->GetItemType(parent_item) == itObject;
|
||||
const bool is_volume_settings = m_objects_model->GetItemType(parent_item) == itVolume;
|
||||
const bool is_layer_settings = m_objects_model->GetItemType(parent_item) == itLayer;
|
||||
if (!is_object_settings) {
|
||||
ModelVolumeType volume_type = m_objects_model->GetVolumeType(parent_item);
|
||||
|
@ -4689,8 +4682,6 @@ void ObjectList::select_item(const ObjectVolumeID& ov_id)
|
|||
|
||||
void ObjectList::select_items(const std::vector<ObjectVolumeID>& ov_ids)
|
||||
{
|
||||
ModelObjectPtrs& objects = wxGetApp().model().objects;
|
||||
|
||||
wxDataViewItemArray sel_items;
|
||||
for (auto ov_id : ov_ids) {
|
||||
if (ov_id.object == nullptr)
|
||||
|
@ -5695,7 +5686,7 @@ void ObjectList::set_extruder_for_selected_items(const int extruder)
|
|||
|
||||
void ObjectList::on_plate_added(PartPlate* part_plate)
|
||||
{
|
||||
wxDataViewItem plate_item = m_objects_model->AddPlate(part_plate);
|
||||
m_objects_model->AddPlate(part_plate);
|
||||
}
|
||||
|
||||
void ObjectList::on_plate_deleted(int plate_idx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue