protected override void OnMouseUpAction(Mouse3DPosition mouseData) { base.OnMouseUpAction(mouseData); _dragging = false; if (_extrudeStages == ExtrudeStages.SelectSketch) { var entities = Inputs[InputNames.SelectionContainerPipe].GetData(NotificationNames.GetEntities).Get <List <SceneSelectedEntity> >(); if (entities.Count <= 0) { return; } _sketchNode = AutoGroupLogic.FindSketchNode(entities[0].Node); Ensure.IsNotNull(_sketchNode); PreviewExtrudes(true); _extrudeStages = ExtrudeStages.SelectAutoFace; Inputs[InputNames.FacePickerPlane].Send(NotificationNames.Resume); } else if (_extrudeStages == ExtrudeStages.SelectAutoFace) { ProposeSelectedReferenceShape(_underMouseFace, mouseData); PreviewExtrudes(true); _extrudeStages = ExtrudeStages.ExtrudeAnimation; } else if (_extrudeStages == ExtrudeStages.ExtrudeAnimation) { } }
private void Reset() { _extrudeStages = ExtrudeStages.SelectSketch; _sketchNode = null; Inputs[InputNames.FacePickerPlane].Send(NotificationNames.Suspend); }
private void Reset() { _shapesToExtrude = new SortedDictionary <int, SortedDictionary <int, IntIntPair> >(); _extrudesList = new SortedDictionary <int, Node>(); _underMouseFace = null; _normalPlane = null; _axisBuilder = new NodeBuilder(null); _dragging = false; _globalExtrudeSize = 5; _extrudeSizeView = null; _extrudeStages = ExtrudeStages.SelectSketch; _sketchNode = null; Inputs[InputNames.FacePickerPlane].Send(NotificationNames.Suspend); }
protected override void OnMouseUpAction(Mouse3DPosition mouseData) { base.OnMouseUpAction(mouseData); if (_extrudeStages == ExtrudeStages.SelectSketch) { var entities = Inputs[InputNames.SelectionContainerPipe].GetData(NotificationNames.GetEntities).Get <List <SceneSelectedEntity> >(); if (entities.Count <= 0) { return; } _sketchNode = AutoGroupLogic.FindSketchNode(entities[0].Node); if (_sketchNode == null) { return; } if (_sketchNode.Children[2].Get <MeshTopoShapeInterpreter>() == null) { // the sketch shape was not generated - this is the case when we open a file and perform extrude without any edits var tempFace = AutoGroupLogic.RebuildSketchFace(_sketchNode, Document); if (tempFace == null) { return; } _sketchNode.Children[2].Set <MeshTopoShapeInterpreter>().Shape = tempFace; NodeUtils.SetSketchTransparency(Document, _sketchNode, ObjectVisibility.Hidden); _sketchNode.Set <DrawingAttributesInterpreter>().Transparency = 1; _sketchNode.Set <DrawingAttributesInterpreter>().Visibility = ObjectVisibility.Hidden; Document.Commit("Sketch face generated"); } var face = _sketchNode.Children[2].Get <MeshTopoShapeInterpreter>().Shape; _shapePlane = GeomUtils.ExtractPlane(face); PreviewExtrude(false, mouseData); ResetWorkingPlane(); Inputs[InputNames.SelectionContainerPipe].Send(NotificationNames.Disable); _extrudeStages = ExtrudeStages.ExtrudeAnimation; } else if (_extrudeStages == ExtrudeStages.ExtrudeAnimation) { var sketchBuilder = new NodeBuilder(_sketchNode); var extrudeHeight = sketchBuilder[0].Axis3D.Location.Distance(mouseData.Point); if (extrudeHeight < 1e-12) { return; } PreviewExtrude(false, mouseData); NodeUtils.SetSketchTransparency(Document, _sketchNode, ObjectVisibility.Hidden); CommitFinal("Extrudes build"); Inputs[InputNames.FacePickerPlane].Send(NotificationNames.Resume); //Inputs[InputNames.SelectionContainerPipe].Send(NotificationNames.SwitchSelectionMode, // TopAbsShapeEnum.TopAbs_SOLID); RebuildTreeView(); UpdateView(); BackToNeutralModifier(); } }