Example #1
0
        public static HCameraSetupModel Deserialize(Stream stream)
        {
            HCameraSetupModel hcameraSetupModel = new HCameraSetupModel();

            hcameraSetupModel.DeserializeCameraSetupModel(HSerializedItem.Deserialize(stream));
            return(hcameraSetupModel);
        }
Example #2
0
        public HCameraSetupModel Clone()
        {
            HSerializedItem   serializedItemHandle = this.SerializeCameraSetupModel();
            HCameraSetupModel hcameraSetupModel    = new HCameraSetupModel();

            hcameraSetupModel.DeserializeCameraSetupModel(serializedItemHandle);
            serializedItemHandle.Dispose();
            return(hcameraSetupModel);
        }
Example #3
0
        internal static int LoadNew(IntPtr proc, int parIndex, int err, out HCameraSetupModel[] obj)
        {
            HTuple tuple;

            err = HTuple.LoadNew(proc, parIndex, err, out tuple);
            obj = new HCameraSetupModel[tuple.Length];
            for (int index = 0; index < tuple.Length; ++index)
            {
                obj[index] = new HCameraSetupModel(tuple[index].IP);
            }
            return(err);
        }
Example #4
0
        /// <summary>
        ///   Create a HALCON stereo model.
        ///   Modified instance represents: Handle of the stereo model.
        /// </summary>
        /// <param name="cameraSetupModelID">Handle to the camera setup model.</param>
        /// <param name="method">Reconstruction method. Default: "surface_pairwise"</param>
        /// <param name="genParamName">Name of the model parameter to be set. Default: []</param>
        /// <param name="genParamValue">Value of the model parameter to be set. Default: []</param>
        public HStereoModel(
            HCameraSetupModel cameraSetupModelID,
            string method,
            string genParamName,
            HTuple genParamValue)
        {
            IntPtr proc = HalconAPI.PreCall(527);

            HalconAPI.Store(proc, 0, cameraSetupModelID);
            HalconAPI.StoreS(proc, 1, method);
            HalconAPI.StoreS(proc, 2, genParamName);
            HalconAPI.Store(proc, 3, genParamValue);
            HalconAPI.InitOCT(proc, 0);
            int err = HalconAPI.CallProcedure(proc);

            HalconAPI.UnpinTuple(genParamValue);
            int procResult = this.Load(proc, 0, err);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            GC.KeepAlive((object)cameraSetupModelID);
        }
Example #5
0
 internal static int LoadNew(IntPtr proc, int parIndex, int err, out HCameraSetupModel obj)
 {
     obj = new HCameraSetupModel(HTool.UNDEF);
     return(obj.Load(proc, parIndex, err));
 }