Exemple #1
0
        /// <summary>
        /// Save a feature layer of IPolygon to Ipe
        /// </summary>
        public static string TranCpgToIpe(CPolygon cpg, IFillSymbol pFillSymbol,
                                          IEnvelope pFLayerEnv, CEnvelope pIpeEnv, string strBoundWidth = "normal")
        {
            //get the color of the filled part
            //we are not allowed to directly use "var pFillRgbColor = pFillSymbol.Color as IRgbColor;"
            //Nor can we use "var pFillRgbColor = pFillSymbol.Color.RGB as IRgbColor;"
            //pFillSymbol.Color.RGB has type 'int'
            IColor pFillSymbolColor = new RgbColorClass();

            pFillSymbolColor.RGB = pFillSymbol.Color.RGB;
            CColor cColor            = new CUtility.CColor(pFillSymbolColor as IRgbColor);
            var    pSimpleFillSymbol = pFillSymbol as ISimpleFillSymbol;

            if (pSimpleFillSymbol != null)
            {
                if (pSimpleFillSymbol.Style == esriSimpleFillStyle.esriSFSHollow ||
                    pSimpleFillSymbol.Style == esriSimpleFillStyle.esriSFSNull)
                {
                    cColor = null;
                }
            }


            //get the color of the out line
            var pOutlineRgbColor = pFillSymbol.Outline.Color as IRgbColor;

            if (strBoundWidth == "")
            {
                strBoundWidth = pFillSymbol.Outline.Width.ToString();
            }

            //append the string
            return(CIpeDraw.DrawCpg(cpg, pFLayerEnv, pIpeEnv, new CColor(pOutlineRgbColor), cColor, strBoundWidth));
        }
Exemple #2
0
        private string strDataOfLayers(int intLayerNum, List <string> strLayerNameLt, IFeatureLayer pFLayer,
                                       IEnvelope pFLayerEnv, CEnvelope pIpeEnv, string strBoundWidth,
                                       string strSimplification, string strBufferStyle, double dblMiterLimit)
        {
            //for the first layer, we add all the patches
            string strDataAllLayers = CIpeDraw.SpecifyLayerByWritingText(strLayerNameLt[0], "removable", 320, 64);

            strDataAllLayers += CToIpe.GetScaleLegend(pFLayerEnv, pIpeEnv, CHelpFunc.GetUnits(_ParameterInitialize.m_mapControl.MapUnits));
            strDataAllLayers += CIpeDraw.writeIpeText(strLayerNameLt[0], 320, 128)
                                + "<group>\n" + CToIpe.GetDataOfFeatureLayer(pFLayer, pFLayerEnv, pIpeEnv, strBoundWidth, true) + "</group>\n";

            //for each of other layers, we only add the new patch
            for (int i = 1; i < strLayerNameLt.Count; i++)
            {
                strDataAllLayers += CIpeDraw.SpecifyLayerByWritingText(strLayerNameLt[i], "removable", 320, 64);

                //draw a rectangle to cover the patch number of the last layer
                strDataAllLayers += CIpeDraw.drawIpeBox(304, 112, 384, 160, "white");

                //add layer name and a text of patch numbers
                strDataAllLayers += CIpeDraw.writeIpeText(strLayerNameLt[i], 320, 128);

                strDataAllLayers += CToIpe.GetScaleLegend(pFLayerEnv, pIpeEnv,
                                                          CHelpFunc.GetUnits(_ParameterInitialize.m_mapControl.MapUnits));

                //add the Content of animations
                strDataAllLayers += "<group>\n";
                strDataAllLayers += CIpeDraw.drawIpeEdge(pIpeEnv.XMin, pIpeEnv.YMin, pIpeEnv.XMin, pIpeEnv.YMax, "white");
                foreach (var cpg in GetResultCpgEb(this.MergedCpgLt, Convert.ToDouble(strLayerNameLt[i]),
                                                   strSimplification, strBufferStyle, dblMiterLimit))
                {
                    strDataAllLayers += CIpeDraw.DrawCpg(cpg, pFLayerEnv, pIpeEnv,
                                                         new CUtility.CColor(0, 0, 0), new CUtility.CColor(230, 230, 230), strBoundWidth);
                }
                strDataAllLayers += "</group>\n";
                //strDataAllLayers += CToIpe.TranIpgToIpe(IpgLt[i - 1], pFillSymbolLt[i - 1], pFLayerEnv, pIpeEnv, strBoundWidth);
            }

            return(strDataAllLayers);
        }