Merge pull request #4159 from jlewin/master

Switch to Model view when dragging items from the file system
This commit is contained in:
Lars Brubaker 2019-01-10 16:39:29 -08:00 committed by GitHub
commit d095171a01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 41 deletions

View file

@ -193,6 +193,11 @@ namespace MatterHackers.MatterControl
}
public InsertionGroupObject3D AddToPlate(IEnumerable<ILibraryItem> itemsToAdd)
{
return this.AddToPlate(itemsToAdd, (this.Printer != null) ? this.Printer.Bed.BedCenter : Vector2.Zero, true);
}
public InsertionGroupObject3D AddToPlate(IEnumerable<ILibraryItem> itemsToAdd, Vector2 initialPosition, bool moveToOpenPosition)
{
if (this.Printer != null
&& this.Printer.ViewState.ViewMode != PartViewMode.Model)
@ -211,10 +216,13 @@ namespace MatterHackers.MatterControl
itemsToAdd,
context.View3DWidget,
scene,
(Printer != null) ? Printer.Bed.BedCenter : Vector2.Zero,
initialPosition,
(item, itemsToAvoid) =>
{
PlatingHelper.MoveToOpenPositionRelativeGroup(item, itemsToAvoid);
if (moveToOpenPosition)
{
PlatingHelper.MoveToOpenPositionRelativeGroup(item, itemsToAvoid);
}
}));
});

View file

@ -92,7 +92,6 @@ namespace MatterHackers.MatterControl.DesignTools
var graphics2D = _image.NewGraphics2D();
graphics2D.Clear(Color.White);
graphics2D.DrawString("Bad Load", 100, 100);
}
// we don't want to invalidate on the mesh change

View file

@ -142,7 +142,6 @@ namespace MatterHackers.MatterControl.DesignTools
}
});
if (aabb.ZSize > 0)
{
// If the part was already created and at a height, maintain the height.

View file

@ -999,13 +999,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// Set the hitplane to the bed plane
CurrentSelectInfo.HitPlane = bedPlane;
var insertionGroup = new InsertionGroupObject3D(
items,
this,
Scene,
Vector2.Zero,
null,
trackSourceFiles);
// Add item to scene
var insertionGroup = sceneContext.AddToPlate(items, Vector2.Zero, moveToOpenPosition: false);
// Find intersection position of the mouse with the bed plane
var intersectInfo = GetIntersectPosition(screenSpaceMousePosition);
@ -1020,11 +1015,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.deferEditorTillMouseUp = true;
// Add item to scene and select it
Scene.Children.Modify(list =>
{
list.Add(insertionGroup);
});
Scene.SelectedItem = insertionGroup;
this.DragDropObject = insertionGroup;

View file

@ -146,18 +146,6 @@ Printer
extruders_share_temperature
extruder_offset
Features
Features
Interface
sla_printer
show_reset_connection
include_firmware_updater
backup_firmware_before_update
Print Recovery
recover_is_enabled
recover_first_layer_speed
recover_position_before_z_home
Other
progress_reporting
Leveling
Print Leveling
print_leveling_solution
@ -172,6 +160,28 @@ Printer
z_probe_z_offset
z_servo_depolyed_angle
z_servo_retracted_angle
Features
Interface
show_reset_connection
include_firmware_updater
backup_firmware_before_update
Print Recovery
recover_is_enabled
recover_first_layer_speed
recover_position_before_z_home
Other
progress_reporting
Behavior
Behavior
z_homes_to_max
heat_extruder_before_homing
auto_release_motors
validate_layer_height
send_with_checksum
reset_long_extrusion
Slicing Options
output_only_first_layer
g0
Hardware
Hardware
has_fan
@ -184,23 +194,11 @@ Printer
has_z_servo
enable_network_printing
enable_sailfish_communication
Behavior
Behavior
z_homes_to_max
heat_extruder_before_homing
auto_release_motors
validate_layer_height
send_with_checksum
reset_long_extrusion
sla_printer
max_acceleration
max_velocity
jerk_velocity
print_time_estimate_multiplier
Slicing
Slicing Options
output_only_first_layer
g0
Material Loading
Loading
load_filament_length
unload_filament_length