Exemple #1
0
        public void AddObject(ValuePairList obj)
        {
            if (objectList.Count == 0)
            {
                baseDictHandle = obj.Get(5).First();
            }

            objectList.Add(obj.Get(5).First(), obj);
        }
Exemple #2
0
        private List <float> BuildSPLine(ValuePairList enty)
        {
            List <float> vertexBuffer = new List <float>();

            int cpNum   = int.Parse(enty.Get(73).First());
            int knotNum = int.Parse(enty.Get(72).First());
            int degrees = int.Parse(enty.Get(71).First());

            List <float> cpX   = new List <float>();
            List <float> cpY   = new List <float>();
            List <float> knots = new List <float>();
            List <float> cpW   = new List <float>();

            float lineLength = 0;

            for (int i = 0; i < cpNum; i++)
            {
                cpX.Add(float.Parse(enty.Get(10).ElementAt(i)));
                cpY.Add(float.Parse(enty.Get(20).ElementAt(i)));

                if (0 < i)
                {
                    lineLength += MathF.Sqrt(Math.Abs((cpX[i] - cpX[i - 1]) * 2 + (cpY[i] - cpY[i - 1])) * 2);
                }

                if (enty.Get(41) != null && i < enty.Get(41).Count())
                {
                    cpW.Add(float.Parse(enty.Get(41).ElementAt(i)));
                }
                else
                {
                    cpW.Add(1);
                }
            }

            for (int i = 0; i < knotNum; i++)
            {
                knots.Add(float.Parse(enty.Get(40).ElementAt(i)));
            }

            for (float t = 0; t <= 1; t += 1 / (lineLength))
            {
                vertexBuffer.AddRange(NURBSFunction(cpX, cpY, cpW, degrees, knots, t));
            }

            return(vertexBuffer);
        }
Exemple #3
0
        public void AddEntry(ValuePairList entry)
        {
            string key;

            if (entry.Contains(2))
            {
                key = entry.Get(2).First();
            }
            else
            {
                key = entry.Get(3).First();
            }

            if (entries.ContainsKey(key))
            {
                entries[key].Add(entry);
            }
            else
            {
                entries.Add(key, new List <ValuePairList>());
                entries[key].Add(entry);
            }
        }
Exemple #4
0
 public void AddBlock(ValuePairList block)
 {
     blockList.Add(block.Get(5).First(), block);
 }
Exemple #5
0
 public void AddClass(ValuePairList dXFClass)
 {
     classList.Add(dXFClass.Get(1).First(), dXFClass);
 }
Exemple #6
0
 public void AddVariable(ValuePairList variable)
 {
     variableList.Add(variable.Get(9).First(), variable);
 }