Ejemplo n.º 1
0
        public bool Uninitialize()
        {
            ResetMap();

            DynamicLoader.OnDynamicLoad -= DynamicLoader_OnDynamicLoad;
            _actionReceiver.OnAction    -= ActionReceiver_OnAction;

            NodeLock.WaitLockEdit();

            _native_camera.Debug(_native_context, false);
            _native_camera.Dispose();
            _native_camera = null;

            _native_context.Dispose();
            _native_context = null;

            _native_scene.Dispose();
            _native_scene = null;


            _actionReceiver.Dispose();
            _actionReceiver = null;

            NodeLock.UnLock();

            GizmoSDK.Gizmo3D.Platform.UnInitialize();

            _plugin_initializer = null;

            return(true);
        }
Ejemplo n.º 2
0
        public bool Initialize()
        {
            _actionReceiver           = new NodeAction("DynamicLoadManager");
            _actionReceiver.OnAction += ActionReceiver_OnAction;

            _zflipMatrix = new Matrix4x4(new Vector4(1, 0, 0), new Vector4(0, 1, 0), new Vector4(0, 0, -1), new Vector4(0, 0, 0, 1));

            GizmoSDK.GizmoBase.Message.Send("SceneManager", MessageLevel.DEBUG, "Loading Graph");

            GizmoSDK.Gizmo3D.Platform.Initialize();

            NodeLock.WaitLockEdit();

            _native_camera             = new PerspCamera("Test");
            _native_camera.RoiPosition = true;
            _controller.Camera         = _native_camera;

            _native_scene = new Scene("TestScene");

            _native_context = new Context();

            //native_camera.Debug(native_context);

            _native_traverse_action = new CullTraverseAction();

            DynamicLoader.OnDynamicLoad += DynamicLoader_OnDynamicLoad;

            _native_camera.Scene = _native_scene;

            NodeLock.UnLock();

            DbManager.Initialize();

            return(true);
        }
Ejemplo n.º 3
0
        public bool Uninitialize()
        {
            DynamicLoaderManager.StopManager();

            ResetMap();

            DynamicLoader.OnDynamicLoad -= DynamicLoader_OnDynamicLoad;
            _actionReceiver.OnAction    -= ActionReceiver_OnAction;

            NodeLock.WaitLockEdit();

            try // We are now locked in edit
            {
                _native_camera.Debug(_native_context, false);
                _native_camera.Dispose();
                _native_camera = null;

                _native_context.Dispose();
                _native_context = null;

                _native_scene.Dispose();
                _native_scene = null;


                _actionReceiver.Dispose();
                _actionReceiver = null;
            }
            finally
            {
                NodeLock.UnLock();
            }


            return(true);
        }
Ejemplo n.º 4
0
        public bool Uninitialize()
        {
            if (!_initialized)
            {
                return(false);
            }

            // Stop manager
            DynamicLoaderManager.StopManager();

            ResetMap();

            // Remove actions
            DynamicLoader.OnDynamicLoad -= DynamicLoader_OnDynamicLoad;
            _actionReceiver.OnAction    -= ActionReceiver_OnAction;

            NodeLock.WaitLockEdit();

            try // We are now locked in edit
            {
                _native_camera.Debug(_native_context, false);
                _native_camera.Dispose();
                _native_camera = null;

                _native_context.Dispose();
                _native_context = null;

                _native_scene.Dispose();
                _native_scene = null;


                _actionReceiver.Dispose();
                _actionReceiver = null;
            }
            finally
            {
                NodeLock.UnLock();
            }

            // Drop platform streamer
            GizmoSDK.Gizmo3D.Platform.Uninitialize();

            _initialized = false;

            return(true);
        }
Ejemplo n.º 5
0
        public bool InitializeInternal()
        {
            _actionReceiver = new NodeAction("DynamicLoadManager");

            _actionReceiver.OnAction += ActionReceiver_OnAction;

            _zflipMatrix = new Matrix4x4(new Vector4(1, 0, 0), new Vector4(0, 1, 0), new Vector4(0, 0, -1), new Vector4(0, 0, 0, 1));

            GizmoSDK.GizmoBase.Message.Send("SceneManager", MessageLevel.DEBUG, "Loading Graph");

            NodeLock.WaitLockEdit();

            try // We are now locked in edit
            {
                _native_camera              = new PerspCamera("Test");
                _native_camera.RoiPosition  = true;
                MapControl.SystemMap.Camera = _native_camera;

                _native_scene = new Scene("TestScene");

                _native_context = new Context();

#if DEBUG_CAMERA
                _native_camera.Debug(_native_context);      // Enable to debug view
#endif // DEBUG_CAMERA

                _native_traverse_action = new CullTraverseAction();

                DynamicLoader.OnDynamicLoad += DynamicLoader_OnDynamicLoad;

                _native_camera.Scene = _native_scene;
            }
            finally
            {
                NodeLock.UnLock();
            }


            DynamicLoader.UsePreCache(true);                    // Enable use of mipmap creation on dynamic loading
            DynamicLoaderManager.SetNumberOfActiveLoaders(4);   // Lets start with 4 parallell threads
            DynamicLoaderManager.StartManager();

            return(true);
        }
Ejemplo n.º 6
0
        public bool InitializeInternal()
        {
            // Initialize streamer APIs
            if (!GizmoSDK.Gizmo3D.Platform.Initialize())
            {
                return(false);
            }

            // Initialize formats
            DbManager.Initialize();

            GizmoSDK.GizmoBase.Message.Send("SceneManager", MessageLevel.DEBUG, "Initialize Graph Streaming");

            // Add builder for registered types
            AddDefaultBuilders();

            // Setup internal subscription events
            _actionReceiver           = new NodeAction("DynamicLoadManager");
            _actionReceiver.OnAction += ActionReceiver_OnAction;

            DynamicLoader.OnDynamicLoad += DynamicLoader_OnDynamicLoad;


            NodeLock.WaitLockEdit();

            try // We are now locked in edit
            {
                // Camera setup
                _native_camera              = new PerspCamera("Test");
                _native_camera.RoiPosition  = true;
                MapControl.SystemMap.Camera = _native_camera;

                // Top scene
                _native_scene        = new Scene("Scene");
                _native_camera.Scene = _native_scene;

                // Top context
                _native_context = new Context();

#if DEBUG_CAMERA
                // If we want to visualize debug 3D
                _native_camera.Debug(_native_context);      // Enable to debug view
#endif // DEBUG_CAMERA

                // Default travrser
                _native_traverse_action = new CullTraverseAction();

                // _native_traverse_action.SetOmniTraverser(true);  // To skip camera cull and use LOD in omni directions
            }
            finally
            {
                NodeLock.UnLock();
            }

            // Set up dynamic loading
            DynamicLoader.UsePreCache(true);                                        // Enable use of mipmap creation on dynamic loading
            DynamicLoaderManager.SetNumberOfActiveLoaders(Settings.DynamicLoaders); // Lets start with 4 parallell threads
            DynamicLoaderManager.StartManager();

            // Start coroutines for asset loading
            StartCoroutine(AssetLoader());

            return(true);
        }