protected void DisconnectInput(MetaActionDependencies dependency, string inputName) { var inputs = dependency.Inputs; var input = inputs[inputName]; input.HasDataNotify -= OnReceiveInputData; }
/// <summary> /// Unifies proposals that come from mouse and from command line. /// ex: a height comes from command line as number, from mouse comes as 3D mouse coordinate /// </summary> /// <param name = "data"></param> /// <param name = "dependency"></param> /// <returns>Returns true if the dependency was proposed</returns> private bool BridgedProposeDependency(object data, MetaActionDependencies dependency) { switch (dependency.StepName) { case InterpreterNames.Real: { if (data is Mouse3DPosition) { ProposeMouseDependency(data as Mouse3DPosition, false); } else { var value = (double)data; dependency.Propose(value); } } break; case InterpreterNames.Integer: { if (data is int) { var value = (int)data; dependency.Propose(value); } } break; case InterpreterNames.Point3D: { if (data is Point3D) { var value = (Point3D)data; dependency.Propose(value); } else if (data is Mouse3DPosition) { ProposeMouseDependency(data as Mouse3DPosition, false); } } break; case InterpreterNames.Axis3D: { dependency.Propose(data); } break; case InterpreterNames.Reference: break; case InterpreterNames.ReferenceList: break; } return(true); }
protected void ConnectInput(MetaActionDependencies dependency, string inputName) { var inputs = dependency.Inputs; var input = inputs[inputName]; inputs.ConnectPipe(inputName); input.HasDataNotify += OnReceiveInputData; input.OnConnect(); }
private void UpdateStageFromDependency(MetaActionDependencies dependency) { if (dependency == null) { Stage = ParserStage.None; return; } var stepCount = dependency.Steps.Count; var stepIndex = dependency.StepIndex; var stepName = dependency.StepName; UpdateStageFromDependency(stepCount, stepIndex, stepName); Inputs[InputNames.CoordinateParser].Send(CoordinatateParserNames.SetHint, Dependency.StepHint); }
/// <summary> /// Change the current meta action in the command line /// </summary> private void ChangeMetaAction() { var dependencyHost = new MetaActionDependencies(Document, AnimationDocument, ActionsGraph) { Inputs = ActionsGraph.InputContainer }; _metaAction.SetupDependency(dependencyHost); _metaAction.FillDependencies(); Inputs[InputNames.SelectionContainerPipe].Send(NotificationNames.SwitchSelectionMode, _metaAction.Dependency.SelectionMode); if (_metaAction.Dependency.FacePickerActivate) { Inputs[InputNames.FacePickerPlane].Send(NotificationNames.Resume); } Dependency.Reset(); Inputs[InputNames.CommandParser].Send(NotificationNames.UpdateCommand, _metaAction); PrePushItems(); LockPlaneToDraw(); }
private void UpdateParserAndView(MetaActionDependencies dependency) { if (dependency.StepIndex < dependency.Steps.Count) { Inputs[InputNames.CommandParser].Send(NotificationNames.UpdateParserStage); return; } Inputs[InputNames.FacePickerPlane].Send(NotificationNames.Suspend); Inputs[InputNames.FacePickerPlane].Send(NotificationNames.Cleanup); if (dependency.DocumentNodeBuilder != null && dependency.DocumentNodeBuilder.LastExecute && dependency.DocumentNodeBuilder.ExecuteFunction()) { CommitFinal("Draw " + dependency.FunctionName); AddNodeListToTree(dependency.AddToTreeOnComplete); } else { dependency.Document.Revert(); } Inputs[InputNames.FacePickerPlane].Send(NotificationNames.Resume); if (_metaAction.Dependency.StepIndex != _metaAction.Dependency.Steps.Count) { return; } if (_metaAction.Dependency.AutoReset) { _metaAction.Dependency.Reset(); Inputs[InputNames.CommandParser].Send(NotificationNames.UpdateParserStage); } else { BackToNeutralModifier(); } }
public void SetupDependency(MetaActionDependencies dependency) { Dependency = dependency; }
private void DrawLiveTranslation(bool updateShape) { BuildTranslation(); MetaActionDependencies.DimensionAnimation(Dependency.AnimationDocument, Dependency.Steps[1].Get <Point3D>(), Dependency.Steps[2].Get <Point3D>()); }