public void DeleteAttachItem(int itemID, int position)
    {
        string text = "1006";

        if (position != 0)
        {
            text = "1007";
        }
        this.m_GameObjData.AttachID[position] = 0;
        S_Item data = GameDataDB.ItemDB.GetData(itemID);

        if (data == null)
        {
            Debug.LogWarning("itemData not be found : " + itemID);
            return;
        }
        Transform transform = TransformTool.SearchHierarchyForBone(base.gameObject.transform, text);

        if (transform == null)
        {
            Debug.LogWarning("node not be found : " + text);
            return;
        }
        Transform transform2 = transform.FindChild(data.StoryPrefabName);

        if (transform2 == null)
        {
            Debug.LogWarning("item not be found : " + data.StoryPrefabName);
            return;
        }
        UnityEngine.Object.Destroy(transform2.gameObject);
    }
    public void SetAttachItem(int itemID, int position)
    {
        string text = "1006";

        if (position != 0)
        {
            text = "1007";
        }
        this.m_GameObjData.AttachID[position] = itemID;
        S_Item data = GameDataDB.ItemDB.GetData(itemID);

        if (data == null)
        {
            Debug.LogWarning("itemData not be found : " + itemID);
            return;
        }
        GameObject gameObject = ItemGenerator.CreateItemGameObject(data.StoryPrefabName);

        if (gameObject == null)
        {
            Debug.LogWarning("item not be found : " + data.StoryPrefabName);
            return;
        }
        gameObject.name = data.StoryPrefabName;
        Transform transform = TransformTool.SearchHierarchyForBone(base.gameObject.transform, text);

        if (transform == null)
        {
            Debug.LogWarning("node not be found : " + text);
            return;
        }
        gameObject.transform.position = transform.position;
        gameObject.transform.rotation = transform.rotation;
        gameObject.transform.parent   = transform;
    }
示例#3
0
        public void MoveInTopView()
        {
            var ctx = Context.Current;

            var body = TestGeomGenerator.CreateBody(Box.Create(10, 5, 2));

            ctx.ViewportController.SetPredefinedView(ViewportController.PredefinedViews.WorkingPlane);
            ctx.ViewportController.ZoomFitAll();

            var tool = new TransformTool(new[] { body }, TransformTool.PivotPoint.EntityPivot, TransformTool.Options.None);

            ctx.WorkspaceController.StartTool(tool);

            // X-Axis
            ctx.ViewportController.MouseMove(new Point(90, 363));
            ctx.ViewportController.MouseDown();
            ctx.ViewportController.MouseMove(new Point(100, 363));
            ctx.ViewportController.MouseUp(false);
            AssertHelper.IsSameViewport(Path.Combine(_BasePath, "MoveInTopView01"));

            // Y-Axis
            ctx.ViewportController.MouseMove(new Point(31, 300));
            ctx.ViewportController.MouseDown();
            ctx.ViewportController.MouseMove(new Point(31, 280));
            ctx.ViewportController.MouseUp(false);
            AssertHelper.IsSameViewport(Path.Combine(_BasePath, "MoveInTopView02"));

            // Z-Axis
            ctx.ViewportController.MouseMove(new Point(33, 343));
            ctx.ViewportController.MouseDown();
            ctx.ViewportController.MouseMove(new Point(50, 320));
            ctx.ViewportController.MouseUp(false);
            AssertHelper.IsSameViewport(Path.Combine(_BasePath, "MoveInTopView03"));
        }
 /**
  * Unregisters OnObjectsGrabbed and OnObjectsDropped event handlers.
  */
 private static void UnregisterObjectEventHandlers()
 {
     if (m_transformTool != null)
     {
         m_transformTool.objectsGrabbed -= OnObjectsGrabbed;
         m_transformTool.objectsDropped -= OnObjectsDropped;
         m_transformTool = null;
         m_grabbedObjects.Clear();
     }
 }
示例#5
0
 //public static bool FixedNextPos(VInt3 vStart, VInt3 vDir, int fSpeed)
 //{
 //    return Tool.GetCurrentScene().CanMoveTo(vStart, vDir, fSpeed);
 //}
 //public static VInt3 GetFixedNextResultPos()
 //{
 //    return Tool.GetCurrentScene().GetCanMoveToPos();
 //}
 //把屏幕坐标转换成 ugui 坐标
 public static Vector2 ScreenPointToUIPoint(RectTransform tran, Vector2 screenPoint, Camera cam)
 {
     if (TransformTool.ScreenPointToLocalPointInRectangle(tran, screenPoint, cam))
     {
         return(TransformTool.GetScreenPointToLocalPointInRectangleLocalPosition());
     }
     else
     {
         return(Vector2.zero);
     }
 }
示例#6
0
        public void Rendering()
        {
            var ctx = Context.Current;

            var body = TestGeomGenerator.CreateBody(Box.Create(10, 5, 2));

            ctx.ViewportController.ZoomFitAll();

            var tool = new TransformTool(new[] { body }, TransformTool.PivotPoint.EntityPivot, TransformTool.Options.None);

            ctx.WorkspaceController.StartTool(tool);

            Assert.Multiple(() =>
            {
                // Translate Idle
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingTranslateIdle"));

                // Translate Hilite X
                ctx.ViewportController.MouseMove(new Point(264, 188));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingTranslateHiliteX"));
                // Translate Hilite Y
                ctx.ViewportController.MouseMove(new Point(385, 187));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingTranslateHiliteY"));
                // Translate Hilite Z
                ctx.ViewportController.MouseMove(new Point(325, 84));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingTranslateHiliteZ"));

                // Translate Hilite XY
                ctx.ViewportController.MouseMove(new Point(326, 182));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingTranslateHiliteXY"));
                // Translate Hilite YZ
                ctx.ViewportController.MouseMove(new Point(350, 136));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingTranslateHiliteYZ"));
                // Translate Hilite XZ
                ctx.ViewportController.MouseMove(new Point(296, 136));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingTranslateHiliteXZ"));

                // Rotate Idle
                tool.ToggleTransformMode();
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingRotateIdle"));

                // Rotate Hilite Y
                ctx.ViewportController.MouseMove(new Point(324, 211));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingRotateHiliteY"));
                // Rotate Hilite P
                ctx.ViewportController.MouseMove(new Point(357, 62));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingRotateHiliteP"));
                // Rotate Hilite R
                ctx.ViewportController.MouseMove(new Point(293, 62));
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "RenderingRotateHiliteR"));
            });
        }
    public void Jump(bool superJump)
    {
        if (this.m_NoJump)
        {
            return;
        }
        bool flag = false;

        if (this.m_NavMeshAgent != null)
        {
            this.m_NavMeshAgent.enabled   = false;
            this.m_PlayerMotor.enabled    = true;
            this.m_PlayerMotor.m_NavAgent = false;
        }
        if (superJump)
        {
            this.m_PlayerMotor.jumpHeight = 5f;
            this.m_PlayerMotor.gravity    = 15f;
            GameObject gameObject = EffectGenerator.CreateEffectGameObject("ep02_jump_01");
            if (gameObject != null)
            {
                Transform transform = TransformTool.SearchHierarchyForBone(base.transform, "Bip001 Footsteps");
                if (transform != null)
                {
                    gameObject.transform.position = transform.position;
                    gameObject.transform.parent   = transform;
                }
                UnityEngine.Object.DestroyObject(gameObject, 3f);
            }
            this.m_JumpMotor.IsSuperJump = true;
            this.m_PlayerMotor.Jump();
            return;
        }
        bool flag2 = false;

        if (!this.m_LockControl && !this.m_EnterTalk && !flag)
        {
            flag2 = true;
        }
        if (GameInput.GetJoyKeyDown(JOYSTICK_KEY.Y))
        {
            flag2 = true;
        }
        if (flag2)
        {
            this.m_PlayerMotor.jumpHeight = this.m_JumpHeight;
            this.m_PlayerMotor.gravity    = this.m_JumpGravity;
            this.m_JumpMotor.IsSuperJump  = false;
            this.m_PlayerMotor.Jump();
        }
    }
 /**
  * Registers OnObjectsGrabbed and OnObjectsDropped event handlers.
  */
 private static void RegisterObjectEventHandlers()
 {
     m_transformTool = null;
     if (VRView.viewerCamera != null)
     {
         m_transformTool = VRView.viewerCamera.transform.root.gameObject.GetComponent <TransformTool>();
         if (m_transformTool == null)
         {
             return;
         }
         m_transformTool.objectsGrabbed += OnObjectsGrabbed;
         m_transformTool.objectsDropped += OnObjectsDropped;
     }
 }
示例#9
0
        public static Ray ScreenPointToRay(Vector3 screenpos)
        {
            Ray    hr  = new Ray();
            Camera cam = Camera.main;

            if (cam == null)
            {
                UnityEngine.Debug.LogWarning("当前没有激活的相机");
                return(hr);
            }
            else
            {
                hr = TransformTool.ScreenPointToRay(cam, screenpos);
            }
            return(hr);
        }
示例#10
0
        public override void Run(RenderControl render)
        {
            var box = ShapeBuilder.MakeBox(GP.XOY(), 10, 20, 30);

            render.ShowShape(box, Vector3.Green);

            var trans = TransformTool.Translate(box, new GVec(-20, 0, 0));

            render.ShowShape(trans, Vector3.Blue);

            var scale = TransformTool.Scale(box, GP.Origin(), 0.5);

            render.ShowShape(scale, Vector3.Blue);

            var rotate = TransformTool.Rotation(box, GP.OX(), 45);

            render.ShowShape(rotate, Vector3.Red);
        }
示例#11
0
        public void Rotate()
        {
            var ctx = Context.Current;

            var body = TestGeomGenerator.CreateBody(Box.Create(10, 5, 2));

            body.Position = new Pnt(3, 2, 1);
            var oldpos = body.Position;

            ctx.ViewportController.ZoomFitAll();

            var tool = new TransformTool(new[] { body }, TransformTool.PivotPoint.EntityPivot, TransformTool.Options.None);

            ctx.WorkspaceController.StartTool(tool);
            tool.ToggleTransformMode();

            Assert.Multiple(() =>
            {
                // X-Axis
                ctx.ViewportController.MouseMove(new Point(374, 123));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(390, 154));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos, body.Position);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Rotate01"));

                // Y-Axis
                ctx.ViewportController.MouseMove(new Point(310, 120));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(291, 143));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos, body.Position);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Rotate02"));

                // Z-Axis
                ctx.ViewportController.MouseMove(new Point(420, 178));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(411, 214));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos, body.Position);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Rotate03"));
            });
        }
示例#12
0
        private IEnumerator SearchPrefab(string prefabPath, List <PathData> results)
        {
            var go        = AssetDatabase.LoadAssetAtPath <GameObject>(prefabPath);
            var renderers = go.GetComponentsInChildren <ParticleSystemRenderer>();

            if (renderers.Length > 0)
            {
                PathData pathData = new PathData();

                foreach (var renderer in renderers)
                {
                    string rendererPath = TransformTool.GetPath(renderer.transform);
                    pathData.FilePath     = prefabPath;
                    pathData.RendererPath = rendererPath;
                    results.Add(pathData);
                }
            }
            yield return(null);
        }
示例#13
0
        private IEnumerator DoActionToScene(PathData pathData, Func <ParticleSystemRenderer, string> action)
        {
            var scenePath = pathData.FilePath;
            var scene     = SceneManager.GetSceneByPath(scenePath);

            if (!scene.IsValid() && AssetDatabase.LoadAssetAtPath <SceneAsset>(scenePath))
            {
                scene = EditorSceneManager.OpenScene(scenePath, OpenSceneMode.Additive);
            }

            if (!scene.IsValid())
            {
                Debug.Log($"Scene is not valid: {scenePath}");
                EditorSceneManager.CloseScene(scene, true);
            }

            var roots = scene.GetRootGameObjects();

            foreach (var go in roots)
            {
                var renderers = go.GetComponentsInChildren <ParticleSystemRenderer>(true);

                CheckMissingObject(go);

                foreach (var renderer in renderers)
                {
                    if (TransformTool.GetPath(renderer.transform) == pathData.RendererPath)
                    {
                        string error = action.Invoke(renderer);

                        if (!string.IsNullOrEmpty(error))
                        {
                            Debug.LogWarning($"Error: {error} at 【{scenePath}】{TransformTool.GetPath(renderer.transform)}");
                        }
                    }
                }
            }
            EditorSceneManager.SaveScene(scene);
            EditorSceneManager.CloseScene(scene, true);
            yield break;
        }
示例#14
0
        public static Vector3 ScreenToWorldPoint(float x, float y, float z_depth)
        {
            Vector3 worldPos = Vector3.zero;
            Vector3 v        = Vector3.zero;

            v.x = x;
            v.y = y;
            v.z = z_depth;
            Camera cam = Camera.main;

            if (cam != null)
            {
                worldPos = TransformTool.ScreenToWorldPoint(cam, v);
                return(worldPos);
            }
            else
            {
                UnityEngine.Debug.LogWarning("当前没有激活的相机");
                return(worldPos);
            }
        }
示例#15
0
        private IEnumerator SearchScene(string scenePath, List <PathData> results)
        {
            Scene scene = SceneManager.GetSceneByPath(scenePath);

            if (!scene.IsValid() && AssetDatabase.LoadAssetAtPath <SceneAsset>(scenePath))
            {
                scene = EditorSceneManager.OpenScene(scenePath, OpenSceneMode.Additive);
            }

            if (!scene.IsValid())
            {
                Debug.Log($"Scene is not valed: {scenePath}");
                EditorSceneManager.CloseScene(scene, true);
                yield break;
            }

            var roots     = scene.GetRootGameObjects();
            var renderers = new List <ParticleSystemRenderer>();

            foreach (var go in roots)
            {
                var temp = go.GetComponentsInChildren <ParticleSystemRenderer>();
                renderers.AddRange(temp);
            }

            if (renderers.Count > 0)
            {
                PathData pathData = new PathData();

                foreach (var renderer in renderers)
                {
                    string rendererPath = TransformTool.GetPath(renderer.transform);
                    pathData.FilePath     = scenePath;
                    pathData.RendererPath = rendererPath;
                    results.Add(pathData);
                }
            }
            EditorSceneManager.CloseScene(scene, true);
        }
示例#16
0
        private IEnumerator DoActionToPrefab(PathData pathData, Func <ParticleSystemRenderer, string> action)
        {
            var go        = AssetDatabase.LoadAssetAtPath <GameObject>(pathData.FilePath);
            var renderers = go.GetComponentsInChildren <ParticleSystemRenderer>(true);

            CheckMissingObject(go);

            foreach (var renderer in renderers)
            {
                if (TransformTool.GetPath(renderer.transform) == pathData.RendererPath)
                {
                    string error = action.Invoke(renderer);

                    if (!string.IsNullOrEmpty(error))
                    {
                        Debug.LogWarning($"Error: {error} at 【{pathData.FilePath}】{TransformTool.GetPath(renderer.transform)}");
                    }
                }
            }
            AssetDatabase.SaveAssets();
            yield break;
        }
示例#17
0
        private static int LogStep(ref Step[,] canvasMatrix, Step step, int curRow, int threadCol, int indentLevel, out string log, out string functions)
        {
            int nextRow = curRow;

            log       = "";
            functions = "";
            string indentString = new string(' ', indentLevel * 4);

            if (step.Description.Length > 0)
            {
                log = "\r\n\r\n" + indentString + "/*" + step.Description + "*/";// + ((log.Length > 0) ? ("\r\n" + log) : (""));
            }
            else
            {
                log = "";//"\r\n";// +log;
            }
            switch (step.ToolName)
            {
            case "NullTool":
            {
                log = "";
                return(nextRow);
            }

            case "NoOpTool":
            {
                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "// " + "/*" + step.StepName.Replace("_x0020_", "_") + "*/";
                }
                else
                {
                    log += "\r\n" + indentString + "/*NOP: " + step.StepName.Replace("_x0020_", "_") + "*/";
                }

                return(nextRow);
            }

            case "CaseTool":
            {
                int width  = step.StepWidth;
                int height = step.StepHeight;
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";
                string caselog;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                Step[,] caseMatrix = MatrixTransformations.ResizeArray <Step>(ref canvasMatrix, curRow, threadCol, Math.Min(curRow + height - 1, canvasMatrix.GetLength(0) - 1), canvasMatrix.GetLength(1) - 1);
                CaseTool.CaseToTxt(ref caseMatrix, 0, indentLevel + ((eh.Length > 0) ? 1 : 0), height, width, out caselog, out functions);
                nextRow = curRow + height;
                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "// " + caselog.Replace("\r\n", "\r\n// ");
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + caselog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + caselog;
                    }
                }
                return(nextRow);
            }

            case "VariableTool":
            {
                string varlog, varfunction;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                VariableTool.SetVariableToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out varlog, out varfunction);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + varlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + varlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + varlog;
                    }
                }

                if (varfunction.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + varfunction.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + varfunction;
                    }
                }

                return(nextRow);
            }

            case "PaWTestTool":
            case "MethodTool":
            case "TestTool":
            case "Mouse":
            case "Keyboard":
            case "Inspect":
            {
                string testlog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                TestTool.TestToTxt(step.StepXmlNode, indentLevel + ((eh.Length > 0) ? 1 : 0), out testlog, out dummy);

                if (step.ToolName == "TestTool" || step.ToolName == "PaWTestTool")
                {
                    XmlNode path = step.StepXmlNode.SelectSingleNode(".//*[@Key='ResourceFullName']");
                    if (path != null)
                    {
                        string p;
                        if (path.Attributes["Value"] != null)
                        {
                            p = path.Attributes["Value"].Value;
                        }
                        else
                        {
                            p = path.SelectSingleNode(".//*[@Key='Value']/@Value").Value;
                        }

                        log += "\r\n" + indentString + "/*" + "Path: " + p.Replace(".tsdrv", "") + " */";
                    }
                }

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + testlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + testlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + testlog;
                    }
                }

                return(nextRow);
            }

            case "AttributeTool":
            {
                string alog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                AttributeTool.AttributeToTxt(step.StepXmlNode, indentLevel + ((eh.Length > 0) ? 1 : 0), out alog, out dummy);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + alog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + alog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + alog;
                    }
                }

                return(nextRow);
            }

            case "CaptureImageTool":
            {
                string cilog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                CaptureImageTool.CaptureImageToTxt(step.StepXmlNode, indentLevel + ((eh.Length > 0) ? 1 : 0), out cilog, out dummy);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + cilog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + cilog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + cilog;
                    }
                }

                return(nextRow);
            }

            case "CriteriaTool":
            {
                string clog, cfunction;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                CriteriaTool.CriteriaToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out clog, out cfunction);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + clog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + clog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + clog;
                    }
                }

                if (cfunction.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + cfunction.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + cfunction;
                    }
                }

                return(nextRow);
            }

            case "ScripterTool":
            case "PaWScripterTool":
            {
                string slog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                ScripterTool.ScripterToTxt(step.StepXmlNode, indentLevel + ((eh.Length > 0) ? 1 : 0), out slog, out dummy);

                XmlNode path = step.StepXmlNode.SelectSingleNode(".//*[@Key='ResourceFullName']");
                if (path != null)
                {
                    string p;
                    if (path.Attributes["Value"] != null)
                    {
                        p = path.Attributes["Value"].Value;
                    }
                    else
                    {
                        p = path.SelectSingleNode(".//*[@Key='Value']/@Value").Value;
                    }

                    log += "\r\n" + indentString + "/* " + "Path: " + p.Replace(".tsscript", "") + " */";
                }

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + slog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + slog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + slog;
                    }
                }

                return(nextRow);
            }

            case "CommandTool":
            {
                string clog, cfunction;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                CommandTool.CommandToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out clog, out cfunction);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + clog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + clog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + clog;
                    }
                }

                if (cfunction.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + cfunction.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + cfunction;
                    }
                }

                return(nextRow);
            }

            case "TerminalCommandTool":
            {
                string clog, cfunction;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                TerminalCommandTool.CommandToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out clog, out cfunction);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + clog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + clog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + clog;
                    }
                }

                if (cfunction.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + cfunction.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + cfunction;
                    }
                }

                return(nextRow);
            }

            case "WriteTool":
            {
                string clog, cfunction;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                WriteTool.WriteToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out clog, out cfunction);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + clog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + clog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + clog;
                    }
                }

                if (cfunction.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + cfunction.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + cfunction;
                    }
                }

                return(nextRow);
            }

            case "ReadTool":
            {
                string clog, cfunction;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                ReadTool.ReadToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out clog, out cfunction);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + clog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + clog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + clog;
                    }
                }

                if (cfunction.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + cfunction.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + cfunction;
                    }
                }

                return(nextRow);
            }

            case "MessageTool":
            {
                string clog, cfunction;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                MessageTool.MessageToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out clog, out cfunction);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + clog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + clog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + clog;
                    }
                }

                if (cfunction.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + cfunction.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + cfunction;
                    }
                }

                return(nextRow);
            }

            case "TransformationTool":
            {
                string tlog, tfunctions;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                TransformTool.TransformToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out tlog, out tfunctions);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + tlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + tlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + tlog;
                    }
                }

                if (tfunctions.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + tfunctions.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + tfunctions;
                    }
                }

                return(nextRow);
            }

            case "SetSessionTool":
            {
                string sessionlog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                SetSessionTool.SessionToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out sessionlog, out dummy);
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + sessionlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + sessionlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + sessionlog;
                    }
                }

                return(nextRow);
            }

            case "DelayTool":
            {
                string dlog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                DelayTool.DelayToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out dlog, out dummy);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + dlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + dlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + dlog;
                    }
                }

                return(nextRow);
            }

            case "SetEventTool":
            {
                string dlog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                SetEventTool.SetEventToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out dlog, out dummy);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + dlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + dlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + dlog;
                    }
                }

                return(nextRow);
            }

            case "WaitForEventTool":
            {
                string dlog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                WaitForEventTool.WaitForEventToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out dlog, out dummy);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + dlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + dlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + dlog;
                    }
                }

                return(nextRow);
            }

            case "PassFailTool":
            {
                string dlog, dfunc;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                PassFailTool.PassFailToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out dlog, out dfunc);
                string tooltype = step.StepXmlNode.SelectSingleNode(".//*[@Key='NotificationType']/@Value").Value;
                string toolname = "PassFailTool";
                switch (tooltype)
                {
                case "0":
                    toolname = "Pass";
                    break;

                case "1":
                    toolname = "Fail";
                    break;

                case "2":
                    toolname = "Text To Report";
                    break;

                default:
                    break;
                }
                log += "\r\n" + indentString + "/*" + toolname + ": " + step.StepName + "*/";

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + dlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + dlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + dlog;
                    }
                }

                if (dfunc.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + dfunc.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + dfunc;
                    }
                }

                return(nextRow);
            }

            case "ErrorTool":
            {
                string dlog, dummy;
                ErrorTool.ErrorToTxt(step, indentLevel, out dlog, out dummy);
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "// throw" + step.StepName.Replace("_x0020_", "_") + dlog;
                }
                else
                {
                    log += "\r\n" + indentString + "throw " + step.StepName.Replace("_x0020_", "_") + dlog;
                }

                return(nextRow);
            }

            case "EndSessionTool":
            {
                string dlog, dummy;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                EndSessionTool.EndSessionToTxt(step, indentLevel + ((eh.Length > 0) ? 1 : 0), out dlog, out dummy);
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + dlog;
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + dlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + dlog;
                    }
                }

                return(nextRow);
            }

            case "EndTool":
            {
                string dlog, dummy;
                EndTool.EndToTxt(step, indentLevel, out dlog, out dummy);
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + dlog;
                }
                else
                {
                    log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + dlog;
                }

                return(nextRow);
            }

            case "CodeTool":
            {
                string dummy, codefunction;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                CodeTool.CodeToTxt(step, indentLevel + ((eh.Length > 0)?1:0), out dummy, out codefunction);

                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "//" + step.StepName.Replace("_x0020_", "_") + "()";
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + step.StepName.Replace("_x0020_", "_") + "()";
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + step.StepName.Replace("_x0020_", "_") + "()";
                    }
                }

                if (codefunction.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + codefunction.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + codefunction;
                    }
                }

                return(nextRow);
            }

            case "LoopTool":
            case "ParaLoopTool":
            {
                int width  = step.StepWidth;
                int height = step.StepHeight;
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";
                string looplog, loopfunctions;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                Step[,] loopMatrix = MatrixTransformations.ResizeArray <Step>(ref canvasMatrix, curRow, threadCol, Math.Min(curRow + height - 1, canvasMatrix.GetLength(0) - 1), canvasMatrix.GetLength(1) - 1);
                LoopTool.LoopToTxt(ref loopMatrix, 0, indentLevel + ((eh.Length > 0) ? 1 : 0), height, width, out looplog, out loopfunctions);

                nextRow = curRow + height;
                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "// " + looplog.Replace("\r\n", "\r\n// ");
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + looplog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + looplog;
                    }
                }

                if (loopfunctions.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + loopfunctions.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + loopfunctions;
                    }
                }

                return(nextRow);
            }

            case "WhileTool":
            {
                int width  = step.StepWidth;
                int height = step.StepHeight;
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";
                string wlog, wfunctions;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                Step[,] whileMatrix = MatrixTransformations.ResizeArray <Step>(ref canvasMatrix, curRow, threadCol, Math.Min(curRow + height - 1, canvasMatrix.GetLength(0) - 1), canvasMatrix.GetLength(1) - 1);
                WhileTool.WhileToTxt(ref whileMatrix, 0, indentLevel + ((eh.Length > 0) ? 1 : 0), height, width, out wlog, out wfunctions);

                nextRow = curRow + height;
                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "// " + wlog.Replace("\r\n", "\r\n// ");
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + wlog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + wlog;
                    }
                }

                if (wfunctions.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + wfunctions.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + wfunctions;
                    }
                }

                return(nextRow);
            }

            case "LockTool":
            {
                int width  = step.StepWidth;
                int height = step.StepHeight;
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";
                string llog, lfunctions;
                string eh = ErrorHandlingToTxt.Parse(step.StepXmlNode, indentLevel);
                Step[,] lockMatrix = MatrixTransformations.ResizeArray <Step>(ref canvasMatrix, curRow, threadCol, Math.Min(curRow + height - 1, canvasMatrix.GetLength(0) - 1), canvasMatrix.GetLength(1) - 1);
                LockTool.LockToTxt(ref lockMatrix, 0, indentLevel + ((eh.Length > 0) ? 1 : 0), height, width, out llog, out lfunctions);

                nextRow = curRow + height;
                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "// " + llog.Replace("\r\n", "\r\n// ");
                }
                else
                {
                    if (eh.Length > 0)
                    {
                        log += "\r\n" + indentString + "try" + "\r\n" + indentString + "{";
                        log += "\r\n" + indentString + "    " + llog;
                        log += "\r\n" + indentString + "}" + "\r\n" + eh;
                    }
                    else
                    {
                        log += "\r\n" + indentString + llog;
                    }
                }

                if (lfunctions.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + lfunctions.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + lfunctions;
                    }
                }

                return(nextRow);
            }

            case "ParallelTool":
            {
                int width  = step.StepWidth;
                int height = step.StepHeight;
                log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";
                string plog, pfunctions;
                Step[,] pMatrix = MatrixTransformations.ResizeArray <Step>(ref canvasMatrix, curRow, 0, Math.Min(curRow + height - 1, canvasMatrix.GetLength(0) - 1), canvasMatrix.GetLength(1) - 1);
                ParallelTool.ParallelToTxt(ref pMatrix, threadCol, indentLevel, height, width, out plog, out pfunctions);
                nextRow = curRow + height;
                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "// " + plog.Replace("\r\n", "\r\n// ");
                }
                else
                {
                    log += "\r\n" + indentString + plog;
                }

                if (pfunctions.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + pfunctions.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + pfunctions;
                    }
                }

                return(nextRow);
            }

            case "GroupTool":
            case "PaWDllTool":
            case "DllTool":
            case "CommandShellTool":
            case "SequenceTool":
            case "TerminalTool":
            case "WebServiceTool":
            case "NetworkClientTool":
            {
                string glog, gfunctions;
                if (step.ToolName == "DllTool" || step.ToolName == "PaWDllTool" || step.ToolName == "WebServiceTool")
                {
                    XmlNode path = step.StepXmlNode.SelectSingleNode(".//*[@Key='ResourceFullName']");
                    if (path != null)
                    {
                        string p;
                        if (path.Attributes["Value"] != null)
                        {
                            p = path.Attributes["Value"].Value;
                        }
                        else
                        {
                            p = path.SelectSingleNode(".//*[@Key='Value']/@Value").Value;
                        }

                        log += "\r\n" + indentString + "/*" + "Path: " + p.Replace(".tsdll", "") + " */";
                    }

                    log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";
                }
                else if (step.ToolName == "SequenceTool")
                {
                    XmlNode path = step.StepXmlNode.SelectSingleNode(".//*[@Key='LibraryFullName']");
                    if (path != null)
                    {
                        string p;
                        if (path.Attributes["Value"] != null)
                        {
                            p = path.Attributes["Value"].Value;
                        }
                        else
                        {
                            p = path.SelectSingleNode(".//*[@Key='Value']/@Value").Value;
                        }

                        log += "\r\n" + indentString + "/*" + "Path: " + p.Replace(".tslib", "") + " */";
                    }

                    log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";
                }
                else
                {
                    log += "\r\n" + indentString + "/*" + step.ToolName + ": " + step.StepName + "*/";
                }
                XmlNode groupSteps = step.StepXmlNode.SelectSingleNode(".//List[@Key='Steps']");
                XmlNode eh         = step.StepXmlNode.SelectSingleNode(".//ErrorHandlingBehavior");
                CanvasAnalyzer.StepsListToTxt(groupSteps.ChildNodes, true, indentLevel, eh, out glog, out gfunctions);
                if (step.Enabled == false)
                {
                    log += "\r\n" + indentString + "// " + glog.Replace("\r\n", "\r\n// ");
                }
                else
                {
                    log += "\r\n" + indentString + glog;
                }

                if (gfunctions.Length > 0)
                {
                    if (step.Enabled == false)
                    {
                        functions += "\r\n" + "// " + gfunctions.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        functions += "\r\n" + gfunctions;
                    }
                }

                return(nextRow);
            }

            case "AnalyzableCompositeTool":
            {
                string      aclog, acfunctions;
                XmlNodeList acTools = step.StepXmlNode.SelectNodes(".//Array[@Key='ChildTools']/*");
                foreach (XmlNode tool in acTools)
                {
                    Step curstep = new Step(tool);
                    curstep.Enabled = step.Enabled;
                    LogStep(ref canvasMatrix, curstep, curRow, threadCol, indentLevel, out aclog, out acfunctions);

                    if (step.Enabled == false)
                    {
                        log += "\r\n" + indentString + "// " + aclog.Replace("\r\n", "\r\n// ");
                    }
                    else
                    {
                        log += "\r\n" + indentString + aclog;
                    }

                    if (acfunctions.Length > 0)
                    {
                        if (step.Enabled == false)
                        {
                            functions += "\r\n" + "// " + acfunctions.Replace("\r\n", "\r\n// ");
                        }
                        else
                        {
                            functions += "\r\n" + acfunctions;
                        }
                    }
                }

                return(nextRow + acTools.Count - 1);
            }
            }

            if (step.Enabled == false)
            {
                log += "\r\n" + indentString + "//";
            }
            else
            {
                log += "\r\n" + indentString;
            }

            log += step.StepName.Replace("_x0020_", "_") + " // (" + step.ToolName + ")";

            return(nextRow);
        }
示例#18
0
 public static TransientCourseEditorState SelectTransformTool(this TransientCourseEditorState state,
                                                              TransformTool tool)
 {
     return(new TransientCourseEditorState(state.CourseName, state.HighlightedProp, tool));
 }
示例#19
0
 // Use this for initialization
 void Start()
 {
     editTracker   = EditTracker.Instance;
     transformTool = TransformTool.Instance;
 }
示例#20
0
 private void Awake()
 {
     rectTransform = GetComponent <RectTransform>();
     instance      = this;
 }
示例#21
0
        public void Move()
        {
            var ctx = Context.Current;

            var body = TestGeomGenerator.CreateBody(Box.Create(10, 5, 2));

            body.Position = new Pnt(3, 2, 1);
            ctx.ViewportController.ZoomFitAll();

            var tool = new TransformTool(new[] { body }, TransformTool.PivotPoint.EntityPivot, TransformTool.Options.None);

            ctx.WorkspaceController.StartTool(tool);

            Assert.Multiple(() =>
            {
                // X-Axis
                var oldpos = body.Position;
                ctx.ViewportController.MouseMove(new Point(267, 186));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(230, 215));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos.Y, body.Position.Y, Double.Epsilon);
                Assert.AreEqual(oldpos.Z, body.Position.Z, Double.Epsilon);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Move01"));

                // Y-Axis
                oldpos = body.Position;
                ctx.ViewportController.MouseMove(new Point(339, 212));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(357, 240));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos.X, body.Position.X, Double.Epsilon);
                Assert.AreEqual(oldpos.Z, body.Position.Z, Double.Epsilon);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Move02"));

                // Z-Axis
                oldpos = body.Position;
                ctx.ViewportController.MouseMove(new Point(314, 133));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(325, 119));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos.X, body.Position.X, Double.Epsilon);
                Assert.AreEqual(oldpos.Y, body.Position.Y, Double.Epsilon);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Move03"));

                // XY-Plane
                oldpos = body.Position;
                ctx.ViewportController.MouseMove(new Point(320, 216));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(293, 246));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos.Z, body.Position.Z, Double.Epsilon);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Move04"));

                // YZ-Plane
                oldpos = body.Position;
                ctx.ViewportController.MouseMove(new Point(315, 200));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(351, 183));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos.X, body.Position.X, Double.Epsilon);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Move05"));

                // XZ-Plane
                oldpos = body.Position;
                ctx.ViewportController.MouseMove(new Point(297, 175));
                ctx.ViewportController.MouseDown();
                ctx.ViewportController.MouseMove(new Point(269, 167));
                ctx.ViewportController.MouseUp(false);
                Assert.AreEqual(oldpos.Y, body.Position.Y, Double.Epsilon);
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "Move06"));
            });
        }
示例#22
0
        void CustumTransform(RenderControl mRenderView)
        {
            TopoShapeList topoShapes = new TopoShapeList();
            var           Line1      = SketchBuilder.MakeLine(new GPnt(-0.15, 0.4, 0), new GPnt(0.15, 0.4, 0));
            var           Line2      = SketchBuilder.MakeLine(new GPnt(0.15, 0.38, 0), new GPnt(0.0154999999999999, 0.379999999999998, 0));
            var           Line3      = SketchBuilder.MakeLine(new GPnt(-0.15, 0.38, 0), new GPnt(-0.0155000000000002, 0.380000000000002, 0));
            var           Line4      = SketchBuilder.MakeLine(new GPnt(-0.15, -0.38, 0), new GPnt(-0.0155000000000002, -0.380000000000005, 0));
            var           Line5      = SketchBuilder.MakeLine(new GPnt(0.15, -0.38, 0), new GPnt(0.0155, -0.380000000000002, 0));
            var           Line6      = SketchBuilder.MakeLine(new GPnt(-0.15, -0.4, 0), new GPnt(0.15, -0.4, 0));
            var           Line7      = SketchBuilder.MakeLine(new GPnt(-0.0075, 0.372, 0), new GPnt(-0.0075, -0.372, 0));
            var           Line8      = SketchBuilder.MakeLine(new GPnt(0.00749999999999999, 0.372, 0), new GPnt(0.00749999999999998, -0.372, 0));
            var           Line9      = SketchBuilder.MakeLine(new GPnt(-0.15, 0.4, 0), new GPnt(-0.15, 0.38, 0));
            var           Line10     = SketchBuilder.MakeLine(new GPnt(0.15, 0.4, 0), new GPnt(0.15, 0.38, 0));
            var           Line11     = SketchBuilder.MakeLine(new GPnt(-0.15, -0.4, 0), new GPnt(-0.15, -0.38, 0));
            var           Line12     = SketchBuilder.MakeLine(new GPnt(0.15, -0.4, 0), new GPnt(0.15, -0.38, 0));
            GCirc         Cir1       = new GCirc(new GAx2(new GPnt(-0.0155000000000001, 0.372, 0), new GDir(0, 0, 1)), 0.008);
            var           Arc1       = SketchBuilder.MakeArcOfCircle(Cir1, new GPnt(-0.00750000000000006, 0.372, 0), new GPnt(-0.0155000000000001, 0.38, 0));
            GCirc         Cir2       = new GCirc(new GAx2(new GPnt(0.0154999999999999, 0.372, 0), new GDir(0, 0, 1)), 0.008);
            var           Arc2       = SketchBuilder.MakeArcOfCircle(Cir2, new GPnt(0.0154999999999999, 0.38, 0), new GPnt(0.00749999999999993, 0.372, 0));
            GCirc         Cir3       = new GCirc(new GAx2(new GPnt(-0.0155000000000001, -0.372, 0), new GDir(0, 0, 1)), 0.008);
            var           Arc3       = SketchBuilder.MakeArcOfCircle(Cir3, new GPnt(-0.0155000000000001, -0.38, 0), new GPnt(-0.00750000000000006, -0.372, 0));
            GCirc         Cir4       = new GCirc(new GAx2(new GPnt(0.0154999999999999, -0.372, 0), new GDir(0, 0, 1)), 0.008);
            var           Arc4       = SketchBuilder.MakeArcOfCircle(Cir4, new GPnt(0.00749999999999993, -0.372, 0), new GPnt(0.0154999999999999, -0.38, 0));

            topoShapes.Add(Line1);
            topoShapes.Add(Line10);
            topoShapes.Add(Line2);
            topoShapes.Add(Arc2);
            topoShapes.Add(Line8);
            topoShapes.Add(Arc4);
            topoShapes.Add(Line5);
            topoShapes.Add(Line12);
            topoShapes.Add(Line6);
            topoShapes.Add(Line11);
            topoShapes.Add(Line4);
            topoShapes.Add(Arc3);
            topoShapes.Add(Line7);
            topoShapes.Add(Arc1);
            topoShapes.Add(Line3);
            topoShapes.Add(Line9);
            var Shape = ShapeBuilder.MakeCompound(topoShapes);

            Shape = SketchBuilder.MakeWire(topoShapes);
            var View = SketchBuilder.MakePlanarFace(Shape);

            var View1 = SketchBuilder.MakePlanarFace(Shape);

            View1 = TransformTool.Rotation(View1, new GAx1(new GPnt(0, 0, 0), new GDir(0, 1, 0)), Math.PI / 2);
            View1 = TransformTool.Rotation(View1, new GAx1(new GPnt(0, 0, 0), new GDir(1, 0, 0)), Math.PI / 2);
            mRenderView.ShowShape(View1, Vector3.Green);
            var widget = AxisWidget.Create(0.01f, 0.1f);

            mRenderView.ShowShape(View, Vector3.Red);
            GAx3  gAx31 = new GAx3(new GAx2(new GPnt(0, 0, 0), new GDir(0, 0, 1), new GDir(1, 0, 0)));
            GAx3  gAx32 = new GAx3(new GAx2(new GPnt(0, 0, 0), new GDir(1, 0, 0), new GDir(0, 1, 0)));
            var   dsad  = gAx32.Direction().XYZ().X();
            GTrsf gTrsf = new GTrsf();

            gTrsf.SetTransformation(gAx32, gAx31);
            View = TransformTool.Transform(View, gTrsf);

            mRenderView.ShowShape(View, Vector3.Blue);
        }
示例#23
0
 public TransientCourseEditorState(string courseName, Maybe <PropId> highlightedProp, TransformTool selectedTransformTool)
 {
     _courseName            = courseName;
     _highlightedProp       = highlightedProp;
     _selectedTransformTool = selectedTransformTool;
 }