Ejemplo n.º 1
0
        public void MergeVectors(string vectorText)
        {
            foreach (string singleVector in vectorText.Split(new string[] { "00001" + Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (IsVectorSymbol(singleVector))
                {
                    VectorSymbol vs = new VectorSymbol(singleVector, ColorTables["DAY_BRIGHT"]);
                        //TODO: not nice to assume this ColorTable
                    try
                    {
                        if (vs.IsValid())
                        {
                            SymbolVectors.Add(vs.Code, vs);
                        }
                        else
                        {
                            Debug.Print("Vector symbol {0} is not valid and can't be merged.", vs.Code);
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.Print(
                            "Vector symbol {0} can't be loaded with following message: {1}, if not invalid, assuming already exists and replacing",
                            vs.Code, ex.Message);
                        if (vs.Code != null)
                        {
                            this.SymbolVectors[vs.Code] = vs;
                        }
                    }
                    if (vs.ObjectId >= NextId)
                    {
                        NextId = vs.ObjectId + 1;
                    }
                }

                if (IsVectorLine(singleVector))
                {
                    VectorLine vl = new VectorLine(singleVector, ColorTables["DAY_BRIGHT"]);
                        //TODO: not nice to assume this ColorTable
                    try
                    {
                        if (vl.IsValid())
                        {
                            LineVectors.Add(vl.Code, vl);
                        }
                        else
                        {
                            Debug.Print("Vector symbol {0} is not valid and can't be merged.", vl.Code);
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.Print(
                            "Vector {0} can't be loaded with following message: {1}, if not invalid, assuming already exists and replacing",
                            vl.Code, ex.Message);
                        if (vl.Code != null)
                        {
                            this.LineVectors[vl.Code] = vl;
                        }
                    }
                    if (vl.ObjectId >= NextId)
                    {
                        NextId = vl.ObjectId + 1;
                    }
                }

                if (IsVectorPattern(singleVector))
                {
                    VectorPattern vp = new VectorPattern(singleVector, ColorTables["DAY_BRIGHT"]);
                        //TODO: not nice to assume this ColorTable
                    try
                    {
                        if (vp.IsValid())
                        {
                            PatternVectors.Add(vp.Code, vp);
                        }
                        else
                        {
                            Debug.Print("Vector symbol {0} is not valid and can't be merged.", vp.Code);
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.Print(
                            "Vector {0} can't be loaded with following message: {1}, if not invalid, assuming already exists and replacing",
                            vp.Code, ex.Message);
                        if (vp.Code != null)
                        {
                            this.PatternVectors[vp.Code] = vp;
                        }
                    }
                    if (vp.ObjectId >= NextId)
                    {
                        NextId = vp.ObjectId + 1;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public VectorLine Clone()
 {
     VectorLine vs = new VectorLine(this.ToString(), this.ColorTable);
     return vs;
 }
Ejemplo n.º 3
0
        public VectorLine Clone()
        {
            VectorLine vs = new VectorLine(this.ToString(), this.ColorTable);

            return(vs);
        }