Exemple #1
0
        // Add a new 3D-model in Obj-format to track
        private void AddObject(out ResultCode result, string fullFileName, float tx, float ty, float tz, float alpha, float beta, float gamma, float scale, float qualityThreshold, float[] templateDistances)
        {
            int      resCode;
            Object3D tmpObj = null;

            StringBuilder tmpStr = new StringBuilder(fullFileName);

            unsafe
            {
                fixed(float *templateDistancesPtr = templateDistances)
                {
                    resCode = Interop.AddObj3d(tmpStr, tx, ty, tz, alpha, beta, gamma, scale, qualityThreshold, templateDistancesPtr);
                }
            }

            result = (ResultCode)resCode;
            if (result == ResultCode.Successful)
            {
                tmpObj = new Object3D(fullFileName, tx, ty, tz, alpha, beta, gamma, scale);
                objects.Add(tmpObj);
            }

            ObjectAddedEvent.Invoke(new RBOT_ObjectAddedEventArgs("Object added", (ResultCode)resCode, tmpObj));
        }