Ejemplo n.º 1
0
        private void SpawnPrefab(VectorEntity ve, UnityTile tile, Vector2d latLong)
        {
            GameObject go;

            var featureId = ve.Feature.Data.Id;

            if (_objects.ContainsKey(featureId))
            {
                go = _objects[featureId];
                go.SetActive(true);
                go.transform.SetParent(ve.GameObject.transform, false);
            }
            else
            {
                go = Instantiate(_options.prefab);
                _prefabList.Add(go);
                _objects.Add(featureId, go);
                _objectPosition.Add(featureId, latLong);
                go.transform.SetParent(ve.GameObject.transform, false);
            }

            PositionScaleRectTransform(ve, tile, go, latLong);

            if (_options.AllPrefabsInstatiated != null)
            {
                _options.AllPrefabsInstatiated(_prefabList);
            }
        }
Ejemplo n.º 2
0
 public override void Run(VectorEntity ve, UnityTile tile)
 {
     if (_colliderStrategy != null)
     {
         _colliderStrategy.AddColliderTo(ve);
     }
 }
Ejemplo n.º 3
0
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            var min  = Math.Min(_options.materials.Length, ve.MeshFilter.mesh.subMeshCount);
            var mats = new Material[min];

            if (!_options.projectMapImagery)
            {
                for (int i = 0; i < min; i++)
                {
                    mats[i] = _options.materials[i].Materials[UnityEngine.Random.Range(0, _options.materials[i].Materials.Length)];
                }
            }
            else
            {
                for (int i = 0; i < min; i++)
                {
                    mats[i] = Instantiate(_options.materials[i].Materials[UnityEngine.Random.Range(0, _options.materials[i].Materials.Length)]);
                }

                mats[0].mainTexture      = tile.GetRasterData();
                mats[0].mainTextureScale = new Vector2(1f, 1f);
            }

            ve.MeshRenderer.materials = mats;
        }
 public override void Run(VectorEntity ve, UnityTile tile)
 {
     //replace the feature only once per lat/lon
     if (ShouldSpawnFeature(ve.Feature))
     {
         SpawnPrefab(ve, tile);
     }
 }
Ejemplo n.º 5
0
 //Send in the parameters needed
 public void Initialize(VectorEntity ve, GameObject Canvas, GameObject Text, GameObject UiImage, Dictionary <string, Sprite> SpriteSet)
 {
     _ve        = ve;
     _Canvas    = Canvas;
     _Text      = Text;
     _UiImage   = UiImage;
     _SpriteSet = SpriteSet;
 }
        public void Initialize(VectorEntity ve)
        {
            VectorEntity = ve;
            Transform    = transform;
            Data         = ve.Feature;

            //var label = ve.GameObject.GetComponent<CustomLabelTextSetter>();
            //label.SetName(Data.Properties["name"].ToString());
        }
Ejemplo n.º 7
0
    public override void Run(VectorEntity ve, UnityTile tile)
    {
        if (map == null)
        {
            map = FindObjectOfType <AbstractMap>();
        }

        OnPoolItem(ve);
    }
Ejemplo n.º 8
0
 public override void Run(VectorEntity ve, UnityTile tile)
 {
     // if collider exists. remove it.
     RemoveColliderFrom(ve);
     if (_colliderStrategy != null)
     {
         _colliderStrategy.AddColliderTo(ve);
     }
 }
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            //create a very small random offset to avoid z-fighting
            Vector3 randomOffset = Random.insideUnitSphere;

            randomOffset *= 0.01f;

            ve.GameObject.transform.localPosition += randomOffset;
        }
Ejemplo n.º 10
0
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            int selpos = ve.Feature.Points[0].Count / 2;
            var met    = ve.Feature.Points[0][selpos];

            IFeaturePropertySettable settable = null;
            GameObject go;

            if (_objects.ContainsKey(ve.GameObject))
            {
                go       = _objects[ve.GameObject];
                settable = go.GetComponent <IFeaturePropertySettable>();
                if (settable != null)
                {
                    go = (settable as MonoBehaviour).gameObject;
                    settable.Set(ve.Feature.Properties);
                }
                // set gameObject transform
                go.name = ve.Feature.Data.Id.ToString();
                go.transform.localPosition = met;
                go.transform.localScale    = Constants.Math.Vector3One;

                if (!_options.scaleDownWithWorld)
                {
                    go.transform.localScale = Vector3.one / tile.TileScale;
                }
                return;
            }
            else
            {
                go = Instantiate(_options.prefab);
                _prefabList.Add(go);
                _objects.Add(ve.GameObject, go);
            }

            go.name = ve.Feature.Data.Id.ToString();
            go.transform.position = met;
            go.transform.SetParent(ve.GameObject.transform, false);
            go.transform.localScale = Constants.Math.Vector3One;

            settable = go.GetComponent <IFeaturePropertySettable>();
            if (settable != null)
            {
                settable.Set(ve.Feature.Properties);
            }

            if (!_options.scaleDownWithWorld)
            {
                go.transform.localScale = Vector3.one / tile.TileScale;
            }

            if (_options.AllPrefabsInstatiated != null)
            {
                _options.AllPrefabsInstatiated(_prefabList);
            }
        }
Ejemplo n.º 11
0
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            //replace the feature only once per lat/lon
            Vector2d latLong = Vector2d.zero;

            if (ShouldSpawnFeature(ve.Feature, out latLong))
            {
                SpawnPrefab(ve, tile, latLong);
            }
        }
Ejemplo n.º 12
0
 public override void OnPoolItem(VectorEntity vectorEntity)
 {
     if (_options.style == StyleTypes.Satellite)
     {
         foreach (var material in vectorEntity.MeshRenderer.sharedMaterials)
         {
             DestroyImmediate(material, true);
         }
     }
 }
Ejemplo n.º 13
0
 public void AddColliderTo(VectorEntity ve)
 {
     if (_colliders.ContainsKey(ve.GameObject))
     {
         _colliders[ve.GameObject].sharedMesh = ve.Mesh;
     }
     else
     {
         _colliders.Add(ve.GameObject, ve.GameObject.AddComponent <MeshCollider>());
     }
 }
Ejemplo n.º 14
0
        //public override void Run(VectorEntity ve, UnityTile tile)
        //{
        //  ve.MeshRenderer.enabled = false;

        //}
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            tile.MeshRenderer.reflectionProbeUsage      = ReflectionProbeUsage.Off;
            tile.MeshRenderer.allowOcclusionWhenDynamic = true;
            tile.MeshRenderer.shadowCastingMode         = ShadowCastingMode.Off;
            ve.MeshFilter.mesh.SetTriangles(ve.MeshFilter.mesh.triangles, 0);
            ve.MeshFilter.mesh.subMeshCount      = 1;
            ve.MeshRenderer.reflectionProbeUsage = ReflectionProbeUsage.Off;

            ve.MeshRenderer.materials = Materials;
        }
		public override void Run (VectorEntity fb, UnityTile tile)
		{
			try {
				// Get the static singleton instance.
				markerScript = GeoPosition.Instance;
				// Perform any operation - here height of the buildings are measured.
				markerScript.performAction ();
			} catch (Exception ex) {
				Debug.LogException (ex);
			}
		}
Ejemplo n.º 16
0
        public void RemoveColliderFrom(VectorEntity ve)
        {
            var existingCollider = ve.GameObject.GetComponent <Collider>();

            if (existingCollider == null)
            {
                return;
            }
            DestroyImmediate(existingCollider);
            _colliderStrategy?.Reset();
        }
 public override void Run(VectorEntity ve, UnityTile tile)
 {
     foreach (var t in _types)
     {
         _tempId = ve.GameObject.GetInstanceID() + t.Type.FullName;
         if (!_scripts.Contains(_tempId))
         {
             ve.GameObject.AddComponent(t.Type);
             _scripts.Add(_tempId);
         }
     }
 }
Ejemplo n.º 18
0
 public void AddColliderTo(VectorEntity ve)
 {
     if (_colliders.ContainsKey(ve.GameObject))
     {
         _colliders[ve.GameObject].center = ve.Mesh.bounds.center;
         _colliders[ve.GameObject].size   = ve.Mesh.bounds.size;
     }
     else
     {
         _colliders.Add(ve.GameObject, ve.GameObject.AddComponent <BoxCollider>());
     }
 }
Ejemplo n.º 19
0
 public void AddColliderTo(VectorEntity ve)
 {
     if (_colliders.ContainsKey(ve.GameObject))
     {
         _colliders[ve.GameObject].center = ve.Mesh.bounds.center;
         _colliders[ve.GameObject].radius = ve.Mesh.bounds.extents.magnitude;
     }
     else
     {
         _colliders.Add(ve.GameObject, ve.GameObject.AddComponent <SphereCollider>());
     }
 }
Ejemplo n.º 20
0
        public void RemoveColliderFrom(VectorEntity ve)
        {
            var existingCollider = ve.GameObject.GetComponent <Collider>();

            if (existingCollider != null)
            {
                existingCollider.Destroy();
                if (_colliderStrategy != null)
                {
                    _colliderStrategy.Reset();
                }
            }
        }
 public override void Run(VectorEntity ve, UnityTile tile)
 {
     if (_features.ContainsKey(ve.GameObject))
     {
         _features[ve.GameObject].Initialize(ve);
     }
     else
     {
         _tempFeature = ve.GameObject.AddComponent <FeatureBehaviour>();
         _features.Add(ve.GameObject, _tempFeature);
         _tempFeature.Initialize(ve);
     }
 }
Ejemplo n.º 22
0
 public override void Run(VectorEntity ve, UnityTile tile)
 {
     if (_detectors.ContainsKey(ve.GameObject))
     {
         _detectors[ve.GameObject].Initialize(_marker, ve);
     }
     else
     {
         _tempDetector = ve.GameObject.AddComponent <FeatureSelectionDetector>();
         _detectors.Add(ve.GameObject, _tempDetector);
         _tempDetector.Initialize(_marker, ve);
     }
 }
Ejemplo n.º 23
0
        public override void OnPoolItem(VectorEntity vectorEntity)
        {
            if (_objects.ContainsKey(vectorEntity.GameObject))
            {
                foreach (var item in _objects[vectorEntity.GameObject])
                {
                    item.SetActive(false);
                    _pool.Enqueue(item);
                }

                _objects[vectorEntity.GameObject].Clear();
                _objects.Remove(vectorEntity.GameObject);
            }
        }
Ejemplo n.º 24
0
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            var min  = Math.Min(_options.materials.Length, ve.MeshFilter.sharedMesh.subMeshCount);
            var mats = new Material[min];

            if (_options.style == StyleTypes.Custom)
            {
                for (int i = 0; i < min; i++)
                {
                    mats[i] = _options.customStyleOptions.materials[i].Materials[UnityEngine.Random.Range(0, _options.customStyleOptions.materials[i].Materials.Length)];
                }
            }
            else if (_options.style == StyleTypes.Satellite)
            {
                for (int i = 0; i < min; i++)
                {
                    mats[i] = Instantiate(_options.materials[i].Materials[UnityEngine.Random.Range(0, _options.materials[i].Materials.Length)]);
                }

                mats[0].mainTexture      = tile.GetRasterData();
                mats[0].mainTextureScale = new Vector2(1f, 1f);
            }
            else
            {
                float renderMode = 0.0f;
                switch (_options.style)
                {
                case StyleTypes.Light:
                    renderMode = GetRenderMode(_options.lightStyleOpacity);
                    break;

                case StyleTypes.Dark:
                    renderMode = GetRenderMode(_options.darkStyleOpacity);
                    break;

                case StyleTypes.Color:
                    renderMode = GetRenderMode(_options.colorStyleColor.a);
                    break;

                default:
                    break;
                }
                for (int i = 0; i < min; i++)
                {
                    mats[i] = _options.materials[i].Materials[UnityEngine.Random.Range(0, _options.materials[i].Materials.Length)];
                    mats[i].SetFloat("_Mode", renderMode);
                }
            }
            ve.MeshRenderer.materials = mats;
        }
 public override void Run(VectorEntity ve, UnityTile tile)
 {
     UiImage = new GameObject("Image", typeof(Image));
     UiImage.transform.SetParent(Canvas.transform);
     Text = new GameObject("Text", typeof(Text));
     Text.transform.SetParent(Canvas.transform);
     Text.GetComponent <Text>().font      = Resources.GetBuiltinResource <Font>("Arial.ttf");
     Text.GetComponent <Text> ().fontSize = 10;
     UiGenerator = Instantiate(Resources.Load <GameObject>("UiGenerator"));
     UiGenerator.transform.position = new Vector3(0, 0, 0);
     UiGenerator.transform.SetParent(Canvas.transform);
     _infoPanel = UiGenerator.GetComponent <infoPanel>();
     _infoPanel.Initialize(ve, Canvas, Text, UiImage, _SpriteSet);
 }
Ejemplo n.º 26
0
    public override void Run(VectorEntity ve, UnityTile tile)
    {
        if (map == null)
        {
            map = FindObjectOfType <AbstractMap>();
        }
        ;

        if (ve != null && ve.GameObject != null)
        {
            Instantiate(WellPrefab).transform.SetParent(ve.GameObject.transform, false);
        }

        OnPoolItem(ve);
    }
Ejemplo n.º 27
0
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            _spawnedCount = 0;
            var collider = ve.GameObject.GetComponent <Collider>();
            var bounds   = collider.bounds;
            var center   = bounds.center;

            center.y = 0;

            var area       = (int)(bounds.size.x * bounds.size.z);
            int spawnCount = Mathf.Min(area / _spawnRateInSquareMeters, _maxSpawn);

            while (_spawnedCount < spawnCount)
            {
                var x   = Random.Range(-bounds.extents.x, bounds.extents.x);
                var z   = Random.Range(-bounds.extents.z, bounds.extents.z);
                var ray = new Ray(bounds.center + new Vector3(x, 100, z), Vector3.down * 2000);

                RaycastHit hit;
                //Debug.DrawRay(ray.origin, ray.direction * 1000, Color.yellow, 1000);
                if (Physics.Raycast(ray, out hit, 150, _layerMask))
                {
                    //Debug.DrawLine(ray.origin, hit.point, Color.red, 1000);
                    var index     = Random.Range(0, _prefabs.Length);
                    var transform = ((GameObject)Instantiate(_prefabs[index], ve.Transform, false)).transform;
                    transform.position = hit.point;
                    if (_randomizeRotation)
                    {
                        transform.localEulerAngles = new Vector3(0, Random.Range(-180f, 180f), 0);
                    }
                    if (!_scaleDownWithWorld)
                    {
                        transform.localScale = Vector3.one / tile.TileScale;
                    }

                    if (_randomizeScale)
                    {
                        var scale = transform.localScale;
                        var y     = Random.Range(scale.y * .7f, scale.y * 1.3f);
                        scale.y = y;
                        transform.localScale = scale;
                    }

                    _spawnedCount++;
                }
            }
        }
Ejemplo n.º 28
0
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            var min  = ve.MeshFilter.sharedMesh.subMeshCount;
            var mats = new Material[min];

            Vector2d latLon      = GameObject.Find("Map").GetComponent <AbstractMap>().WorldToGeoPosition(ve.Transform.position);
            float    sample_data = 10;

            for (int i = 0; i < min; i++)
            {
                Material mat = new Material(Shader.Find("Specular"));
                mat.color = dataToColor(sample_data);
                mats[i]   = mat;
            }

            ve.MeshRenderer.materials = mats;
        }
        public override void Run(VectorEntity ve, UnityTile tile)
        {
            var fixedLocationProvider = new FixedLocationData();

            var feature = ve.Feature;

            int      id           = 0;
            float    heading      = 0.0f;
            string   locationName = string.Empty;
            string   latitudeLongitudeString;
            Vector2d latitudeLongitude = Vector2d.zero;

            if (feature.Properties.ContainsKey(_syncLocationIdKey))
            {
                if (!int.TryParse(feature.Properties[_syncLocationIdKey].ToString(), out id))
                {
                    Debug.Log("No property with key : " + _syncLocationIdKey + "found!");
                }
            }

            if (feature.Properties.ContainsKey(_syncLocationNameKey))
            {
                locationName = feature.Properties[_syncLocationNameKey].ToString();
                if (string.IsNullOrEmpty(locationName))
                {
                    Debug.Log("No property with key : " + _syncLocationNameKey + "found!");
                }
            }

            if (feature.Properties.ContainsKey(_syncLocationPositionKey))
            {
                latitudeLongitudeString = feature.Properties[_syncLocationPositionKey].ToString();
                latitudeLongitude       = Conversions.StringToLatLon(latitudeLongitudeString);
            }

            if (feature.Properties.ContainsKey(_syncLocationHeadingKey))
            {
                if (!float.TryParse(feature.Properties[_syncLocationHeadingKey].ToString(), out heading))
                {
                    Debug.Log("No property with key : " + _syncLocationHeadingKey + "found!");
                }
            }

            fixedLocationProvider.SetLocation(id, locationName, "sync-point", latitudeLongitude, heading);
        }
Ejemplo n.º 30
0
        internal void Show(VectorEntity selectedFeature)
        {
            if (selectedFeature == null)
            {
                Clear();
                return;
            }
            _selectedFeature   = selectedFeature;
            transform.position = new Vector3(0, 0, 0);
            var mesh = selectedFeature.MeshFilter;

            if (mesh != null)
            {
                _targetVerts = mesh.mesh.vertices;
                Snap();
            }
            gameObject.SetActive(true);
        }
Ejemplo n.º 31
0
 private void GenBlankLineUsers(int VectorUserCount, VectorEntity Vec, List<User> VectorUserList)
 {
     double area = Vec.Area;
     GeoXYLine flag = Vec.Flag as GeoXYLine;
     VectorUserList.AddRange(this.GenBlankClutterUser(VectorUserCount, area, flag));
 }
Ejemplo n.º 32
0
 private GeoXYPoint GetPointNewName(VectorEntity vetorE, GeoXYPoint geoNode)
 {
     foreach (GeoXYPoint point in this.GeoProvider.GeoNodeList)
     {
         if (point.ID == geoNode.ID)
         {
             vetorE.Flag = point;
             geoNode = point;
         }
     }
     return geoNode;
 }
Ejemplo n.º 33
0
 private void AppendVector(VectorEntity ve, string VectorName)
 {
     if (!(!(ve.Name == VectorName) || this.InVectorList(ve)))
     {
         ve.Density = 0f;
         this.m_VectorMap.SelectedVectorList.Add(ve);
         this.m_ApplyBtn.Enabled = true;
     }
 }
Ejemplo n.º 34
0
 private void setGeoLineToVectorEntity(GeoDataProvider geoDataProvider, VectorEntity vetEntity)
 {
     List<GeoXYLine> geoLineList = geoDataProvider.GeoProvider.GeoLineList;
     foreach (GeoXYLine line in geoLineList)
     {
         if (line.Name == vetEntity.Name)
         {
             vetEntity.Flag = line;
             vetEntity.Area = line.GetDistance();
         }
     }
 }
Ejemplo n.º 35
0
 private void setPolygonToVectorEntity(GeoDataProvider geoDataProvider, VectorEntity vetEntity)
 {
     foreach (GeoPolygonRegion region in geoDataProvider.GeoProvider.PolygonRegionList)
     {
         if (vetEntity.Name == region.Name)
         {
             vetEntity.Flag = region;
             vetEntity.Area = region.RegionArea;
         }
     }
 }
Ejemplo n.º 36
0
 private void AddLineToVectorList(List<GeoXYLine> lines)
 {
     lines.ForEach(delegate (GeoXYLine Line) {
         VectorEntity item = new VectorEntity(Line.Name) {
             Id = Line.ID,
             Type = VectorType.Line,
             Area = Line.GetDistance() / 1000.0,
             Flag = Line
         };
         this.m_VectorList.Add(item);
     });
 }
Ejemplo n.º 37
0
 private void SetVetorEntityNewName(VectorEntity vetorE)
 {
     switch (vetorE.Type)
     {
         case VectorType.Point:
         {
             GeoXYPoint flag = vetorE.Flag as GeoXYPoint;
             flag = this.GetPointNewName(vetorE, flag);
             vetorE.Name = flag.Name;
             break;
         }
         case VectorType.Line:
         {
             GeoXYLine geoTrafficLine = vetorE.Flag as GeoXYLine;
             geoTrafficLine = this.GetLineNewName(vetorE, geoTrafficLine);
             vetorE.Name = geoTrafficLine.Name;
             vetorE.Area = geoTrafficLine.GetDistance() / 1000.0;
             break;
         }
         case VectorType.Polygon:
         {
             GeoPolygonRegion polyRegion = vetorE.Flag as GeoPolygonRegion;
             polyRegion = this.GetPolygonNewName(vetorE, polyRegion);
             vetorE.Name = polyRegion.Name;
             vetorE.Area = polyRegion.RegionArea;
             break;
         }
     }
 }
Ejemplo n.º 38
0
 private bool InVectorList(VectorEntity sve)
 {
     return this.m_VectorList.Exists(ve => sve.Id.Equals(ve.Id));
 }
Ejemplo n.º 39
0
 private List<User> GetVectorUser(VectorEntity Vec, bool isFixure)
 {
     int num2;
     int num = Convert.ToInt32((double) ((Vec.Area * Vec.Density) / ((double) this.m_AreaMap[Vec.Type])));
     if (isFixure)
     {
         num2 = num;
     }
     else
     {
         num2 = Poisson.Poissonize((double) num);
     }
     Vec.ClutterList = this.GetClutterList(Vec, isFixure);
     List<User> vectorUserList = new List<User>();
     double vectorArea = this.GetVectorArea(Vec);
     this.AddVectorUsers(Vec, num2, vectorArea, vectorUserList, isFixure);
     return vectorUserList;
 }
Ejemplo n.º 40
0
 private void GetVectorPolygonList()
 {
     this.m_GeoProvider.PolygonRegionList.ForEach(delegate (GeoPolygonRegion Polygon) {
         VectorEntity item = new VectorEntity(Polygon.Name) {
             Id = Polygon.ID,
             Type = VectorType.Polygon,
             Area = Polygon.RegionArea,
             Flag = Polygon
         };
         this.m_VectorList.Add(item);
     });
 }
Ejemplo n.º 41
0
 private double GetVectorArea(VectorEntity Vec)
 {
     double num = 0.0;
     foreach (ClutterEntity entity in Vec.ClutterList)
     {
         ClutterKind kind = this.FindClutterKind(entity);
         entity.Weight = kind.Weight;
         entity.Indoor = kind.Indoor;
         num += entity.Area * entity.Weight;
     }
     return num;
 }
Ejemplo n.º 42
0
 private GeoPolygonRegion GetPolygonNewName(VectorEntity vetorE, GeoPolygonRegion polyRegion)
 {
     foreach (GeoPolygonRegion region in this.GeoProvider.PolygonRegionList)
     {
         if (region.ID == polyRegion.ID)
         {
             vetorE.Flag = region;
             polyRegion = region;
         }
     }
     return polyRegion;
 }
Ejemplo n.º 43
0
 private void AddVectorUsers(VectorEntity Vec, int VectorUserCount, double VectorArea, List<User> VectorUserList, bool isFixure)
 {
     Vec.ClutterList.ForEach(delegate (ClutterEntity ne) {
         if (ne.Weight != 0)
         {
             VectorUserList.AddRange(this.GenClutterUser(ne, VectorUserCount, VectorArea, Vec, isFixure));
         }
     });
 }
Ejemplo n.º 44
0
 private void AddPointToVectorList(List<GeoXYPoint> nodes)
 {
     nodes.ForEach(delegate (GeoXYPoint Node) {
         VectorEntity item = new VectorEntity(Node.Name) {
             Id = Node.ID,
             Type = VectorType.Point,
             Area = 1.0,
             Flag = Node
         };
         this.m_VectorList.Add(item);
     });
 }
Ejemplo n.º 45
0
 private List<User> GenClutterUser(ClutterEntity ne, int VectorUserCount, double VectorArea, VectorEntity Vec, bool isFixure)
 {
     double clutterUserCount = ((VectorUserCount * ne.Area) * ne.Weight) / VectorArea;
     ne.UserList.Clear();
     List<User> userList = ne.UserList;
     this.m_CurrentClutter = ne;
     this.ProcessService(clutterUserCount, ne.UserList);
     List<int> userIdxs = new List<int>();
     this.GetUserIdxs(userList, userIdxs);
     List<GeoXYPoint> list3 = this.GenUserPoints(Vec, ne.Id, userIdxs, isFixure);
     int count = list3.Count;
     for (int i = 0; i < count; i++)
     {
         userList[i].X = list3[i].X;
         userList[i].Y = list3[i].Y;
     }
     this.SetIndoorUsers(userList, ne.Indoor);
     return userList;
 }
Ejemplo n.º 46
0
 private List<GeoXYPoint> GetClutterUsersOnLine(VectorEntity Vec, short ClutterId, List<int> UserIdxs, int LayerIndex)
 {
     GeoXYLine flag = Vec.Flag as GeoXYLine;
     GeoXYLine geoXYLine = new GeoXYLine();
     geoXYLine.AddPoint(flag.Points.ToArray());
     return this.m_GeoProvider.GetGeoInfo.GetClutterPointDict(geoXYLine, ClutterId, UserIdxs);
 }
Ejemplo n.º 47
0
 private List<GeoXYPoint> GenUserPoints(VectorEntity Vec, short clutterEntityId, List<int> UserIdxs, bool isFixure)
 {
     if (Vec.Type == VectorType.Polygon)
     {
         return this.GetClutterUsersOnPolygon(Vec, clutterEntityId, UserIdxs, isFixure);
     }
     if (Vec.Type == VectorType.Line)
     {
         return this.GetClutterUsersOnLine(Vec, clutterEntityId, UserIdxs, 0);
     }
     return this.GetClutterUsersOnPoint(Vec, clutterEntityId, UserIdxs, 0);
 }
Ejemplo n.º 48
0
 private void setPointToVectorEntity(GeoDataProvider geoDataProvider, VectorEntity vetEntity)
 {
     List<GeoXYPoint> geoNodeList = geoDataProvider.GeoProvider.GeoNodeList;
     foreach (GeoXYPoint point in geoNodeList)
     {
         if (vetEntity.Name == point.Name)
         {
             vetEntity.Flag = point;
             vetEntity.Area = point.Distance(point);
         }
     }
 }
Ejemplo n.º 49
0
 private List<GeoXYPoint> GetClutterUsersOnPoint(VectorEntity Vec, short ClutterId, List<int> UserIdxs, int LayerIndex)
 {
     GeoXYPoint flag = Vec.Flag as GeoXYPoint;
     List<GeoXYPoint> list = new List<GeoXYPoint>();
     int count = UserIdxs.Count;
     for (int i = 0; i < count; i++)
     {
         list.Add(flag);
     }
     return list;
 }
Ejemplo n.º 50
0
 private bool InVectorList(VectorEntity ve)
 {
     foreach (VectorEntity entity in this.m_VectorMap.SelectedVectorList)
     {
         if (entity.Name == ve.Name)
         {
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 51
0
 private List<ClutterEntity> GetClutterList(VectorEntity Vec, bool isFixure)
 {
     if (Vec.Type == VectorType.Polygon)
     {
         return this.GetClutterListOnPolygon(Vec.Flag, isFixure);
     }
     if (Vec.Type == VectorType.Line)
     {
         return this.GetClutterListOnLine(Vec.Flag);
     }
     return this.GetClutterListOnNode(Vec.Flag);
 }
Ejemplo n.º 52
0
 private void GenBlankPolygonUsers(int VectorUserCount, VectorEntity Vec, List<User> VectorUserList)
 {
     double area = Vec.Area;
     GeoPolygonRegion flag = Vec.Flag as GeoPolygonRegion;
     VectorUserList.AddRange(this.GenBlankClutterUser(VectorUserCount, area, flag));
 }
Ejemplo n.º 53
0
 private GeoXYLine GetLineNewName(VectorEntity vetorE, GeoXYLine geoTrafficLine)
 {
     foreach (GeoXYLine line in this.GeoProvider.GeoLineList)
     {
         if (line.ID == geoTrafficLine.ID)
         {
             vetorE.Flag = line;
             geoTrafficLine = line;
         }
     }
     return geoTrafficLine;
 }
Ejemplo n.º 54
0
 private List<GeoXYPoint> GetClutterUsersOnPolygon(VectorEntity Vec, short ClutterId, List<int> UserIdxs, bool isFixure)
 {
     GeoPolygonRegion flag = Vec.Flag as GeoPolygonRegion;
     ITrafficMapModelService service = this.m_ServiceContext.Lookup(typeof(ITrafficMapModelService).FullName) as ITrafficMapModelService;
     return service.PolygonRegionAssist.GetClutterPointDict(flag, ClutterId, UserIdxs, !isFixure);
 }
Ejemplo n.º 55
0
 private List<User> GetBlankVectorUser(VectorEntity Vec, bool isFixure)
 {
     int num2;
     int num = Convert.ToInt32((double) ((Vec.Area * Vec.Density) / ((double) this.m_AreaMap[Vec.Type])));
     if (isFixure)
     {
         num2 = num;
     }
     else
     {
         num2 = Poisson.Poissonize((double) num);
     }
     List<User> vectorUserList = new List<User>();
     this.m_BlankVectorMap[Vec.Type](num2, Vec, vectorUserList);
     return vectorUserList;
 }