コード例 #1
0
        public void Initialize(HLODControllerBase controller, ISpaceManager spaceManager, HLODTreeNode parent)
        {
            for (int i = 0; i < m_childTreeNodeIds.Count; ++i)
            {
                var childTreeNode = m_container.Get(m_childTreeNodeIds[i]);
                childTreeNode.Initialize(controller, spaceManager, this);
            }

            //set to initialize state
            m_fsm.ChangeState(State.Release);

            m_fsm.RegisterIsReadyToEnterFunction(State.Release, IsReadyToEnterRelease);
            m_fsm.RegisterEnteredFunction(State.Release, OnEnteredRelease);

            m_fsm.RegisterEnteringFunction(State.Low, OnEnteringLow);
            m_fsm.RegisterIsReadyToEnterFunction(State.Low, IsReadyToEnterLow);
            m_fsm.RegisterEnteredFunction(State.Low, OnEnteredLow);
            m_fsm.RegisterExitedFunction(State.Low, OnExitedLow);

            m_fsm.RegisterEnteringFunction(State.High, OnEnteringHigh);
            m_fsm.RegisterIsReadyToEnterFunction(State.High, IsReadyToEnterHigh);
            m_fsm.RegisterEnteredFunction(State.High, OnEnteredHigh);
            m_fsm.RegisterExitedFunction(State.High, OnExitedHigh);

            m_controller   = controller;
            m_spaceManager = spaceManager;
            m_parent       = parent;

            m_isVisible          = true;
            m_isVisibleHierarchy = true;

            m_boundsLength = m_bounds.extents.x * m_bounds.extents.x + m_bounds.extents.z * m_bounds.extents.z;
        }
コード例 #2
0
ファイル: Helper.cs プロジェクト: vbodurov/space-manager
 public static void PopulatePoints(ISpaceManager sm, Space<string> space)
 {
     sm.AddPoint(space, p0, 0, 0, 0);
     sm.AddPoint(space, p1, 1, 8, 3);
     sm.AddPoint(space, p3, 5, 5, 5);
     sm.AddPoint(space, p2, 1, -1, -1);
     sm.AddPoint(space, p4, 7, 1, 1);
 }
コード例 #3
0
 public static void PopulatePoints(ISpaceManager sm, Space <string> space)
 {
     sm.AddPoint(space, p0, 0, 0, 0);
     sm.AddPoint(space, p1, 1, 8, 3);
     sm.AddPoint(space, p3, 5, 5, 5);
     sm.AddPoint(space, p2, 1, -1, -1);
     sm.AddPoint(space, p4, 7, 1, 1);
 }
コード例 #4
0
 public ISpaceManager GetSpaceManager()
 {
     if (_space == null)
     {
         _space = new SpaceManager(_http);
     }
     return(_space);
 }
コード例 #5
0
ファイル: Ext.cs プロジェクト: vbodurov/space-manager
        public static SpacePoint <string> FindNearest(this ISpaceManager sm, SpacePoint <string> center, float within)
        {
            var pan = new PointNfo <string>(null, Single.MaxValue);

            return(sm.AggregateWithin(center, pan, within, (aggr, curr, cen, dis) =>
            {
                if (dis < aggr.Distance)
                {
                    aggr.Point = curr;
                    aggr.Distance = dis;
                }
                return aggr;
            }).Point);
        }
コード例 #6
0
ファイル: HLOD.cs プロジェクト: ray820328/UnityOpenWorld
        public void StopUseInEditor()
        {
            var controller = GetComponent <ControllerBase>();

            if (controller == null)
            {
                return;
            }

            controller.OnStop();

            m_root.Cull();
            m_spaceManager  = null;
            m_activeManager = null;
        }
コード例 #7
0
 public RIFStorage(IStreamHandler streamHandler, int bufferPageSize, int bufferPageCount, int tempStreamSize, ISpaceManager spaceManager, IScalabilityObjectCreator appObjectCreator, IReferenceCreator appReferenceCreator, GlobalIDOwnerCollection globalIdsFromOtherStream, bool fromExistingStream, int rifCompatVersion)
 {
     this.m_streamCreator            = streamHandler;
     this.m_scalabilityCache         = null;
     this.m_bufferPageSize           = bufferPageSize;
     this.m_bufferPageCount          = bufferPageCount;
     this.m_tempStreamSize           = tempStreamSize;
     this.m_stream                   = null;
     this.m_spaceManager             = spaceManager;
     this.m_unifiedObjectCreator     = new UnifiedObjectCreator(appObjectCreator, appReferenceCreator);
     this.m_referenceCreator         = new UnifiedReferenceCreator(appReferenceCreator);
     this.m_fromExistingStream       = fromExistingStream;
     this.m_globalIdsFromOtherStream = globalIdsFromOtherStream;
     this.m_rifCompatVersion         = rifCompatVersion;
 }
コード例 #8
0
        public DimensionWindow()
        {
            InitializeComponent();

            TheCanvas.MouseMove += OnCanvasMouseMove;
            TheCanvas.MouseDown += OnCanvasMouseDown;
            TheCanvas.MouseUp += OnCanvasMouseUp;

            _manager = SpaceFactory.Current.DimensionManager;
            _space = _manager.CreateSpace<int>(new TestConfig());
            _dimensionPainter = new DimensionPainter(TheCanvas);

            _manager.PopulateSpace(_space, GetTestPoints(_space));

            DrawTree();

            //MessageBox.Show(sw.ElapsedMilliseconds + "|");
        }
コード例 #9
0
        public DimensionWindow()
        {
            InitializeComponent();

            TheCanvas.MouseMove += OnCanvasMouseMove;
            TheCanvas.MouseDown += OnCanvasMouseDown;
            TheCanvas.MouseUp   += OnCanvasMouseUp;



            _manager          = SpaceFactory.Current.DimensionManager;
            _space            = _manager.CreateSpace <int>(new TestConfig());
            _dimensionPainter = new DimensionPainter(TheCanvas);

            _manager.PopulateSpace(_space, GetTestPoints(_space));

            DrawTree();

            //MessageBox.Show(sw.ElapsedMilliseconds + "|");
        }
コード例 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RecordStream" /> class.
        /// Usually you call this constructor when you intend to load an existing record from the specified position.
        /// </summary>
        /// <param name="infoStream">A <see cref="System.IO.Stream" /> where meta information is stored.
        /// The meta information will be saved at the current position of this stream.
        /// This stream is allowed to be the same as <paramref name="dataStream" />.</param>
        /// <param name="infoPosition">The position of meta information in the <paramref name="infoStream" />.
        /// Set this parameter to -1 to mark this record as a new record.</param>
        /// <param name="dataStream">A <see cref="System.IO.Stream" /> where data are actually stored.
        /// This stream is allowed to be the same as <paramref name="infoStream" />.</param>
        /// <param name="manager">A <see cref="IRecordManager" /> that manages this record stream,
        /// providing functionality of space release and optimization.</param>
        public RecordStream(Stream infoStream, long infoPosition, Stream dataStream,
                            ISpaceManager manager = null)
        {
            if (infoStream == null)
            {
                throw new ArgumentNullException("infoStream");
            }
            if (dataStream == null)
            {
                throw new ArgumentNullException("dataStream");
            }
            if (infoPosition < -1)
            {
                throw new ArgumentOutOfRangeException("infoPosition");
            }

            _infoStream = infoStream;
            _dataStream = dataStream;
            _infoPos    = infoPosition;
            _manager    = manager;
        }
コード例 #11
0
        public void Initialize(ControllerBase controller, ISpaceManager spaceManager, ActiveHLODTreeNodeManager activeManager)
        {
            for (int i = 0; i < m_childTreeNodes.Count; ++i)
            {
                m_childTreeNodes[i].Initialize(controller, spaceManager, activeManager);
            }

            //set to initialize state
            m_fsm.ChangeState(State.Release);

            m_fsm.RegisterEnteredFunction(State.Release, OnEnteredRelease);

            m_fsm.RegisterEnteringFunction(State.Low, OnEnteringLow);
            m_fsm.RegisterEnteredFunction(State.Low, OnEnteredLow);
            m_fsm.RegisterExitedFunction(State.Low, OnExitedLow);

            m_fsm.RegisterEnteringFunction(State.High, OnEnteringHigh);
            m_fsm.RegisterEnteredFunction(State.High, OnEnteredHigh);
            m_fsm.RegisterExitedFunction(State.High, OnExitedHigh);

            m_controller    = controller;
            m_spaceManager  = spaceManager;
            m_activeManager = activeManager;
        }
コード例 #12
0
 public SpaceUnitTest() : base()
 {
     Manager = new SpaceManager(Client);
 }
コード例 #13
0
 internal SpaceManager()
 {
     _spaceManager = this;
 }
コード例 #14
0
ファイル: HLOD.cs プロジェクト: ray820328/UnityOpenWorld
 void Awake()
 {
     m_spaceManager  = new QuadTreeSpaceManager(this);
     m_activeManager = new ActiveHLODTreeNodeManager();
 }
コード例 #15
0
 private SpaceFactory()
 {
     _config = new Space3DConfig();
     _spaceManager = new SpaceManager();
 }
コード例 #16
0
ファイル: Space.cs プロジェクト: vbodurov/space-manager
 public Space(ISpaceConfig config, ISpaceManager spaceManager)
 {
     Config     = config;
     Manager    = spaceManager;
     Dimensions = new Dimension <T> [Config.NumDimensions];
 }
コード例 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RecordStream"/> class.
 /// Call this constructor if you intend to create a new recod; otherwise call a constructor that allows you to set the position parameter.
 /// </summary>
 /// <param name="infoStream">A <see cref="System.IO.Stream"/> where meta information is stored.
 /// The meta information will be stored at the end of the <paramref name="infoStream" /> when you call <c>SaveInfo</c> method.
 /// This stream is allowed to be the same as <paramref name="dataStream"/>.</param>
 /// <param name="dataStream">A <see cref="System.IO.Stream"/> where data are actually stored.
 /// This stream is allowed to be the same as <paramref name="infoStream"/>.</param>
 /// <param name="manager">A System.IO.IRecordManager that manages this record stream,
 /// providing functionality of space release and optimization.</param>
 public RecordStream(Stream infoStream, Stream dataStream, ISpaceManager manager = null)
     : this(infoStream, -1, dataStream, manager)
 {
 }