protected virtual void RenderPointTemplate(MapPointTemplate mapPointTemplate, Symbol coreSymbol, bool customTemplate, bool ignoreBackgroundColor, bool ignoreSize, bool ignoreMarker, bool hasScope)
        {
            if (mapPointTemplate == null)
            {
                RenderStyle(null, null, coreSymbol, ignoreBackgroundColor, hasScope);
                coreSymbol.BorderStyle = GetBorderStyle(null, null, hasScope);
                return;
            }
            RenderSpatialElementTemplate(mapPointTemplate, coreSymbol, ignoreBackgroundColor, hasScope);
            Style         style  = mapPointTemplate.Style;
            StyleInstance style2 = mapPointTemplate.Instance.Style;

            coreSymbol.BorderStyle = GetBorderStyle(style, style2, hasScope);
            if (!ignoreSize)
            {
                int   size = GetSize(mapPointTemplate, hasScope);
                float num3 = coreSymbol.Width = (coreSymbol.Height = size);
            }
            ReportEnumProperty <MapPointLabelPlacement> labelPlacement = mapPointTemplate.LabelPlacement;
            TextAlignment textAlignment = TextAlignment.Bottom;

            if (labelPlacement != null)
            {
                if (!labelPlacement.IsExpression)
                {
                    textAlignment = GetTextAlignment(labelPlacement.Value);
                }
                else if (hasScope)
                {
                    textAlignment = GetTextAlignment(mapPointTemplate.Instance.LabelPlacement);
                }
            }
            coreSymbol.TextAlignment = textAlignment;
        }
        internal void RenderPolygonCenterPoint(MapPolygon mapPolygon, Symbol coreSymbol, bool hasScope)
        {
            bool             flag             = PolygonUseCustomTemplate(mapPolygon, hasScope);
            MapPointTemplate mapPointTemplate = (!flag) ? m_vectorLayerMapper.GetMapPointTemplate() : mapPolygon.MapCenterPointTemplate;

            RenderPointTemplate(mapPointTemplate, coreSymbol, flag, !flag && m_vectorLayerMapper.HasPointColorRule(coreSymbol) && hasScope, !flag && m_vectorLayerMapper.HasPointSizeRule(coreSymbol) && hasScope, !flag && m_vectorLayerMapper.HasMarkerRule(coreSymbol) && hasScope, hasScope);
        }
        internal void Render(MapPoint mapPoint, Symbol coreSymbol, bool hasScope)
        {
            bool             flag             = UseCustomTemplate(mapPoint, hasScope);
            MapPointTemplate mapPointTemplate = (!flag) ? MapPointLayer.MapPointTemplate : mapPoint.MapPointTemplate;

            RenderPointTemplate(mapPointTemplate, coreSymbol, flag, !flag && m_vectorLayerMapper.HasPointColorRule(coreSymbol) && hasScope, !flag && m_vectorLayerMapper.HasPointSizeRule(coreSymbol) && hasScope, !flag && m_vectorLayerMapper.HasMarkerRule(coreSymbol) && hasScope, hasScope);
        }
 private bool HasCenterPointTemplate(MapPolygon mapPolygon, MapPointTemplate pointTemplate, bool hasScope)
 {
     if (mapPolygon == null || !PointTemplateMapper.PolygonUseCustomTemplate(mapPolygon, hasScope))
     {
         return(pointTemplate != null);
     }
     return(mapPolygon.MapCenterPointTemplate != null);
 }
        internal int GetSize(MapPointTemplate mapPointTemplate, bool hasScope)
        {
            ReportSizeProperty size = mapPointTemplate.Size;

            if (size != null)
            {
                if (!size.IsExpression)
                {
                    return(MappingHelper.ToIntPixels(size.Value, m_mapMapper.DpiX));
                }
                if (hasScope)
                {
                    return(MappingHelper.ToIntPixels(mapPointTemplate.Instance.Size, m_mapMapper.DpiX));
                }
                return(GetDefaultSymbolSize(m_mapMapper.DpiX));
            }
            return(GetDefaultSymbolSize(m_mapMapper.DpiX));
        }
Example #6
0
        protected override void RenderPointTemplate(MapPointTemplate mapPointTemplate, Symbol coreSymbol, bool customTemplate, bool ignoreBackgoundColor, bool ignoreSize, bool ignoreMarker, bool hasScope)
        {
            base.RenderPointTemplate(mapPointTemplate, coreSymbol, customTemplate, ignoreBackgoundColor, ignoreSize, ignoreMarker, hasScope);
            if (ignoreMarker)
            {
                return;
            }
            MapMarker      mapMarker   = ((MapMarkerTemplate)mapPointTemplate).MapMarker;
            MapMarkerStyle markerStyle = MapMapper.GetMarkerStyle(mapMarker, hasScope);

            if (markerStyle != MapMarkerStyle.Image)
            {
                coreSymbol.MarkerStyle = MapMapper.GetMarkerStyle(markerStyle);
                return;
            }
            MapMarkerImage mapMarkerImage = mapMarker.MapMarkerImage;

            if (mapMarkerImage == null)
            {
                throw new RenderingObjectModelException(RPRes.rsMapLayerMissingProperty(RPRes.rsObjectTypeMap, m_mapVectorLayer.MapDef.Name, m_mapVectorLayer.Name, "MapMarkerImage"));
            }
            string image;

            if (CanShareMarkerImage(mapMarkerImage, customTemplate))
            {
                if (sharedImageName == null)
                {
                    sharedImageName = m_mapMapper.AddImage(mapMarkerImage);
                }
                image = sharedImageName;
            }
            else
            {
                image = m_mapMapper.AddImage(mapMarkerImage);
            }
            coreSymbol.Image           = image;
            coreSymbol.ImageResizeMode = m_mapMapper.GetImageResizeMode(mapMarkerImage);
            coreSymbol.ImageTransColor = m_mapMapper.GetImageTransColor(mapMarkerImage);
        }
 internal MapPointTemplateInstance(MapPointTemplate defObject)
     : base(defObject)
 {
     m_defObject = defObject;
 }