protected override void DoCreate()
    {
        base.DoCreate();

        cameraImageDrawer_ = new smartar.CameraImageDrawer(smart_);
        sensorDevice_      = new smartar.SensorDevice(smart_);
        screenDevice_      = new smartar.ScreenDevice(smart_);

        smartar.SensorDeviceInfo sensorInfo = new smartar.SensorDeviceInfo();
        sensorDevice_.GetDeviceInfo(sensorInfo);
        recognizer_.SetSensorDeviceInfo(sensorInfo);

        CreateParam param;

        param.smart_             = smart_.self_;
        param.recognizer_        = recognizer_.self_;
        param.sensorDevice_      = sensorDevice_.self_;
        param.screenDevice_      = screenDevice_.self_;
        param.cameraImageDrawer_ = cameraImageDrawer_.self_;
        self_ = sarSmartar_SarSmartARController_sarDoCreate(ref param, numWorkerThreads_ > 0);

        if (self_ != IntPtr.Zero)
        {
            // Start worker threads
            if (numWorkerThreads_ > 0)
            {
                workerThreads_ = new Thread[numWorkerThreads_];
                for (int i = 0; i < numWorkerThreads_; ++i)
                {
                    Thread thread = new Thread(() => {
                        sarSmartar_SarSmartARController_sarRunWorkerThread(self_);
                    });
                    thread.Start();
                    workerThreads_[i] = thread;
                }
            }
            else
            {
                workerThreads_ = null;
            }

            started_ = true;
        }
    }
Beispiel #2
0
 public int SetSensorDeviceInfo(SensorDeviceInfo info)
 {
     return(sarSmartar_SarRecognizer_sarSetSensorDeviceInfo(self_, info.self_));
 }
Beispiel #3
0
 // get info
 public int GetDeviceInfo(SensorDeviceInfo info)
 {
     return(sarSmartar_SarSensorDevice_sarGetDeviceInfo(self_, info.self_));
 }