示例#1
0
    public void onResetClicked()
    {
        Debug.Log("On Reset Click");

        Debug.Log(mReconstructionBehaviour);
        Debug.Log(mReconstructionBehaviour);

        if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
        {
            bool trackerWasActive = mTracker.IsActive;
            // first stop the tracker
            if (trackerWasActive)
            {
                mTracker.Stop();
            }
            // now you can reset...
            mReconstructionBehaviour.Reconstruction.Reset();
            // ... and restart the tracker
            if (trackerWasActive)
            {
                mTracker.Start();
                mReconstructionBehaviour.Reconstruction.Start();
            }
        }

        //mReconstructionBehaviour.Reconstruction.Reset();
    }
示例#2
0
    public void ResetSmartTerrain()
    {
        if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
        {
            Debug.Log("Resetting Smart Terrain");

            SmartTerrainTracker stTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>();
            bool trackerWasActive         = stTracker.IsActive;

            // first stop the tracker
            if (trackerWasActive)
            {
                stTracker.Stop();
            }

            // now you can reset...
            mReconstructionBehaviour.Reconstruction.Reset();

            // ... and restart the tracker
            if (trackerWasActive)
            {
                stTracker.Start();
                mReconstructionBehaviour.Reconstruction.Start();
            }

            // After a Reset, the ST reconstruction will be active again,
            // so we need to sync the UI
            Button startBtn = base.FindUISelectableWithText <Button>("Start");
            if (startBtn)
            {
                startBtn.GetComponentInChildren <Text>().text = "Stop";
            }
        }
    }
    //对实物建模进行刷新
    public void Refresh()
    {
        if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
        {
            bool trackerWasActive = DT_Tracker.IsActive;
            // 停止Smart Terrain Tracker
            if (trackerWasActive)
            {
                DT_Tracker.Stop();
            }
            // 重置Reconstruction
            mReconstructionBehaviour.Reconstruction.Reset();
            // 重新进行扫描检测
            if (trackerWasActive)
            {
                DT_Tracker.Start();
                mReconstructionBehaviour.Reconstruction.Start();
            }
        }

        //重置表面为未发现
        surfaceFound = false;
        //重新置为0
        num = 0;
    }
 public void restart()
 {
     if (mTracker == null || mReconstructionBehaviour == null)
     {
         mTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>();
         mReconstructionBehaviour = (ReconstructionBehaviour)FindObjectOfType(typeof(ReconstructionBehaviour));
     }
     if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
     {
         bool trackerWasActive = mTracker.IsActive;
         // first stop the tracker
         if (trackerWasActive)
         {
             mTracker.Stop();
         }
         // now you can reset...
         mReconstructionBehaviour.Reconstruction.Reset();
         // ... and restart the tracker
         if (trackerWasActive)
         {
             mTracker.Start();
             mReconstructionBehaviour.Reconstruction.Start();
         }
     }
 }
示例#5
0
 // Handles the user reseting the construction of their table mesh
 public void resetReconstruction()
 {
     if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
     {
         bool trackerWasActive = mTracker.IsActive;
         // first stop the tracker
         if (trackerWasActive)
         {
             mTracker.Stop();
         }
         // now you can reset...
         mReconstructionBehaviour.Reconstruction.Reset();
         // ... and restart the tracker
         if (trackerWasActive)
         {
             mTracker.Start();
             mReconstructionBehaviour.Reconstruction.Start();
         }
     }
 }
    private void OnTappedOnReset(bool tf)
    {
        Debug.Log("Reset Smart Terrain [" + Time.time + "]");

        bool trackerWasActive = mTracker.IsActive;

        // first stop the tracker
        if (trackerWasActive)
        {
            mTracker.Stop();
        }
        // now you can reset...
        mTracker.Reset();
        // ... and restart the tracker
        if (trackerWasActive)
        {
            mTracker.Start();
            mTracker.StartMeshUpdates();
        }

        this.View.mStartStopScanning.Title = "Stop";
        OnTappedToClose();
    }