Example #1
0
 void Start()
 {
     gcdI = LoadFile.gcdInterpreter;
 }
Example #2
0
 void scanAMF(string _line)
 {
     {
         _line = _line.Trim();
         if (_line.StartsWith("|||ftlVAME"))
         {
             var chunks = _line.Split(' ');
             #region STL
             if (chunks[1] == "STL")
             {
                 if (chunks[2] == "BEGIN")
                 {
                     vertices.Clear();
                     stlInterpreter = new StlInterpreter();
                     type = Type.STL;
                 }
                 else
                 {
                     InspectorL.lastLoaded = InspectorL.LastLoaded.STL;
                     GameObject.Find("MESH").GetComponent<MakeMesh>().MergeMesh();
                     InspectorL.stlTimeSlider = MM.GetMesh().vertices.Length / 3 - 1;
                     InspectorL.stlTimeSliderMin = 0;
                     InspectorL.stlVisSlider = 1;
                     stlCodeLoaded = true;
                     InspectorManager.VoxelManager = true;
                     type = Type.AMF;
                 }
             }
             #endregion
             #region GCD
             if (chunks[1] == "GCD")
             {
                 if (chunks[2] == "BEGIN")
                 {
                     gcdInterpreter = new GcdInterpreter();
                     vertices.Clear();
                     type = Type.GCD;
                 }
                 else
                 {
                     Draw(Type.GCD);
                     InspectorL.gcdTimeSlider = gcdLines.Count - 1;
                     InspectorL.gcdTimeSliderMin = 0;
                     InspectorL.gcdVisSlider = 1;
                     InspectorL.lastLoaded = InspectorL.LastLoaded.GCD;
                     gcdCodeLoaded = true;
                     type = Type.AMF;
                 }
             }
             #endregion
             #region DMC
             if (chunks[1] == "DMC")
             {
                 if (chunks[2] == "BEGIN")
                 {
                     dmcInterpreter = new DmcInterpreter();
                     vertices.Clear();
                     type = Type.DMC;
                 }
                 else
                 {
                     Draw(Type.DMC);
                     InspectorL.dmcTimeSlider = dmcLines.Count - 1;
                     InspectorL.dmcTimeSliderMin = 0;
                     InspectorL.dmcVisSlider = 1;
                     InspectorL.lastLoaded = InspectorL.LastLoaded.DMC;
                     dmcCodeLoaded = true;
                     type = Type.AMF;
                 }
             }
             #endregion
             #region JOB
             if (chunks[1] == "JOB")
             {
                 if (chunks[2] == "BEGIN")
                 {
                     jobInterpreter = new JobInterpreter();
                     vertices.Clear();
                     type = Type.JOB;
                 }
                 else
                 {
                     Draw(Type.JOB);
                     InspectorL.jobTimeSlider = jobLines.Count - 1;
                     InspectorL.jobTimeSliderMin = 0;
                     InspectorL.jobVisSlider = 1;
                     InspectorL.lastLoaded = InspectorL.LastLoaded.JOB;
                     jobCodeLoaded = true;
                     type = Type.AMF;
                 }
             }
             #endregion
             #region voxels
             if (chunks[1] == "Voxels")
             {
                 if (chunks[2] == "BEGIN")
                 {
                     vertices.Clear();
                     float.TryParse(chunks[3], out InspectorR.voxelVis);
                     float.TryParse(chunks[4], out InspectorR.resolution);
                 }
                 else
                 {
                     //Camera.main.GetComponent<InspectorR>().OnVoxelize();
                     type = Type.AMF;
                 }
             }
             #endregion
             #region Setup
             if (chunks[1] == "AMF")
             {
                 if (chunks[2] == "BEGIN")
                 {
                     Camera.main.GetComponent<InspectorT>().Restart();
                     //var savedType = "";
                     //var sts
                     //float.TryParse(chunks[3], out InspectorR.voxelVis);
                     //float.TryParse(chunks[4], out InspectorR.resolution);
                 }
                 if (chunks[2] == "END")
                 {
                     //var savedType = "";
                     //var sts
                     //float.TryParse(chunks[3], out InspectorR.voxelVis);
                     //float.TryParse(chunks[4], out InspectorR.resolution);
                 }
             }
             #endregion
         }
     }
 }