public TSIWindow() { InitializeComponent(); _selectedSLsDict = new Dictionary<string, IEnumerable<DGObject>>(); _selectedTunnelsDict = new Dictionary<string, IEnumerable<DGObject>>(); _slsGrade = new Dictionary<int, int>(); _slsGraphics = new Dictionary<int, IGraphicCollection>(); _mainFrame = Globals.mainframe; _prj = Globals.project; _structureDomain = _prj.getDomain(DomainType.Structure); _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List<string>(); foreach (DGObjects objs in _allSLs) _slLayerIDs.Add(objs.definition.GISLayerName); _allTunnels = _structureDomain.getObjects("Tunnel"); _tunnelLayerIDs = new List<string>(); foreach (DGObjects objs in _allTunnels) _tunnelLayerIDs.Add(objs.definition.GISLayerName); Loaded += TSIWindow_Loaded; Unloaded += TSIWindow_Unloaded; }
public static Domain GetAnalysisDomain() { Project prj = Globals.project; if (prj.domains.ContainsKey("Analysis")) return prj.domains["Analysis"]; else { Domain analysisDomain = new Domain("Analysis", DomainType.Unknown); analysisDomain.parent = prj; return analysisDomain; } }
public static HashSet<IGraphicsLayer> GetAllLayerID(IView view, Domain domain, string typeName) { HashSet<IGraphicsLayer> graphicLayers = new HashSet<IGraphicsLayer>(); DGObjectsCollection dgObjColl = domain.getObjects(typeName); List<DGObject> objList = dgObjColl.merge(); foreach (DGObject obj in objList) { string layerID = obj.parent.definition.GISLayerName; IGraphicsLayer gLayer = HelperFunction.GetLayer(view, layerID); graphicLayers.Add(gLayer); } return graphicLayers; }
// Summary: // Resume the relationship betwwen MonGroup and MonPoint. void resumeGroup2PointRelationship(MonGroup group, Domain domainMon) { if (group.monPntNames == null) return; foreach (string monPntName in group.monPntNames) { MonPoint monPnt = findMonPoint(monPntName, domainMon); if (monPnt == null) continue; group.monPntDict[monPnt.name] = monPnt; } }
// Summary: // Load a Domain from XML element public static Domain loadDefinition(XElement root) { string name = root.Attribute("Name").Value; string type = root.Attribute("Type").Value; DomainType domainType = (DomainType)Enum.Parse(typeof(DomainType), type); Domain domain = new Domain(name, domainType); // Load tree definition // XElement treeDefNode = root.Element("TreeDefinition"); if (treeDefNode != null) { // only first node is loaded, other nodes are ignored. IEnumerable<XElement> nodes = treeDefNode.Elements(); if (nodes.Count() > 0) { XElement node = nodes.First(); domain.root = Tree.Element2Tree(node); } } // Load DGObjects definition // XElement objsDefNode = root.Element("ObjsDefinition"); if (objsDefNode != null) { IEnumerable<XElement> nodes = objsDefNode.Elements(); foreach (XElement node in nodes) { DGObjectsDefinition def = DGObjectsDefinition.LoadDefinition(node); domain.objsDefinitions.Add(def.Name, def); } } return domain; }
public DrawTunnelsWindow() { InitializeComponent(); //Initialize ISimpleLineSymbol linesymbol = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Red, Core.Graphics.SimpleLineStyle.Solid, 1.0); _symbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.Blue, SimpleFillStyle.Solid, linesymbol); _tunnelsGraphics = new Dictionary<int, IGraphicCollection>(); _selectedTunnelsDict = new Dictionary<string, IEnumerable<DGObject>>(); _lpResults = new List<DGObject>(); _settings = new DrawTunnelsSettings(); SettingsHolder.DataContext = _settings; Loaded += DrawTunnelsWindow_Loaded; Unloaded += DrawTunnelsWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _allTunnels = _structureDomain.getObjects("Tunnel"); _tunnelLayerIDs = new HashSet<string>(); foreach (DGObjects objs in _allTunnels) _tunnelLayerIDs.Add(objs.definition.GISLayerName); _allAxes = _structureDomain.getObjects("TunnelAxis"); if (_allAxes == null) { _initFailed = true; return; } }
Domain _structureDomain; // the structure domain of the project #endregion Fields #region Constructors public TunnelCSLoadWindow() { InitializeComponent(); ISimpleLineSymbol outline = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Black, Core.Graphics.SimpleLineStyle.Solid, 1.0); _fillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.Cyan, SimpleFillStyle.Solid, outline); _lineSymbol = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Blue, Core.Graphics.SimpleLineStyle.Solid, 1.0); _arrowFillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.Blue, SimpleFillStyle.Solid, outline); _IniStress = new SoilInitalStress(); _slsGraphics = new Dictionary<string, IGraphicCollection>(); Loaded += TunnelCSLoadWindow_Loaded; Unloaded += TunnelCSLoadWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _geologyDomain = _prj.getDomain(DomainType.Geology); if (_geologyDomain == null) { _initFailed = true; return; } _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List<string>(); foreach (DGObjects objs in _allSLs) _slLayerIDs.Add(objs.definition.GISLayerName); }
List<string> _tunnelLayerIDs; // tunnel layer IDs #endregion Fields #region Constructors public SimpleProfileAnalysisWindow() { InitializeComponent(); _settings = new GeoProjSettings(); SettingsHolder.DataContext = _settings; Loaded += SimpleProfileAnalysisWindow_Loaded; Unloaded += SimpleProfileAnalysisWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _geologyDomain = _prj.getDomain(DomainType.Geology); _structureDomain = _prj.getDomain(DomainType.Structure); if (_geologyDomain == null || _structureDomain == null) { _initFailed = true; return; } // set the input view _inputView = _mainFrame.activeView; if (_inputView == null || _inputView.eMap.MapType != EngineeringMapType.FootPrintMap) _inputView = _mainFrame.views.FirstOrDefault( x => x.eMap.MapType == EngineeringMapType.FootPrintMap); if (_inputView == null) { _initFailed = true; return; } InputViewTB.DataContext = _inputView; _allBhs = _geologyDomain.getObjects("Borehole"); _allSts = _geologyDomain.getObjects("Stratum"); _bhLayerIDs = new List<string>(); foreach (DGObjects objs in _allBhs) _bhLayerIDs.Add(objs.definition.GISLayerName); _allTunnels = _structureDomain.getObjects("Tunnel"); _tunnelLayerIDs = new List<string>(); foreach (DGObjects objs in _allTunnels) _tunnelLayerIDs.Add(objs.definition.GISLayerName); // add borehole layer as selectable layer _inputView.removeSelectableLayer("_ALL"); _inputView.addSeletableLayer("0"); // "0" is the drawing layer ID foreach (string layerID in _bhLayerIDs) _inputView.addSeletableLayer(layerID); foreach (string layerID in _tunnelLayerIDs) _inputView.addSeletableLayer(layerID); // add a listener to object selection changed event _inputView.objSelectionChangedTrigger += _inputView_objSelectionChangedListener; // add a listener to drawing graphics changed event _inputView.drawingGraphicsChangedTrigger += _inputView_drawingGraphicsChangedListener; }
public DrawSLWindow() { InitializeComponent(); //Initialize ISimpleLineSymbol linesymbol = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Black, Core.Graphics.SimpleLineStyle.Solid, 1.0); _fillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Color.FromArgb(150, 0, 0, 255), SimpleFillStyle.Solid, linesymbol); _whiteFillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Color.FromArgb(150, 255, 255, 255), SimpleFillStyle.Solid, linesymbol); _selectedSLsDict = new Dictionary<string, IEnumerable<DGObject>>(); _slsGraphics = new Dictionary<int, IGraphicCollection>(); _lsGraphics = new Dictionary<string, LSGraphics>(); _csGraphics = new Dictionary<string, CSGraphics>(); Loaded += DrawSLWindow_Loaded; Unloaded += DrawSLWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List<string>(); foreach (DGObjects objs in _allSLs) _slLayerIDs.Add(objs.definition.GISLayerName); }
public LoadStructureModelWindow() { InitializeComponent(); ISimpleLineSymbol outline = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Black, Core.Graphics.SimpleLineStyle.Solid, 1.0); _whitefillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.White, SimpleFillStyle.Solid, outline); _lineSymbol = Runtime.graphicEngine.newSimpleLineSymbol( Color.FromArgb(255, 0, 0, 0), Core.Graphics.SimpleLineStyle.Solid, 1.0); _arrowFillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.Blue, SimpleFillStyle.Solid, outline); SLMomentGraphics = new Dictionary<int, IGraphicCollection>(); SLAxialGraphics = new Dictionary<int, IGraphicCollection>(); SLShearGraphics = new Dictionary<int, IGraphicCollection>(); SLDisplacementGraphics = new Dictionary<int, IGraphicCollection>(); _loadStructure = new LoadStructure(); Loaded += LoadStructureModelWindow_Loaded; Unloaded += LoadStructureModelWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _geologyDomain = _prj.getDomain(DomainType.Geology); if (_geologyDomain == null) { _initFailed = true; return; } _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List<string>(); foreach (DGObjects objs in _allSLs) _slLayerIDs.Add(objs.definition.GISLayerName); _ansysPath = Runtime.rootPath + "//Conf//ansysPath.xml"; }
// Summary: // Find MonPoint by the given name. MonPoint findMonPoint(string monPntName, Domain domainMon) { foreach (DGObjects objs in domainMon.objsContainer.Values) { if (objs.definition.Type == "MonPoint") { if (objs.containsKey(monPntName)) return objs[monPntName] as MonPoint; } } return null; }
HashSet<string> _tunnelLayerIDs; // tunnel layer IDs #endregion Fields #region Constructors public TunnelDepthAnalysisWindow() { InitializeComponent(); //Initialize _linesymbol = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Blue, Core.Graphics.SimpleLineStyle.Solid, 1.0); _selectedTunnelsDict = new Dictionary<string, IEnumerable<DGObject>>(); _depthGraphics = new Dictionary<int, IGraphicCollection>(); Loaded += TunnelDepthAnalysisWindow_Loaded; Unloaded += TunnelDepthAnalysisWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _allTunnels = _structureDomain.getObjects("Tunnel"); _tunnelLayerIDs = new HashSet<string>(); foreach (DGObjects objs in _allTunnels) _tunnelLayerIDs.Add(objs.definition.GISLayerName); }
// Summary: // Load project defintion from a XML file // public bool loadDefinition(string file) { string filePath = Runtime.dataPath + "\\" + file.Substring(0, file.Length - 4) + "\\" + file; if (File.Exists(filePath) == false) { ErrorReport.Report("Error: defintion file doesn't exist: " + filePath); return(false); } StreamReader reader = new StreamReader(filePath); // Load root element from xml XElement root = XElement.Load(reader); if (root.Name != "Project") { ErrorReport.Report("Error: defintion file root must be <Project>."); return(false); } // Load project definition projDef = ProjectDefinition.Load(root); if (projDef == null) { return(false); } // get rid of ".xml", and use as default local file path string shortName = file.Substring(0, file.Length - 4); if (projDef.LocalFilePath == null) { Runtime.projPath = Runtime.dataPath + "\\" + shortName; projDef.LocalFilePath = Runtime.projPath; } else { Runtime.projPath = projDef.LocalFilePath; } if (projDef.LocalTilePath == null) { projDef.LocalTilePath = Runtime.tilePath; } if (projDef.DatabaseName1 == null) { projDef.DatabaseName1 = shortName; } else { projDef.DatabaseName1 = IsMdb(projDef.DatabaseName1) ? Runtime.projPath + "\\" + projDef.DatabaseName1 : projDef.DatabaseName1; } if (projDef.DatabaseName2 != null) { projDef.DatabaseName2 = IsMdb(projDef.DatabaseName2) ? Runtime.projPath + "\\" + projDef.DatabaseName2 : projDef.DatabaseName2; } if (projDef.DatabaseName3 != null) { projDef.DatabaseName3 = IsMdb(projDef.DatabaseName3) ? Runtime.projPath + "\\" + projDef.DatabaseName3 : projDef.DatabaseName3; } // set dataservice path Globals.iS3Service.DataService.initializeDataService(projDef.DatabaseName1); // Load domain definition IEnumerable <XElement> nodes = root.Elements("Domain"); foreach (XElement node in nodes) { Domain domain = Domain.loadDefinition(node); if (domain == null) { continue; } domain.parent = this; _domains.Add(domain.name, domain); } return(true); }