/// <summary> /// Returns all layers in the recipe structure auto generating based on array info. /// Sacrifice order/arrangement for speed. /// </summary> /// <param name="recipeIn">The recipe structure</param> /// <param name="callbackIn">A callback to receive the recipe layers</param> public static void BeginGetAllLayers_Parallel(MRecipe recipeIn, Action <MRecipeDeviceLayer> callbackIn) { recipeIn.BeginGetAllPlates_Parallel((plate) => { BeginGetAllLayers_Parallel(plate, callbackIn); }); }
/// <summary> /// The copy constructor. /// </summary> /// <param name="recipe"></param> private MRecipe(MRecipe recipe) : base(recipe) { DefaultFilePath = (string)recipe.DefaultFilePath.Clone(); TransformInfo = (TransformInfo)recipe.TransformInfo.Clone(); Plates = new ObservableCollection <MRecipePlate>(); foreach (var plate in recipe.Plates) { var p = (MRecipePlate)plate.Clone(); p.Parent = this; Plates.Add(p); } }
public static Matrix4x4 GetRelativeTransform(MRecipe recipe, MRecipeDevice device) { if (device.Parent == null) { recipe.UpdateParents(); } return(GeometricArithmeticModule.CombineTransformations( // add device's transform device.TransformInfo.ToMatrix4x4(), // add plate's transform (device.Parent as MRecipeBaseNode).TransformInfo.ToMatrix4x4() )); }
/// <summary> /// Returns nodes in the recipe structure without travesing arrays. /// </summary> /// <param name="recipeIn">The recipe structure</param> /// <param name="callbackIn">A callback to receive the recipe nodes</param> public static void BeginGetNodes(MRecipe recipeIn, Action <MRecipeBaseNode> callbackIn) { foreach (var plate in recipeIn.Plates) { callbackIn(plate); foreach (var device in plate.Devices) { callbackIn(device); foreach (var layer in device.Layers) { callbackIn(layer); } } } }
public static Matrix4x4 GetRelativeTransform(MRecipe recipe, MRecipeBaseNode recipeNode) { if (recipeNode is MRecipePlate plate) { return(GetRelativeTransform(plate)); } else if (recipeNode is MRecipeDevice device) { return(GetRelativeTransform(recipe, device)); } else if (recipeNode is MRecipeDeviceLayer layer) { return(GetRelativeTransform(recipe, layer)); } return(GeometricArithmeticModule.GetDefaultTransformationMatrix()); }
/// <summary> /// Use method to calculate a recipe's extents. /// Warning this method could take a really long time depending on the number of geometries. /// </summary> /// <param name="recipeIn">The recipe</param> /// <param name="patternToExtentsFuncIn">A func that returns the count and extents of a given pattern file.</param> /// <returns>The count and extents of geometries within node</returns> public static (long Count, GeometryExtents <double> Extents) CalculateExtents(MRecipe recipeIn, Func <string, (long Count, GeometryExtents <double> Extents)> patternToExtentsFuncIn)