public VectorMapPropertiesFrm(TreeNode vetNode, IApplicationContext context) { this.m_HandleMap = new Dictionary<int, ProcessChangedHandle>(); this.m_VectorMap = null; this.m_IsExistsNode = false; this.m_TrafficModelService = null; this.m_RemoveColorPolygon = new List<GeoPolygonRegion>(); this.m_OldVectorMap = null; this.m_BakClutterClassList = null; this.m_BakSelectedVectorList = null; this.m_BakDensity = 0f; this.m_BakUserProfile = null; this.m_BakMobility = null; this.components = null; this.InitParam(context); this.InitializeComponent(); this.m_TrafficNode = vetNode; this.m_VectorMap = new VectorTrafficMap(context); this.CopyDataToVetorMap(vetNode); this.m_IsExistsNode = true; this.SetMapVisibleFlag(vetNode); this.oldName = this.m_VectorMap.Name; }
public void setUserProfileMobilityToVectorpMap(VectorTrafficMap vectorTrafficMap) { ITrafficForMap map = this.m_Context.Lookup(typeof(ITrafficForMap).FullName) as ITrafficForMap; List<UserProfile> useProfileList = map.UseProfileList; List<Mobility> mobilityList = map.MobilityList; foreach (UserProfile profile in useProfileList) { if (profile.Name == vectorTrafficMap.UserProfile.Name) { vectorTrafficMap.UserProfile = profile; } } foreach (Mobility mobility in mobilityList) { if (mobility.Name == vectorTrafficMap.Mobility.Name) { vectorTrafficMap.Mobility = mobility; } } }
private void setGeoPropertyToVectorMap(VectorTrafficMap vectorTrafficMap) { GeoDataProvider geoDataProvider = ServiceHelper.Lookup<IDataProvider>(this.m_Context) as GeoDataProvider; vectorTrafficMap.GeoProvider = geoDataProvider.GeoProvider; foreach (VectorEntity entity in vectorTrafficMap.SelectedVectorList) { if (entity.Type == VectorType.Point) { this.setPointToVectorEntity(geoDataProvider, entity); } else if (entity.Type == VectorType.Line) { this.setGeoLineToVectorEntity(geoDataProvider, entity); } else { this.setPolygonToVectorEntity(geoDataProvider, entity); } } }
private List<GeoPolygonRegion> getPolygonListFromVectorMap(VectorTrafficMap vetorMap) { List<GeoPolygonRegion> list = new List<GeoPolygonRegion>(); foreach (VectorEntity entity in vetorMap.SelectedVectorList) { if (entity.Type == VectorType.Polygon) { list.Add(entity.Flag as GeoPolygonRegion); } } return list; }
private void UpTrafficMapData() { if (!this.m_IsExistsNode) { if (!this.m_TrafficMapAutomation.AddNewVectTrafficMap(this.m_VectorMap)) { MessageBoxUtil.ShowWarning(this.m_TrafficMapService.VectorTrafficMapMgr.ErrorMessage); base.DialogResult = DialogResult.None; } } else { VectorTrafficMap vectorMap = new VectorTrafficMap(this.m_ServiceContext); vectorMap.ClutterClassList.AddRange(this.m_VectorMap.ClutterClassList); vectorMap.Density = this.m_VectorMap.Density; vectorMap.Mobility = this.m_VectorMap.Mobility; vectorMap.SelectedVectorList = new BindingList<VectorEntity>(); foreach (VectorEntity entity in this.m_VectorMap.SelectedVectorList) { vectorMap.SelectedVectorList.Add(entity); } vectorMap.UserProfile = this.m_VectorMap.UserProfile; vectorMap.VectorList = new List<VectorEntity>(); vectorMap.VectorList.AddRange(this.m_VectorMap.VectorList); vectorMap.Name = this.m_VectorMap.Name; vectorMap.IsVisible = this.m_VectorMap.IsVisible; this.m_TrafficMapAutomation.ModifyVectTrafficMap(this.oldName, vectorMap); this.oldName = this.m_VectorMap.Name; } }
private void resetVetorMapProperty(VectorTrafficMap vetTrafficMap) { vetTrafficMap.Mobility = this.m_MobilityDic[vetTrafficMap.Mobility.Name]; vetTrafficMap.UserProfile = this.m_UserProfileDic[vetTrafficMap.UserProfile.Name]; foreach (VectorEntity entity in vetTrafficMap.SelectedVectorList) { float density = entity.Density; VectorEntity entity2 = this.getGeoObject(entity.Name); entity.Area = entity2.Area; entity.Flag = entity2.Flag; entity.Id = entity2.Id; entity.Density = density; } }
public VectorMapPropertiesFrm(IApplicationContext context, TrafficMapView inTrafficMapView, List<NetWorkType> netTypeList) { this.m_HandleMap = new Dictionary<int, ProcessChangedHandle>(); this.m_VectorMap = null; this.m_IsExistsNode = false; this.m_TrafficModelService = null; this.m_RemoveColorPolygon = new List<GeoPolygonRegion>(); this.m_OldVectorMap = null; this.m_BakClutterClassList = null; this.m_BakSelectedVectorList = null; this.m_BakDensity = 0f; this.m_BakUserProfile = null; this.m_BakMobility = null; this.components = null; this.InitParam(context); this.InitializeComponent(); this.m_TrafficMapView = inTrafficMapView; this.m_netTypeList = netTypeList; this.m_VectorMap = new VectorTrafficMap(context); this.oldName = this.m_VectorMap.Name; }
private void CopyDataToVetorMap(TreeNode vetNode) { this.m_OldVectorMap = this.m_TrafficMapService.VectorTrafficMapMgr.GetVectorTrafficMap(vetNode.Text); this.m_VectorMap.ClutterClassList.AddRange(this.m_OldVectorMap.ClutterClassList); this.m_VectorMap.Density = this.m_OldVectorMap.Density; this.m_VectorMap.IsVisible = this.m_OldVectorMap.IsVisible; this.m_VectorMap.Mobility = this.m_OldVectorMap.Mobility; this.m_VectorMap.Name = this.m_OldVectorMap.Name; this.m_VectorMap.NearDensity = this.m_OldVectorMap.NearDensity; this.m_VectorMap.UserProfile = this.m_OldVectorMap.UserProfile; this.m_VectorMap.GeoProvider = this.m_OldVectorMap.GeoProvider; this.m_VectorMap.VectorList = new List<VectorEntity>(); this.m_VectorMap.VectorList.AddRange(this.m_OldVectorMap.VectorList); foreach (VectorEntity entity in this.m_OldVectorMap.SelectedVectorList) { this.m_VectorMap.SelectedVectorList.Add(entity); } }
private void UpdateSavedToProject() { foreach (KeyValuePair<int, Dictionary<int, ITrafficMap>> pair in this.m_TrafficMapSerializedData.TrafficMapDic) { foreach (KeyValuePair<int, ITrafficMap> pair2 in pair.Value) { if (pair2.Key == 0) { this.trafficMapImp.AddEnvTrafficMap(pair2.Value); } else if (pair2.Key == 1) { VectorTrafficMap vectorMap = pair2.Value as VectorTrafficMap; VectorTrafficMap map2 = new VectorTrafficMap(this.m_ServiceContext) { Name = vectorMap.Name, Mobility = vectorMap.Mobility, UserProfile = vectorMap.UserProfile }; this.trafficMapImp.AddNewVectTrafficMap(map2); this.trafficMapImp.ModifyVectTrafficMap(map2.Name, vectorMap); } else { this.trafficMapImp.AddCellTrafficMap(pair2.Value); } } } }