示例#1
0
        public CTECons(ConsLocation cl, CRailwayScene s, CTEScene ss)
            : base(s, ss)
        {
            sgworld = new SGWorld66();
            consLoc = cl;
            IPosition66 p = sgworld.Creator.CreatePosition(cl.Longitude, cl.Latitude, 30, AltitudeTypeCode.ATC_TERRAIN_RELATIVE,
                                                           0, -90.0, 0, 0);

            circlePeople = sgworld.Creator.CreateCircle(p, cl.Number * 2 + 200, 0xFF0000FF, 0x00FF00FF, mGroupIDDynamic, cl.ProjName + cl.Number);
            //  circle.de
            circlePeople.LineStyle.Width = -3.0;
            circlePeople.Visibility.MinVisibilityDistance = 2000;
            //circle.SetParam

            labelSign = sgworld.Creator.CreateLabel(p, cl.Number + "", CGisDataSettings.gDataPath + @"Common\Textures\working.gif", CRWTEStandard.mLabelStyleL2, mGroupIDDynamic, "Con|" + cl.ProjName);
            //labelSign.Message.MessageID = sgworld.Creator.CreateMessage(MsgTargetPosition.MTP_POPUP, cl.ToString(), MsgType.TYPE_TEXT, true).ID;
        }
示例#2
0
        /// <summary>
        /// 创建圆
        /// </summary>
        private void CreateCircle()
        {
            string      msg                   = string.Empty;
            IPosition66 cPos                  = null;
            IColor66    cFillColor            = null;
            ITerrainRegularPolygon66 cCircle  = null;
            ITerraExplorerMessage66  cMessage = null;

            try
            {
                cPos = CreatePosition();

                uint   nLineColor    = 0xFFFF0000;
                double dCircleRadius = 200;

                cCircle = this.sgWorld.Creator.CreateCircle(cPos, dCircleRadius, nLineColor, cFillColor, string.Empty, "Circle");

                double dNewCircleRadius     = 300;
                double dCurrentCircleRadius = cCircle.Radius;
                cCircle.Radius = dNewCircleRadius;
                uint   nRGB_Red   = 0xFF0000;
                double dAlpha     = 0.2;
                var    cFillStyle = cCircle.FillStyle;
                cFillStyle.Color.FromRGBColor(nRGB_Red);
                cFillStyle.Color.SetAlpha(dAlpha);

                MsgTargetPosition eMsgTarget = MsgTargetPosition.MTP_POPUP;
                string            tMessage   = "Hello Circle";
                MsgType           eMsgType   = MsgType.TYPE_TEXT;
                bool bIsBringToFront         = true;

                cMessage = this.sgWorld.Creator.CreateMessage(eMsgTarget, tMessage, eMsgType, bIsBringToFront);
                cCircle.Message.MessageID = cMessage.ID;

                var cFlyToPos = cPos.Copy();
                cFlyToPos.Pitch = -89.0;
                this.sgWorld.Navigate.FlyTo(cFlyToPos, ActionCode.AC_FLYTO);
            }
            catch (Exception ex)
            {
                msg = String.Format("CreateCircleButton_Click Exception: {0}", ex.Message);
                MessageBox.Show(msg);
            }
        }
示例#3
0
        public CTEFirm(CRailwayFirm f, CRailwayScene s, CTEScene ss)
            : base(s, ss)
        {
            firm    = f;
            sgworld = new SGWorld66();
            if (!string.IsNullOrEmpty(firm.mPresentation))
            {
                var id = sgworld.ProjectTree.FindItem("\\Presentation\\" + firm.mPresentation);
                mPresentation = (IPresentation66)(sgworld.ProjectTree.GetObject(id));

                //if (CGisDataSettings.AppSpeed <= 2)
                //    mPresentation.PlaySpeedFactor = PresentationPlaySpeed.PPS_VERYSLOW;
                //else if (CGisDataSettings.AppSpeed < 5)
                //    mPresentation.PlaySpeedFactor = PresentationPlaySpeed.PPS_SLOW;
                //else if (CGisDataSettings.AppSpeed < 7)
                //    mPresentation.PlaySpeedFactor = PresentationPlaySpeed.PPS_NORMAL;
                //else if (CGisDataSettings.AppSpeed < 9)
                //    mPresentation.PlaySpeedFactor = PresentationPlaySpeed.PPS_FAST;
                //else
                //    mPresentation.PlaySpeedFactor = PresentationPlaySpeed.PPS_VERYFAST;
            }

            ILabelStyle66 cLabelStyle;
            IPosition66   cp = sgworld.Creator.CreatePosition(f.CenterLongitude, f.CenterLatitude, 0, AltitudeTypeCode.ATC_TERRAIN_RELATIVE);

            circlePeople = sgworld.Creator.CreateCircle(cp, f.NumStaff * 2 + 200, 0xFFFFFFFF, 0x00FF00FF, mGroupIDStatic, f.FirmName + " " + f.NumStaff);
            circlePeople.LineStyle.Width = -3.0;
            circlePeople.Visibility.MinVisibilityDistance = 5000;

            if (f.FirmType.Equals("制梁场") || f.FirmType.Equals("项目部") || f.FirmType.Equals("监理单位"))
            {
                cLabelStyle = CRWTEStandard.mLabelStyleL2;
            }
            else
            {
                cLabelStyle = CRWTEStandard.mLabelStyleL1;
            }
            labelSign = sgworld.Creator.CreateLabel(cp, f.FirmName, CGisDataSettings.gDataPath + @"Common\地标图片\" + f.mLabelImage, cLabelStyle, mGroupIDStatic, "Fir|" + f.FirmName);
            labelSign.Message.MessageID = sgworld.Creator.CreateMessage(MsgTargetPosition.MTP_POPUP, f.ToString(), MsgType.TYPE_TEXT, true).ID;
        }
示例#4
0
        public override void TECreate()
        {
            SGWorld66 sgworld = new SGWorld66();

            if (string.IsNullOrEmpty(mGroupIDStatic))
            {
                mGroupIDStatic = sgworld.ProjectTree.CreateGroup("Firms");
            }
            ITerrainLabel66 iLabel;
            ILabelStyle66   cLabelStyle;

            //ILabelStyle66 cLabelStyle = sgworld.Creator.CreateLabelStyle(SGLabelStyle.LS_STREET);
            //ILabelStyle66 cLabelStyle = sgworld.Creator.CreateLabelStyle(SGLabelStyle.LS_STATE);

            //{
            //   //uint nBGRValue = 0xff0000;                              // Blue
            //   //double dAlpha = 0.5;                                    // 50% opacity
            //   //var cBackgroundColor = cLabelStyle.BackgroundColor;     // Get label style background color
            //   //cBackgroundColor.FromBGRColor(nBGRValue);               // Set background to blue
            //   //cBackgroundColor.SetAlpha(dAlpha);                      // Set transparency to 50%
            //   //cLabelStyle.BackgroundColor = cBackgroundColor;         // Set label style background color
            //    cLabelStyle.FontName = "Arial";                         // Set font name to Arial
            //    cLabelStyle.Italic = true;                              // Set label style font to italic
            //    cLabelStyle.Scale = 200;                                // Set label style scale
            //    cLabelStyle.TextOnImage = false;
            //    cLabelStyle.TextColor = sgworld.Creator.CreateColor(0, 255, 255, 255);
            //    //cLabelStyle.SmallestVisibleSize = 7;
            //}


            foreach (CRailwayFirm rw in mSceneData.mFirmList)
            {
                IPosition66 cp = sgworld.Creator.CreatePosition(rw.CenterLongitude, rw.CenterLatitude, 10, AltitudeTypeCode.ATC_TERRAIN_RELATIVE);
                ITerrainRegularPolygon66 circle = sgworld.Creator.CreateCircle(cp, rw.NumStaff * 2 + 200, 0xFFFFFFFF, 0x00FF00FF, mGroupIDStatic, rw.FirmName + " " + rw.NumStaff);
                circle.LineStyle.Width = -5.0;

                if (rw.FirmType.Equals("制梁场") || rw.FirmType.Equals("项目部") || rw.FirmType.Equals("监理单位"))
                {
                    cLabelStyle = mTEStandard.mLabelStyleL2;
                }
                else
                {
                    cLabelStyle = mTEStandard.mLabelStyleL1;
                }
                iLabel = sgworld.Creator.CreateLabel(cp, rw.FirmName, CGisDataSettings.gDataPath + @"Common\地标图片\" + rw.mLabelImage, cLabelStyle, mGroupIDStatic, rw.FirmName);
                iLabel.Message.MessageID = sgworld.Creator.CreateMessage(MsgTargetPosition.MTP_POPUP, rw.ToString(), MsgType.TYPE_TEXT, true).ID;
            }
            //
            // F. Add Message to created circle
            //
            //{
            //    ITerraExplorerMessage66 cMessage = null;
            //    // F1. Set message input parameters
            //    MsgTargetPosition eMsgTarget = MsgTargetPosition.MTP_POPUP;
            //    string tMessage = "Hello Circle";
            //    MsgType eMsgType = MsgType.TYPE_TEXT;
            //    bool bIsBringToFront = true;

            //    // F2. Create message and add to circle
            //    cMessage = sgworld.Creator.CreateMessage(eMsgTarget, tMessage, eMsgType, bIsBringToFront);
            //    //iLabel.Message.MessageID = cMessage.ID;
            //}
            //foreach (CRailwayStaff rs in mSceneData.mStaffList)
            //{
            //    IPosition66 cp = sgworld.Creator.CreatePosition(rs.longitude, rs.latitude, 10, AltitudeTypeCode.ATC_TERRAIN_RELATIVE);
            //    ITerrainRegularPolygon66 circle = sgworld.Creator.CreateCircle(cp, rs.numStaff * 2 + 200, 0xFFFF00FF, 0x00FF00FF, branch, rs.shorName + " " + rs.numStaff);
            //    circle.LineStyle.Width = -5.0;
            //    //circle.Tooltip = rs.shorName + " " + rs.numStaff;

            //}
        }
示例#5
0
        /// <summary>
        /// TODO 丁一明,显示聚类结果
        /// </summary>
        /// <param name="groupID"></param>
        public override void TECreate()
        {
            /* string[] usrName;
             * string[] projName;
             * string[] consDate;
             * double[] x;
             * double[] y;
             *
             * var sgworld = new SGWorld66();
             * var branch = sgworld.ProjectTree.FindItem(groupID);
             *
             * int num;
             * num = CConsLog.findLast365Cons(out usrName, out projName, out consDate, out x, out y);
             * for (int i = 0; i < num; i++)
             * {
             *   Console.WriteLine("{0} #\t: User {1}\t Project {2}\t  x {3}\t y  {4}\t  Date {5}", i, usrName[i], projName[i], x[i], y[i], consDate[i]);
             * }*/

            ///dym
            var sgworld = new SGWorld66();

            if (string.IsNullOrEmpty(mGroupIDDynamic))
            {
                mGroupIDDynamic = sgworld.ProjectTree.CreateGroup("Cons");
            }
            //var branch = sgworld.ProjectTree.FindItem(groupID);


            List <ConsLocation> ls;

            //ls = CConsLog.clusterConsByProj();
            ls = CConsLog.clusterConsFromWebByProj(mTEScene.fromDate.ToString("u"), mTEScene.toDate.ToString("u"));

            //int maxParticles = 100;
            //string imageName = "";
            //int rate = 2;
            //int shape = 0;

            //var branch = sgworld.ProjectTree.FindItem("Dying");
            //ITerrainEffect66 gParticleLabel = (ITerrainEffect66)sgworld.ProjectTree.GetObject(branch);
            //var xml = gParticleLabel.EffectXML;
            //Console.WriteLine(xml);

            //var particleText = "$$PARTICLE$$UserDefine: \r\n <?xml version='1.0' encoding='UTF-8'?> \r\n <Particle ID='Custom'>";
            //particleText += "<ParticleEmitter ID='Disc' NumParticles='130' Texture='d:\\Campfire.png'>\r\n";
            //particleText += "<Emitter Rate='13' Shape='Disc' SpeedShape='Disc' Scale='50,50,50' Speed='1,1,1' />\r\n";
            //particleText += "<Cycle Value='1' /><Sort Value='1' /><Rotation Speed='1' Time='2' Initial='0' />\r\n";
            //particleText += "<Render Value='Billboard' /><Gravity Value='0, 1, 0' /><Force Value='0' OverrideRotation='0' />\r\n";
            //particleText += "<Position Value='0, 0, 0' /><Life Value='3.06' /><Speed Value='1.41' />\r\n";
            //particleText += "<Color Value='0,0,255,255' /><Size Value='24,24' /><Drag Value='1' />\r\n";
            //particleText += "<Blend Type='' /><Fade FadeIn='0.47' FadeOut='0.65' MaxFade='0.28' /></ParticleEmitter>\r\n";
            //particleText += "</Particle>";

            //IPosition66 tp = sgworld.Creator.CreatePosition(118.086466892066, 36.9038495888797, 3, AltitudeTypeCode.ATC_TERRAIN_RELATIVE,
            //      0, -90.0, 0, 0);
            //ITerrainRegularPolygon66 tcircle = sgworld.Creator.CreateCircle(tp, 200, 0xFF0000FF, 0x00FF00FF, branch, "测试点");
            //tcircle.LineStyle.Width = -5.0;

            foreach (ConsLocation cl in ls)
            {
                IPosition66 p = sgworld.Creator.CreatePosition(cl.Longitude, cl.Latitude, 30, AltitudeTypeCode.ATC_TERRAIN_RELATIVE,
                                                               0, -90.0, 0, 0);
                ITerrainRegularPolygon66 circle = sgworld.Creator.CreateCircle(p, cl.number * 2 + 200, 0xFF0000FF, 0x00FF00FF, mGroupIDDynamic, cl.ProjName + cl.number);
                //  circle.de
                circle.LineStyle.Width = -5.0;
                circle.Visibility.MinVisibilityDistance = 100000;
                //circle.SetParam

                ITerrainLabel66 iLabel = sgworld.Creator.CreateLabel(p, cl.number + "", CGisDataSettings.gDataPath + @"Common\地标图片\worker.png", mTEStandard.mLabelStyleL2, mGroupIDDynamic, cl.ProjName);
                iLabel.Message.MessageID = sgworld.Creator.CreateMessage(MsgTargetPosition.MTP_POPUP, cl.ToString(), MsgType.TYPE_TEXT, true).ID;
                //    circle.Message.MessageID = sgworld.Creator.CreateMessage(MsgTargetPosition.MTP_POPUP, cl.ToString(), MsgType.TYPE_TEXT, true).ID;


                //particleText += "<ParticleEmitter ID='ring' NumParticles='" + maxParticles + "' Texture='" + imageName + "'>" + "\r\n" +
                //  "<Emitter Rate='" + rate + "' Shape='" + shape + "' SpeedShape='" + speedShape + "' Scale='" + scaleX + "," + scaleY + "," + scaleZ + "' Speed='" + speedX + "," + speedY + "," + speedZ + "' />" + "\r\n" + // shape:(Cone, Sphere, ShellCone, ShellSphere, Ring, Disc, Cube), scale:the size of the shape in meters,  speed:(X,Alt,Z) disform the shape like it is in radius=1.
                //  "<Cycle Value='1' />" + "\r\n" + // 0=one time , 1=loop
                //  "<Sort Value='1' />" + "\r\n" +
                //  rotationNodeConditional +

                //  "<Render Value='" + render + "' />" + "\r\n" +
                //  "<Gravity Value='" + gravityX + ", " + gravityY + ", " + gravityZ + "' />" + "\r\n" + // Gravity in X, Altitude and Z directions
                //  "<Force Value='" + force + "' OverrideRotation='" + overrideRotation + "' />" + "\r\n" + // Gravity in X, Altitude and Z directions
                //  "<Position Value='0, 0, 0' />" + "\r\n" + // doesn;t work
                //  "<Life Value='" + timeSpan + "' />" + "\r\n" + // life of each particle in seconds
                //  "<Speed Value='" + particleSpeed + "' />" + "\r\n" + // this value multiply the Emitter speed values (x,y,z)
                //  "<Color Value='20," + colorR + "," + colorG + "," + colorB + "' />" + "\r\n" +
                //  "<Size Value='" + sizeWithRatioX /*size*/ + "," + sizeWithRatioY /*size * sizeRatio*/ + "' />" + "\r\n" + // size of the particle image 1=original image size. Format: SizeX, SizeY
                //  "<Drag Value='" + drag + "' />" + "\r\n" + // drag force (units like graviy)
                //  "<Blend Type='" + blend + "' />" + "\r\n" +
                //    //***   "<Rotation Speed='0' Time='1.7' />" + "\r\n" + // optional: should be in a checkbox
                //  "<Fade FadeIn='" + fadeIn + "' FadeOut='" + fadeOut + "' MaxFade='" + maxFade + "' />" + "\r\n" + // fade of each particle. FadeIn/fade out in seconds. Max fade - the maximum fade value (alpha 0-1)
                //"</ParticleEmitter>" + "\r\n";
                //particleText += "</Particle>";

                //ITerrainEffect66 ite = sgworld.Creator.CreateEffect(p, particleText, branch, cl.name + cl.number);

                //ite.EffectXML = particleText;
                //ite.Terrain.BBox


                //Console.WriteLine("x: {0} y {1} number {2}", cl.longitude, cl.latitude, cl.number);
            }

            //DBSCAN.Cluster();

            //for (int i = 0; i < DBSCAN.center.Count; i++)
            //{
            //    IPosition66 p = sgworld.Creator.CreatePosition(DBSCAN.center[i].longitude, DBSCAN.center[i].latitude, 0, AltitudeTypeCode.ATC_TERRAIN_RELATIVE,
            //      341, -90.0, 0, 445000);
            //    ITerrainRegularPolygon66 Circle = sgworld.Creator.CreateCircle(p, DBSCAN.p_count[i], 0x00FFFF, 0x00FF00, "", "");
            //    Circle.LineStyle.Width = -5.0;
            //   // sgworld.Creator.CreateCircle(p, DBSCAN.p_count[i]*100, 0x0000FF, 0x00FF00, "", "");
            //     //sgworld.Creator.CreateEllipse(p, DBSCAN.p_count[i], DBSCAN.p_count[i], 0x00FFFF, 0x00FF00, -1, "", "");

            //}
        }