Example #1
0
        /// <summary>
        ///   Normalize a dual quaternion.
        ///   Instance represents: Unit dual quaternion.
        /// </summary>
        /// <returns>Normalized dual quaternion.</returns>
        public HDualQuaternion DualQuatNormalize()
        {
            IntPtr proc = HalconAPI.PreCall(2062);

            this.Store(proc, 0);
            HalconAPI.InitOCT(proc, 0);
            int err = HalconAPI.CallProcedure(proc);

            this.UnpinTuple();
            HDualQuaternion hdualQuaternion;
            int             procResult = HDualQuaternion.LoadNew(proc, 0, err, out hdualQuaternion);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hdualQuaternion);
        }
Example #2
0
        /// <summary>
        ///   Multiply two dual quaternions.
        ///   Instance represents: Left dual quaternion.
        /// </summary>
        /// <param name="dualQuaternionRight">Right dual quaternion.</param>
        /// <returns>Product of the dual quaternions.</returns>
        public HDualQuaternion DualQuatCompose(HDualQuaternion dualQuaternionRight)
        {
            IntPtr proc = HalconAPI.PreCall(2059);

            this.Store(proc, 0);
            HalconAPI.Store(proc, 1, (HData)dualQuaternionRight);
            HalconAPI.InitOCT(proc, 0);
            int err = HalconAPI.CallProcedure(proc);

            this.UnpinTuple();
            HalconAPI.UnpinTuple((HTuple)((HData)dualQuaternionRight));
            HDualQuaternion hdualQuaternion;
            int             procResult = HDualQuaternion.LoadNew(proc, 0, err, out hdualQuaternion);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hdualQuaternion);
        }
Example #3
0
        /// <summary>
        ///   Interpolate two dual quaternions.
        ///   Instance represents: Dual quaternion as the start point of the interpolation.
        /// </summary>
        /// <param name="dualQuaternionEnd">Dual quaternion as the end point of the interpolation.</param>
        /// <param name="interpPos">Interpolation parameter. Default: 0.5</param>
        /// <returns>Interpolated dual quaternion.</returns>
        public HDualQuaternion DualQuatInterpolate(
            HDualQuaternion dualQuaternionEnd,
            double interpPos)
        {
            IntPtr proc = HalconAPI.PreCall(2061);

            this.Store(proc, 0);
            HalconAPI.Store(proc, 1, (HData)dualQuaternionEnd);
            HalconAPI.StoreD(proc, 2, interpPos);
            HalconAPI.InitOCT(proc, 0);
            int err = HalconAPI.CallProcedure(proc);

            this.UnpinTuple();
            HalconAPI.UnpinTuple((HTuple)((HData)dualQuaternionEnd));
            HDualQuaternion hdualQuaternion;
            int             procResult = HDualQuaternion.LoadNew(proc, 0, err, out hdualQuaternion);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hdualQuaternion);
        }
Example #4
0
 internal static int LoadNew(IntPtr proc, int parIndex, int err, out HDualQuaternion obj)
 {
     return(HDualQuaternion.LoadNew(proc, parIndex, HTupleType.MIXED, err, out obj));
 }