Beispiel #1
0
 protected MRecipeBaseNode(MRecipeBaseNode node)
     : base(node)
 {
     Tag           = (string)node.Tag.Clone();
     ArrayInfo     = (MArrayInfo)node.ArrayInfo.Clone();
     TransformInfo = (TransformInfo)node.TransformInfo.Clone();
     Fiducials     = new ObservableCollection <MFiducialInfo>();
     foreach (var fiducial in node.Fiducials)
     {
         Fiducials.Add((MFiducialInfo)fiducial.Clone());
     }
 }
Beispiel #2
0
 /// <summary>
 ///     Returns all layers in the recipe node auto generating based on its array info.
 ///     Sacrifice order/arrangement for speed.
 /// </summary>
 /// <param name="nodeIn">The layer</param>
 /// <param name="callbackIn">A callback to receive the recipe layers</param>
 public static void BeginGetAllLayers_Parallel(MRecipeBaseNode nodeIn, Action <MRecipeDeviceLayer> callbackIn)
 {
     if (nodeIn is MRecipePlate plate)
     {
         BeginGetAllLayers_Parallel(plate, callbackIn);
     }
     else if (nodeIn is MRecipeDevice device)
     {
         BeginGetAllLayers_Parallel(device, callbackIn);
     }
     else if (nodeIn is MRecipeDeviceLayer layer)
     {
         callbackIn(layer);
     }
 }
Beispiel #3
0
        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());
        }
Beispiel #4
0
        public static Matrix4x4 GetRelativeTransformFromParent(MRecipeBaseNode parentNode, MRecipeBaseNode recipeNode)
        {
            var transformChain = new List <Matrix4x4>();

            var nodeParent = recipeNode;

            while (
                nodeParent != null &&
                nodeParent != parentNode
                )
            {
                transformChain.Add(nodeParent.TransformInfo.ToMatrix4x4());
                nodeParent = nodeParent.Parent as MRecipeBaseNode;
            }

            transformChain.Add(parentNode.TransformInfo.ToMatrix4x4());
            return(GeometricArithmeticModule.CombineTransformations(transformChain.ToArray()));
        }