private static void AddElement(PreviewPathBuilder path3D, ArcMoveAction moveAction) { var center = new Point3D(moveAction.Center.X, moveAction.Center.Y, 0); path3D.AddArc(EnumPlotStyle.Arc, center, moveAction.Radius, moveAction.ClockWise, moveAction.X, moveAction.Y, moveAction.Z, moveAction.ParametriTaglio); }
private static void AddElement(PreviewPathBuilder path3D, LinearMoveAction moveAction) { var plotStyle = EnumPlotStyle.Path; if (moveAction.MoveType == MoveType.Rapid) { plotStyle = EnumPlotStyle.RapidMove; } path3D.AddLine(plotStyle, moveAction.X, moveAction.Y, moveAction.Z, moveAction.ParametriTaglio); }
/// <summary> /// forse questo metodo non รจ necessario che risieda qui.. /// </summary> /// <param name="programPhase"></param> /// <returns></returns> public List <IPreviewEntity> GetPreview(ProgramOperation programPhase) { if (programPhase == null) { return(null); } var path3D = new PreviewPathBuilder(); // path3D.SetStartPoint(CurrentX, CurrentY, CurrentZ); foreach (var programAction in programPhase.Azioni) { // qui fare metodo ricorsivo.. if (programAction is MacroForaturaAzione) { var macro = programAction as MacroForaturaAzione; //CreatePreview(programAction as MacroDrillingAction, path3D); foreach (var v in macro.MoveActionCollection) { if (v is ArcMoveAction) { var moveAction = programAction as ArcMoveAction; AddElement(path3D, moveAction); } else { AddElement(path3D, v); } } } else if (programAction is ArcMoveAction) { var moveAction = programAction as ArcMoveAction; AddElement(path3D, moveAction); } else if (programAction is LinearMoveAction) { var moveAction = programAction as LinearMoveAction; AddElement(path3D, moveAction); } } return(path3D.GetProfile()); }