Example #1
0
        public void Draw(IDisplay disp, gView.Framework.Data.IFeature feature)
        {
            ISymbol symbol = null;
            object  od     = feature[_valueField];

            bool found = false;

            if (od != null && od != DBNull.Value)
            {
                try
                {
                    double d = Convert.ToDouble(od);

                    foreach (QuantityClass qClass in _quantityClasses)
                    {
                        if (qClass == null)
                        {
                            continue;
                        }
                        if (qClass.Min <= d && qClass.Max >= d)
                        {
                            symbol = qClass.Symbol;
                            found  = true;
                            break;
                        }
                    }
                }
                catch
                {
                }
            }
            if (found == false)
            {
                symbol = _defaultSymbol;
            }

            if (symbol == null)
            {
                return;
            }
            if (_symbolRotation.RotationFieldName != "")
            {
                if (symbol is ISymbolRotation)
                {
                    object rot = feature[_symbolRotation.RotationFieldName];
                    if (rot != null && rot != DBNull.Value)
                    {
                        ((ISymbolRotation)symbol).Rotation = (float)_symbolRotation.Convert2DEGAritmetic(Convert.ToDouble(rot));
                    }
                    else
                    {
                        ((ISymbolRotation)symbol).Rotation = 0;
                    }
                }
            }
            if (symbol != null)
            {
                disp.Draw(symbol, feature.Shape);
            }
        }
Example #2
0
        public void Draw(IDisplay disp, gView.Framework.Data.IFeature feature)
        {
            bool rendered = false;

            foreach (Rule rule in _rules)
            {
                if (rule.Symbol == null ||
                    !rule.RenderFeature(disp, feature, _featureSRef))
                {
                    continue;
                }

                if (rule.filterType == Rule.FilterType.ElseFilter &&
                    rendered)
                {
                    continue;
                }

                disp.Draw(rule.Symbol, feature.Shape);
                rendered = true;

                // Erste Regel zieht  ???
                // break;
            }
        }
Example #3
0
        public bool Update(gView.Framework.Data.IFeatureClass fClass, gView.Framework.Data.IFeature feature)
        {
            List <IFeature> features = new List <IFeature>();

            features.Add(feature);

            return(Update(fClass, features));
        }
Example #4
0
        public void Draw(IDisplay disp, gView.Framework.Data.IFeature feature)
        {
            if (feature == null)
            {
                return;
            }

            _symbol.Draw(feature.Shape, disp);
        }
 public void Draw(IDisplay disp, gView.Framework.Data.IFeature feature)
 {
     foreach (IFeatureRenderer renderer in _renderers)
     {
         if (renderer == null)
         {
             continue;
         }
         renderer.Draw(disp, feature);
     }
 }
Example #6
0
        public bool Insert(gView.Framework.Data.IFeatureClass fClass, gView.Framework.Data.IFeature feature)
        {
            if (fClass == null || feature == null)
            {
                return(false);
            }

            List <IFeature> features = new List <IFeature>();

            return(Insert(fClass, features));
        }
Example #7
0
        public Task <bool> Insert(gView.Framework.Data.IFeatureClass fClass, gView.Framework.Data.IFeature feature)
        {
            if (fClass == null || feature == null)
            {
                return(Task.FromResult <bool>(false));
            }

            List <IFeature> features = new List <IFeature>();

            return(Insert(fClass, features));
        }
Example #8
0
        public void Draw(IDisplay disp, gView.Framework.Data.IFeature feature)
        {
            if (feature != null)
            {
                if (feature.Shape is IPolyline)
                {
                    if (_renderers[0] != null)
                    {
                        _renderers[0].Draw(disp, feature);
                    }
                }
                else if (feature.Shape is IPoint)
                {
                    object isSwitch    = feature["SWITCH"];
                    object switchState = feature["STATE"];

                    if (isSwitch is bool &&
                        switchState is bool &&
                        (bool)isSwitch == true)
                    {
                        if ((bool)switchState == true)
                        {
                            if (_renderers[2] != null)
                            {
                                _renderers[2].Draw(disp, feature);
                            }
                        }
                        else
                        {
                            if (_renderers[3] != null)
                            {
                                _renderers[3].Draw(disp, feature);
                            }
                        }
                    }
                    else
                    {
                        if (_renderers[1] != null)
                        {
                            _renderers[1].Draw(disp, feature);
                        }
                    }
                }
            }
        }
            public void Draw(IDisplay disp, gView.Framework.Data.IFeature feature)
            {
                if (_renderer == null)
                {
                    return;
                }

                if (this.MinimumScale > 1 && this.MinimumScale > disp.mapScale)
                {
                    return;
                }
                if (this.MaximumScale > 1 && this.MaximumScale < disp.mapScale)
                {
                    return;
                }

                _renderer.Draw(disp, feature);
            }
Example #10
0
        public void Draw(IDisplay disp, gView.Framework.Data.IFeature feature)
        {
            if (disp == null || disp.mapScale < 1.0 ||
                feature == null || !(feature.Shape is IPolyline))
            {
                return;
            }

            IPolyline fpLine = feature.Shape as IPolyline;

            Polyline pLine = new Polyline();
            Path     path  = new Path();

            path.AddPoint(new Point());
            path.AddPoint(new Point());

            pLine.AddPath(path);
            double l = 7.0 * disp.mapScale / (disp.dpm);  // [m]

            if (disp.refScale >= 1.0)
            {
                l *= disp.refScale / disp.mapScale;
            }

            for (int i = 0; i < fpLine.PathCount; i++)
            {
                IPath fPath = fpLine[i];
                if (fPath == null || fPath.PointCount < 2)
                {
                    continue;
                }

                path[0].X = fPath[0].X;
                path[0].Y = fPath[0].Y;
                double al1 = 0.0, al2 = 0.0;
                for (int p = 1; p < fPath.PointCount; p++)
                {
                    path[1].X = fPath[p].X;
                    path[1].Y = fPath[p].Y;

                    disp.Draw(_lineSymbol, pLine);

                    al1 = Math.Atan2(path[1].Y - path[0].Y, path[1].X - path[0].X);
                    if (p < fPath.PointCount - 1)
                    {
                        al2 = Math.Atan2(fPath[p + 1].Y - path[1].Y, fPath[p + 1].X - path[1].X);
                    }
                    else
                    {
                        al2 = al1;
                    }

                    #region LineCapStyle
                    if (_capType == lineCapType.Arrow ||
                        _capType == lineCapType.ArrowLine)
                    {
                        #region Arrow
                        disp.Draw(_lineSymbol, Arrow(path[0], l, al1));
                        disp.Draw(_lineSymbol, Arrow(path[1], -l, al1));
                        #endregion
                    }

                    if (_capType == lineCapType.ArrowLine ||
                        _capType == lineCapType.Circle ||
                        _capType == lineCapType.Line)
                    {
                        #region CapLine
                        if (p == 1 || p != fPath.PointCount - 1)
                        {
                            if (p == 1)
                            {
                                disp.Draw(_lineSymbol, CapLine(path[0], l, al1));
                            }
                            disp.Draw(_lineSymbol, CapLine(path[1], l, (al1 + al2) / 2.0));
                        }
                        if (p == fPath.PointCount - 1)
                        {
                            disp.Draw(_lineSymbol, CapLine(path[1], l, al2));
                        }
                        #endregion
                    }

                    if (_capType == lineCapType.Line)
                    {
                        #region Line
                        if (p == 1 || p != fPath.PointCount - 1)
                        {
                            if (p == 1)
                            {
                                disp.Draw(_lineSymbol, CapLine(path[0], l * 0.8, al1 - Math.PI / 4.0));
                            }
                            disp.Draw(_lineSymbol, CapLine(path[1], l * 0.8, (al1 + al2) / 2.0 - Math.PI / 4.0));
                        }
                        if (p == fPath.PointCount - 1)
                        {
                            disp.Draw(_lineSymbol, CapLine(path[1], l * 0.8, al2 - Math.PI / 4.0));
                        }
                        #endregion
                    }

                    if (_capType == lineCapType.Circle)
                    {
                        #region Circle
                        if (p == fPath.PointCount - 1)
                        {
                            disp.Draw(_lineSymbol, Circle(path[1], l * 0.8));
                        }
                        disp.Draw(_lineSymbol, Circle(path[0], l * 0.8));
                        #endregion
                    }
                    #endregion

                    #region Label
                    string label = String.Format("{0:" + _format + "}", path.Length);
                    _textSymbol.Text = label;
                    disp.Draw(_textSymbol, pLine);
                    #endregion

                    path[0].X = fPath[p].X;
                    path[0].Y = fPath[p].Y;
                }
            }
        }
Example #11
0
 public bool Update(gView.Framework.Data.IFeatureClass fClass, gView.Framework.Data.IFeature feature)
 {
     throw new Exception("The method or operation is not implemented.");
 }