Beispiel #1
0
        //public void NotifyShowFinish()
        //{

        //    ShowFinished?.Invoke();
        //}

        //private void TimerFly_Tick(object sender, EventArgs e)
        //{
        //    timerFly.Stop();
        //    NotifyShowFinish();
        //}
        private void initTEContactLine()
        {
            string             contactGID = "";
            ITerrainPolyline66 polyline;

            if (string.IsNullOrEmpty(contactGID))
            {
                contactGID = sgworld.ProjectTree.CreateGroup("ContactLine");
            }
            else
            {
                sgworld.ProjectTree.DeleteItem(contactGID);
                contactGID = sgworld.ProjectTree.CreateGroup("ContactLine");
            }

            foreach (CRailwayProject p in mSceneData.mTotalProjectList)
            {
                if (p.mAvgProgress < 0.01 || p is CContBeam)
                {
                    continue;
                }

                //count = proj.getSubLine(out cVerticesArray);
                int      count;
                double[] xx, yy, zz, xx2, yy2, zz2;
                double[] cVerticesArray = null;
                p.mPath.getContactLine(out xx, out yy, out zz, out xx2, out yy2, out zz2);
                if (xx == null || xx.Length < 2)
                {
                    continue;
                }
                count          = xx.Length;
                cVerticesArray = CTEObject.getVerArray(xx, yy, zz, 5.6);
                polyline       = sgworld.Creator.CreatePolylineFromArray(cVerticesArray, sgworld.Creator.CreateColor(0, 0, 0, 255),
                                                                         AltitudeTypeCode.ATC_TERRAIN_ABSOLUTE, contactGID, p.ProjectName + 1);
                polyline.Spline = true;
                polyline.Visibility.MaxVisibilityDistance = 10000;
                polyline.Visibility.MinVisibilityDistance = 10;
                polyline.LineStyle.Width = -2;
                cVerticesArray           = CTEObject.getVerArray(xx, yy, zz, 6.6);
                polyline = sgworld.Creator.CreatePolylineFromArray(cVerticesArray, sgworld.Creator.CreateColor(0, 0, 0, 255),
                                                                   AltitudeTypeCode.ATC_TERRAIN_ABSOLUTE, contactGID, p.ProjectName + 2);
                if (xx2 == null || xx2.Length < 2)
                {
                    continue;
                }
                count          = xx2.Length;
                cVerticesArray = CTEObject.getVerArray(xx2, yy2, zz2, 5.6);
                polyline       = sgworld.Creator.CreatePolylineFromArray(cVerticesArray, sgworld.Creator.CreateColor(0, 0, 0, 255),
                                                                         AltitudeTypeCode.ATC_TERRAIN_ABSOLUTE, contactGID, p.ProjectName + 3);
                polyline.Spline = true;
                polyline.Visibility.MaxVisibilityDistance = 10000;
                polyline.Visibility.MinVisibilityDistance = 10;
                polyline.LineStyle.Width = -2;
                cVerticesArray           = CTEObject.getVerArray(xx2, yy2, zz2, 6.6);
                polyline = sgworld.Creator.CreatePolylineFromArray(cVerticesArray, sgworld.Creator.CreateColor(0, 0, 0, 255),
                                                                   AltitudeTypeCode.ATC_TERRAIN_ABSOLUTE, contactGID, p.ProjectName + 4);
            }
            Console.WriteLine(sgworld.ProjectTree.SaveAsKml("TELine", contactGID));
        }
Beispiel #2
0
        public CTEObject showTEObject(CHotSpot hs1, CHotSpot hs2, bool isStopping = false)
        {
            CTEObject obj = null;

            switch (hs1.ObjectType)
            {
            case "Project":
                CRailwayProject rp = (CRailwayProject)(hs1.ObjectRef);

                //string s = "当前位置: " + rp.ToString() + "\t\t";

                //labelRoll2.Text = s;
                //labelRoll2.Refresh();

                obj = showTEProject(rp, isStopping);


                break;

            case "Firm":
                CRailwayFirm rf = (CRailwayFirm)(hs1.ObjectRef);
                obj = showTEFirms(rf, isStopping);
                break;

            case "Cons":
                ConsLocation cl = (ConsLocation)(hs1.ObjectRef);
                obj = showTECons(cl, isStopping);
                break;
            }
            return(obj);
        }
Beispiel #3
0
        private void interruptViewTEObject()
        {
            if (!readyForNext)
            {
                //if (mNavIndex + 1 < mNavigationList.Count)
                //{
                mTeObject = mTEScene.showTEObject(mNavigationList[mNavIndex], mNavigationList[mNavNextIndex], true);
                //}
                //else
                //{
                //    mTeObject = mTEScene.showTEObject(mNavigationList[navIndex], mNavigationList[0], true);
                //}
                if (mTeObject != null)
                {
                    if (mTeObject.mPresentation != null)
                    {
#if DEBUG
                        ModelInfo.Helper.LogHelper.WriteLog("stop to view " + mNavIndex);
#endif
                        if (mTeObject.mPresentation.PresentationStatus != PresentationStatus.PS_NOTPLAYING)
                        {
                            mTeObject.mPresentation.Stop();
                        }
                    }
                }
            }
        }
Beispiel #4
0
        private void viewTEObject()
        {
            //if (navIndex + 1 < mNavigationList.Count)
            //{
            mTeObject = mTEScene.showTEObject(mNavigationList[mNavIndex], mNavigationList[mNavNextIndex]);
            //}
            //else
            //{
            //    mTeObject = mTEScene.showTEObject(mNavigationList[navIndex], mNavigationList[0]);
            //}

            if (mTeObject == null)
            {
#if DEBUG
                ModelInfo.Helper.LogHelper.WriteLog("NO Navigation Object" + mNavIndex);
#endif
                return;
            }

            if (mTeObject.mPresentation != null)
            {
#if DEBUG
                Console.WriteLine("begin to view " + mNavIndex);
#endif
                updatePresentationSpeed(mTeObject.mPresentation);
                mTeObject.mPresentation.Play(0);
                return;
            }

            if (mTeObject.labelSign != null)
            {
                ActionCode ac; // = ActionCode.AC_CIRCLEPATTERN;
                Random     ran     = new Random();
                int        tmpcode = ran.Next(1, 4);

                switch (tmpcode)
                {
                case 1:
                    ac = ActionCode.AC_CIRCLEPATTERN;     //ActionCode.AC_FOLLOWBEHIND;
                    break;

                case 2:
                    ac = ActionCode.AC_ARCPATTERN;
                    break;

                case 3:
                    ac = ActionCode.AC_OVALPATTERN;
                    break;

                case 4:
                    ac = ActionCode.AC_LINEPATTERN;
                    break;

                default:
                    ac = ActionCode.AC_CIRCLEPATTERN;     //ActionCode.AC_FOLLOWBEHIND;
                    break;
                }
                sgworld.Navigate.FlyTo(mTeObject.labelSign, ac);
            }
            int timeInterval = (int)(Math.Pow((6 - CGisDataSettings.AppSpeed), 2) / 9 * 10000);
#if DEBUG
            timeInterval = 5000;
#endif
            timerWaitingForNext.Interval = timeInterval;
            timerWaitingForNext.Start();
        }