mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 12:11:15 -06:00 
			
		
		
		
	Removed obsolete member variable GLCanvas3D::m_color_by
(cherry picked from commit prusa3d/PrusaSlicer@5089d1460d)
This commit is contained in:
		
							parent
							
								
									dd51ce3b90
								
							
						
					
					
						commit
						d1b0743735
					
				
					 7 changed files with 7 additions and 23 deletions
				
			
		|  | @ -2353,7 +2353,7 @@ int CLI::run(int argc, char **argv) | |||
|                             //    continue;
 | ||||
|                             for (int instance_idx = 0; instance_idx < (int)model_object.instances.size(); ++ instance_idx) { | ||||
|                                 const ModelInstance &model_instance = *model_object.instances[instance_idx]; | ||||
|                                 glvolume_collection.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, "volume", true, false, true); | ||||
|                                 glvolume_collection.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, true, false, true); | ||||
|                                 //glvolume_collection.volumes.back()->geometry_id = key.geometry_id;
 | ||||
|                                 std::string color = filament_color?filament_color->get_at(extruder_id - 1):"#00FF00"; | ||||
| 
 | ||||
|  |  | |||
|  | @ -1008,13 +1008,12 @@ std::vector<int> GLVolumeCollection::load_object( | |||
|     const ModelObject       *model_object, | ||||
|     int                      obj_idx, | ||||
|     const std::vector<int>  &instance_idxs, | ||||
|     const std::string       &color_by, | ||||
|     bool 					 opengl_initialized) | ||||
| { | ||||
|     std::vector<int> volumes_idx; | ||||
|     for (int volume_idx = 0; volume_idx < int(model_object->volumes.size()); ++volume_idx) | ||||
|         for (int instance_idx : instance_idxs) | ||||
|             volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, color_by, opengl_initialized)); | ||||
|             volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, opengl_initialized)); | ||||
|     return volumes_idx; | ||||
| } | ||||
| 
 | ||||
|  | @ -1023,7 +1022,6 @@ int GLVolumeCollection::load_object_volume( | |||
|     int                  obj_idx, | ||||
|     int                  volume_idx, | ||||
|     int                  instance_idx, | ||||
|     const std::string   &color_by, | ||||
|     bool 				 opengl_initialized, | ||||
|     bool                 in_assemble_view, | ||||
|     bool                 use_loaded_id) | ||||
|  | @ -1032,9 +1030,7 @@ int GLVolumeCollection::load_object_volume( | |||
|     const int            extruder_id  = model_volume->extruder_id(); | ||||
|     const ModelInstance *instance 	  = model_object->instances[instance_idx]; | ||||
|     const TriangleMesh  &mesh 		  = model_volume->mesh(); | ||||
|     ColorRGBA color = GLVolume::MODEL_COLOR[((color_by == "volume") ? volume_idx : obj_idx) % 4]; | ||||
|     color.a(model_volume->is_model_part() ? 0.7f : 0.4f); | ||||
|     this->volumes.emplace_back(new GLVolume(color)); | ||||
|     this->volumes.emplace_back(new GLVolume()); | ||||
|     GLVolume& v = *this->volumes.back(); | ||||
|     v.set_color(color_from_model_volume(*model_volume)); | ||||
|     v.name = model_volume->name; | ||||
|  |  | |||
|  | @ -630,7 +630,6 @@ public: | |||
|         const ModelObject 		*model_object, | ||||
|         int                      obj_idx, | ||||
|         const std::vector<int>	&instance_idxs, | ||||
|         const std::string 		&color_by, | ||||
|         bool 					 opengl_initialized); | ||||
| 
 | ||||
|     int load_object_volume( | ||||
|  | @ -638,7 +637,6 @@ public: | |||
|         int                obj_idx, | ||||
|         int                volume_idx, | ||||
|         int                instance_idx, | ||||
|         const std::string &color_by, | ||||
|         bool 			   opengl_initialized, | ||||
|         bool               in_assemble_view = false, | ||||
|         bool               use_loaded_id = false); | ||||
|  |  | |||
|  | @ -3138,7 +3138,7 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p | |||
|         instance_ids.resize(instance_index); | ||||
| 
 | ||||
|         size_t current_volumes_count = m_shells.volumes.volumes.size(); | ||||
|         m_shells.volumes.load_object(model_obj, object_idx, instance_ids, "object", initialized); | ||||
|         m_shells.volumes.load_object(model_obj, object_idx, instance_ids, initialized); | ||||
| 
 | ||||
|         // adjust shells' z if raft is present
 | ||||
|         const SlicingParameters& slicing_parameters = obj->slicing_parameters(); | ||||
|  |  | |||
|  | @ -1111,7 +1111,6 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, Bed3D &bed) | |||
|     , m_moving(false) | ||||
|     , m_tab_down(false) | ||||
|     , m_cursor_type(Standard) | ||||
|     , m_color_by("volume") | ||||
|     , m_reload_delayed(false) | ||||
| #if ENABLE_RENDER_PICKING_PASS | ||||
|     , m_show_picking_texture(false) | ||||
|  | @ -1438,11 +1437,6 @@ Camera& GLCanvas3D::get_camera() | |||
|     return camera; | ||||
| } | ||||
| 
 | ||||
| void GLCanvas3D::set_color_by(const std::string& value) | ||||
| { | ||||
|     m_color_by = value; | ||||
| } | ||||
| 
 | ||||
| void GLCanvas3D::refresh_camera_scene_box() | ||||
| { | ||||
|     wxGetApp().plater()->get_camera().set_scene_box(scene_bounding_box()); | ||||
|  | @ -2142,7 +2136,7 @@ std::vector<int> GLCanvas3D::load_object(const ModelObject& model_object, int ob | |||
|             instance_idxs.emplace_back(i); | ||||
|         } | ||||
|     } | ||||
|     return m_volumes.load_object(&model_object, obj_idx, instance_idxs, m_color_by, m_initialized); | ||||
|     return m_volumes.load_object(&model_object, obj_idx, instance_idxs, m_initialized); | ||||
| } | ||||
| 
 | ||||
| std::vector<int> GLCanvas3D::load_object(const Model& model, int obj_idx) | ||||
|  | @ -2453,7 +2447,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re | |||
|                     // Note the index of the loaded volume, so that we can reload the main model GLVolume with the hollowed mesh
 | ||||
|                     // later in this function.
 | ||||
|                     it->volume_idx = m_volumes.volumes.size(); | ||||
|                     m_volumes.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, m_color_by, m_initialized, m_canvas_type == ECanvasType::CanvasAssembleView); | ||||
|                     m_volumes.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, m_initialized, m_canvas_type == ECanvasType::CanvasAssembleView); | ||||
|                     m_volumes.volumes.back()->geometry_id = key.geometry_id; | ||||
|                     update_object_list = true; | ||||
|                 } else { | ||||
|  |  | |||
|  | @ -577,8 +577,6 @@ private: | |||
|     // I just don't want to do it now before a release (Lukas Matena 24.3.2019)
 | ||||
|     bool m_render_sla_auxiliaries; | ||||
| 
 | ||||
|     std::string m_color_by; | ||||
| 
 | ||||
|     bool m_reload_delayed; | ||||
| 
 | ||||
| #if ENABLE_RENDER_PICKING_PASS | ||||
|  | @ -789,8 +787,6 @@ public: | |||
|     bool                                get_use_clipping_planes() const { return m_use_clipping_planes; } | ||||
|     const std::array<ClippingPlane, 2> &get_clipping_planes() const { return m_clipping_planes; }; | ||||
| 
 | ||||
|     void set_color_by(const std::string& value); | ||||
| 
 | ||||
|     void refresh_camera_scene_box(); | ||||
| 
 | ||||
|     BoundingBoxf3 volumes_bounding_box(bool current_plate_only = false) const; | ||||
|  |  | |||
|  | @ -926,7 +926,7 @@ void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f | |||
|                 const ModelVolume &model_volume = *model_object.volumes[volume_idx]; | ||||
|                 for (int instance_idx = 0; instance_idx < (int)model_object.instances.size(); ++ instance_idx) { | ||||
|                     const ModelInstance &model_instance = *model_object.instances[instance_idx]; | ||||
|                     glvolume_collection.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, "volume", true, false, true); | ||||
|                     glvolume_collection.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, true, false, true); | ||||
|                     glvolume_collection.volumes.back()->set_render_color(new_color); | ||||
|                     glvolume_collection.volumes.back()->set_color(new_color); | ||||
|                     //glvolume_collection.volumes.back()->printable = model_instance.printable;
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 enricoturri1966
						enricoturri1966