public static List <Node> GetVisibleSketchNodes(Document document) { var results = new List <Node>(); var visibleNodes = new List <Node>(); var root = document.Root; var found = true; while (found) { found = false; results.AddRange(from node in root.ChildrenList let builder = new NodeBuilder(node) where FunctionNames.GetSketchShapes().Contains(builder.FunctionName) select node); } var sketchNodes = new Dictionary <Node, bool>(); foreach (var node in results) { var sketchNode = AutoGroupLogic.FindSketchNode(node); if (!sketchNodes.ContainsKey(sketchNode)) { int index; sketchNodes.Add(sketchNode, SketchHas3DApplied(document, sketchNode, out index)); } if (!sketchNodes[sketchNode]) { visibleNodes.Add(node); } } return(visibleNodes); }
private void RemoveHighlightCurrentSketchNodes() { foreach (var node in Document.Root.ChildrenList) { var builder = new NodeBuilder(node); if (FunctionNames.GetSketchShapes().Contains(builder.FunctionName)) { builder.Color = Color.DarkTurquoise; } } }
private void HighlightCurrentSketchNodes(Node currentSketch) { var results = new List <NodeBuilder>(); results.AddRange(from node in Document.Root.ChildrenList let builder = new NodeBuilder(node) where FunctionNames.GetSketchShapes().Contains(builder.FunctionName) select builder); foreach (var nodeBuilder in results) { var sketchNode = NodeBuilderUtils.FindSketchNode(nodeBuilder.Node); nodeBuilder.Color = sketchNode.Index == currentSketch.Index? Color.DarkTurquoise : Color.Gray; } }
private void Mouse3DEventHandler(DataPackage data) { _shapeEditingContainer.Mouse3DEventHandler(data.Get <Mouse3DPosition>()); _gizmoContainer.Mouse3DEventHandler(data.Get <Mouse3DPosition>()); var selectionContainer = Inputs[InputNames.SelectionContainerPipe].GetData(NotificationNames.GetContainer).Get <SelectionContainer>(); if (selectionContainer.Entities.Count == 1 && data.Get <Mouse3DPosition>().Clicks == 2) { if (FunctionNames.GetSketchShapes().ToList().Contains(selectionContainer.Entities[0].Node.Get <ShapeFunctionsInterface.Functions.FunctionInterpreter>().Name)) { ActionsGraph.SwitchAction(ModifierNames.StartSketch); } } }
public string GetNextIndexName(string shapeName) { if (!FunctionNames.GetSketchShapes().Contains(shapeName) && !FunctionNames.GetSolids().Contains(shapeName) && shapeName != FunctionNames.Sketch) { return(shapeName); } if (!Indexes.ContainsKey(shapeName)) { Indexes[shapeName] = 1; } else { if (!Freeze) { Indexes[shapeName]++; } } return(shapeName + "-" + Indexes[shapeName]); }