Example #1
0
 private void ProcessGeometry()
 {
     // TODO: apply rotation and scaling
     polygons = T3DParser.LoadPolygons(GeometryText, Location).ToList();
     loadVertices();
     loadEdges();
 }
Example #2
0
 protected override void LoadText(string text)
 {
     foreach (var actor in T3DParser.LoadActors(text))
     {
         AddActor(actor);
     }
     loadInfo();
     loadType();
 }
Example #3
0
        public void MoveVertex(Point3D from, Point3D to)
        {
            if (isReadOnly)
            {
                throw new InvalidOperationException("This map cannot be modified because it is read-only");
            }

            GeometryText = T3DParser.TranslateVertex(GeometryText, from, to, MinVertexDist);
            ProcessGeometry();
        }
Example #4
0
        protected override void LoadText(string text)
        {
            // Load properties
            base.LoadText(text);
            LoadFlags();
            LoadOperation();
            LoadScale();

            // Load geometry
            GeometryText = T3DParser.GetGeometryText(text);
            ProcessGeometry();
        }
Example #5
0
        protected override void LoadText(string text)
        {
            string firstLine   = new StringReader(text).ReadLine();
            int    classStart  = firstLine.IndexOf("Class=", "Begin Actor ".Length);
            int    classEnd    = classStart + "Class=".Length;
            int    nameStart   = firstLine.IndexOf("Name=", classEnd);
            int    nameEnd     = nameStart + "Name=".Length;
            int    classLength = nameStart - 1 - classEnd;
            int    nameLength  = firstLine.Length - nameEnd;

            Class      = text.Substring(classEnd, classLength);
            Name       = text.Substring(nameEnd, nameLength);
            properties = T3DParser.GetProperties(text).ToDictionary(p => p.Key, p => p.Value);
            LoadPosition();
        }
Example #6
0
 protected override string GenerateText()
 {
     return(T3DParser.GenerateText(this));
 }