private void ParamChanged()
 {
     geoRangeEllipFrustumEntity = m_Geometry as GSOGeoRangeEllipFrustumEntity;
     if (geoRangeEllipFrustumEntity != null)
     {
         try
         {
             geoRangeEllipFrustumEntity.TopXRadius    = Convert.ToDouble(textBoxTopXRadius.Text);
             geoRangeEllipFrustumEntity.TopYRadius    = Convert.ToDouble(textBoxTopYRadius.Text);
             geoRangeEllipFrustumEntity.BottomXRadius = Convert.ToDouble(textBoxBottomXRadius.Text);
             geoRangeEllipFrustumEntity.BottomYRadius = Convert.ToDouble(textBoxBottomYRadius.Text);
             geoRangeEllipFrustumEntity.Length        = Convert.ToDouble(textBoxLength.Text);
             geoRangeEllipFrustumEntity.Slices        = Convert.ToInt32(textBoxSlices.Text);
             geoRangeEllipFrustumEntity.StartAngle    = Convert.ToDouble(textBoxStartAngle.Text);
             geoRangeEllipFrustumEntity.EndAngle      = Convert.ToDouble(textBoxEndAngle.Text);
             GSOEntityStyle3D style = new GSOEntityStyle3D();
             style.UsingSingleColor           = true;
             geoRangeEllipFrustumEntity.Style = style;
             if (m_GlobeControl != null)
             {
                 m_GlobeControl.Refresh();
             }
         }
         catch (System.Exception exp)
         {
             Log.PublishTxt(exp);
         }
     }
 }
        private void ParamChanged()
        {
            geoRangeEllipFrustumEntity = m_Geometry as GSOGeoRangeEllipFrustumEntity;
            if (geoRangeEllipFrustumEntity != null)
            {
                try
                {
                    geoRangeEllipFrustumEntity.TopXRadius = Convert.ToDouble(textBoxTopXRadius.Text);
                    geoRangeEllipFrustumEntity.TopYRadius = Convert.ToDouble(textBoxTopYRadius.Text);
                    geoRangeEllipFrustumEntity.BottomXRadius = Convert.ToDouble(textBoxBottomXRadius.Text);
                    geoRangeEllipFrustumEntity.BottomYRadius = Convert.ToDouble(textBoxBottomYRadius.Text);
                    geoRangeEllipFrustumEntity.Length = Convert.ToDouble(textBoxLength.Text);
                    geoRangeEllipFrustumEntity.Slices = Convert.ToInt32(textBoxSlices.Text);
                    geoRangeEllipFrustumEntity.StartAngle = Convert.ToDouble(textBoxStartAngle.Text);
                    geoRangeEllipFrustumEntity.EndAngle = Convert.ToDouble(textBoxEndAngle.Text);
                    GSOEntityStyle3D style = new GSOEntityStyle3D();
                    style.UsingSingleColor = true;
                    geoRangeEllipFrustumEntity.Style = style;
                    if (m_GlobeControl != null)
                    {
                        m_GlobeControl.Refresh();
                    }

                }
                catch (System.Exception exp)
                {
                    Log.PublishTxt(exp);
                }

            }
        }
Beispiel #3
0
 private void ParamChanged()
 {
     geoRangeEllipsoidEntity = m_Geometry as GSOGeoRangeEllipsoidEntity;
     if (geoRangeEllipsoidEntity != null)
     {
         try
         {
             geoRangeEllipsoidEntity.XRadius  = Convert.ToDouble(textBoxXRadius.Text);
             geoRangeEllipsoidEntity.YRadius  = Convert.ToDouble(textBoxYRadius.Text);
             geoRangeEllipsoidEntity.ZRadius  = Convert.ToDouble(textBoxZRadius.Text);
             geoRangeEllipsoidEntity.Stacks   = Convert.ToInt32(textBoxStacks.Text);
             geoRangeEllipsoidEntity.Slices   = Convert.ToInt32(textBoxSlices.Text);
             geoRangeEllipsoidEntity.StartLat = Convert.ToDouble(textBoxStartLat.Text);
             geoRangeEllipsoidEntity.EndLat   = Convert.ToDouble(textBoxEndLat.Text);
             geoRangeEllipsoidEntity.StartLon = Convert.ToDouble(textBoxStartLon.Text);
             geoRangeEllipsoidEntity.EndLon   = Convert.ToDouble(textBoxEndLon.Text);
             GSOEntityStyle3D style = new GSOEntityStyle3D();
             style.UsingSingleColor        = true;
             geoRangeEllipsoidEntity.Style = style;
             if (m_GlobeControl != null)
             {
                 m_GlobeControl.Refresh();
             }
         }
         catch (System.Exception exp)
         {
             Log.PublishTxt(exp);
         }
     }
 }
Beispiel #4
0
        private void comboBoxPolygonMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (m_feature.Geometry == null)
            {
                return;
            }
            GSOEntityStyle3D geoStyle3d = m_feature.Geometry.Style as GSOEntityStyle3D;

            if (geoStyle3d != null)
            {
                switch (comboBoxPolygonMode.SelectedIndex)
                {
                case 0:
                    geoStyle3d.PolygonMode = EnumPolygonMode.Solid;
                    break;

                case 1:
                    geoStyle3d.PolygonMode = EnumPolygonMode.Wireframe;
                    break;

                case 2:
                    geoStyle3d.PolygonMode = EnumPolygonMode.Points;
                    break;
                }
                if (m_GlobeControl != null)
                {
                    m_GlobeControl.Refresh();
                }
            }
        }
        private void ParamChanged()
        {
            geoRangeEllipsoidEntity = m_Geometry as GSOGeoRangeEllipsoidEntity;
            if (geoRangeEllipsoidEntity != null)
            {
                try
                {
                    geoRangeEllipsoidEntity.XRadius = Convert.ToDouble(textBoxXRadius.Text);
                    geoRangeEllipsoidEntity.YRadius = Convert.ToDouble(textBoxYRadius.Text);
                    geoRangeEllipsoidEntity.ZRadius = Convert.ToDouble(textBoxZRadius.Text);
                    geoRangeEllipsoidEntity.Stacks = Convert.ToInt32(textBoxStacks.Text);
                    geoRangeEllipsoidEntity.Slices = Convert.ToInt32(textBoxSlices.Text);
                    geoRangeEllipsoidEntity.StartLat = Convert.ToDouble(textBoxStartLat.Text);
                    geoRangeEllipsoidEntity.EndLat = Convert.ToDouble(textBoxEndLat.Text);
                    geoRangeEllipsoidEntity.StartLon = Convert.ToDouble(textBoxStartLon.Text);
                    geoRangeEllipsoidEntity.EndLon = Convert.ToDouble(textBoxEndLon.Text);
                    GSOEntityStyle3D style = new GSOEntityStyle3D();
                    style.UsingSingleColor = true;
                    geoRangeEllipsoidEntity.Style = style;
                    if (m_GlobeControl != null)
                    {
                        m_GlobeControl.Refresh();
                    }

                }
                catch (System.Exception exp)
                {
                    Log.PublishTxt(exp);
                }

            }
        }
Beispiel #6
0
 private void entityColorChanged()
 {
     if (m_feature.Geometry != null)
     {
         GSOEntityStyle3D geoStyle3d = m_feature.Geometry.Style as GSOEntityStyle3D;
         if (geoStyle3d != null)
         {
             geoStyle3d.EntityColor = Color.FromArgb(Convert.ToByte(numericUpDownModelOpaque.Value), pictureBoxModelColor.BackColor);
             if (m_GlobeControl != null)
             {
                 m_GlobeControl.Refresh();
             }
         }
     }
 }
Beispiel #7
0
        private void checkBoxBothFace_CheckedChanged(object sender, EventArgs e)
        {
            if (m_feature.Geometry == null)
            {
                return;
            }
            GSOEntityStyle3D geoStyle3d = m_feature.Geometry.Style as GSOEntityStyle3D;

            if (geoStyle3d != null)
            {
                geoStyle3d.UsingBothFace = checkBoxBothFace.Checked;
                if (m_GlobeControl != null)
                {
                    m_GlobeControl.Refresh();
                }
            }
        }
Beispiel #8
0
        private void checkBoxUseSingleColor_CheckedChanged(object sender, EventArgs e)
        {
            bool bChecked = checkBoxUseSingleColor.Checked;

            pictureBoxModelColor.Enabled     = bChecked;
            numericUpDownModelOpaque.Enabled = bChecked;

            if (m_feature.Geometry != null)
            {
                GSOEntityStyle3D geoEntityStyle = m_feature.Geometry.Style as GSOEntityStyle3D;
                if (geoEntityStyle != null)
                {
                    geoEntityStyle.UsingSingleColor = bChecked;
                    if (m_GlobeControl != null)
                    {
                        m_GlobeControl.Refresh();
                    }
                }
            }
        }
Beispiel #9
0
        private void SetControlsByStyle(GSOStyle style)
        {
            GSOEntityStyle3D geoStyle3d = style as GSOEntityStyle3D;

            if (geoStyle3d != null)
            {
                // 这句要写到前面,不然下面Checked的时候要检查
                pictureBoxModelColor.BackColor = geoStyle3d.EntityColor;
                numericUpDownModelOpaque.Value = geoStyle3d.EntityColor.A;

                switch (geoStyle3d.PolygonMode)
                {
                case EnumPolygonMode.Solid:
                    comboBoxPolygonMode.SelectedIndex = 0;
                    break;

                case EnumPolygonMode.Wireframe:
                    comboBoxPolygonMode.SelectedIndex = 1;
                    break;

                case EnumPolygonMode.Points:
                    comboBoxPolygonMode.SelectedIndex = 2;
                    break;
                }

                checkBoxUseSingleColor.Checked = geoStyle3d.UsingSingleColor;
                checkBoxTexture.Checked        = geoStyle3d.UsingTexture;
                checkBoxLight.Checked          = geoStyle3d.UsingLight;
                checkBoxBothFace.Checked       = geoStyle3d.UsingBothFace;

                checkBoxUseStyle.Checked = true;
            }
            else
            {
                checkBoxUseStyle.Checked = false;
            }

            CheckControlsEnable(checkBoxUseStyle.Checked);
        }
Beispiel #10
0
        private void timerWaterPipe_Tick(object sender, EventArgs e)
        {
            m_nWaterPipeDemoTick++;
            GSOStyle style3d = null;
            GSOEntityStyle3D modeStyle3d = null;
            GSOLayer layer = globeControl1.Globe.Layers["WaterPipeDemo"];
            if (layer != null)
            {
                GSOFeatures features = layer.GetAllFeatures();
                GSOFeatures tempFeatures = ((GSOFeatureFolder)features[0]).Features;

                GSOFeature feature = tempFeatures[24];
                feature.Visible = false;

                for (int i = 25; i < tempFeatures.Length - 1; i++)
                {
                    feature = tempFeatures[i];
                    int nCurIndex = m_nWaterPipeDemoTick % 6;
                    if ((i - 25) == nCurIndex)
                    {
                        feature.Visible = true;
                        style3d = feature.Geometry.Style;
                        if (style3d == null)
                        {
                            style3d = new GSOEntityStyle3D();
                        }
                        modeStyle3d = (GSOEntityStyle3D)style3d;

                        modeStyle3d.UsingSingleColor = true;
                        modeStyle3d.EntityColor = Color.FromArgb(200, 0, 0, 255);
                        feature.Geometry.Style = modeStyle3d;
                    }
                    else if (((GSOGeoModel)feature.Geometry).IsLoaded())
                    {
                        feature.Visible = false;
                    }
                }
                feature = tempFeatures[tempFeatures.Length - 1];
                feature.Visible = true;
                style3d = feature.Geometry.Style;
                if (style3d == null)
                {
                    style3d = new GSOEntityStyle3D();
                }
                modeStyle3d = (GSOEntityStyle3D)style3d;

                modeStyle3d.UsingSingleColor = true;
                modeStyle3d.EntityColor = Color.FromArgb(100, 128, 128, 128);
                feature.Geometry.Style = modeStyle3d;

                globeControl1.Refresh();
            }
        }