Example #1
0
        private void AddHandles(Vector3 offset)
        {
            Handles = new CurveHandle[Curve.Count];
            //double r = 4.0;
            for (int i = 0; i < Curve.Count; ++i)
            {
                //double rel = (double)(i) / (double)(curve.Count - 1);
                //double theta = rel * 2.0 * Math.PI;
                Handles[i]       = new CurveHandle();
                Handles[i].model = new Model(
                    "controlHandle" + i.ToString(),
                    tool.HandleMesh,
                    tool.HandleMaterial
                    );
                tool.HandleGroup.Add(Handles[i].model);
                Handles[i].Position = Curve[i].Position;
#if false
                handles[i].Position = new Vector3(
                    r * Math.Cos(theta),
                    rel,
                    r * Math.Sin(theta)
                    ) + offset;
#endif
            }
        }
Example #2
0
        public void MouseClick(Model hoverModel)
        {
            //  Skip update if our old handle is still selected
            if (
                (modifyHandle != null) &&
                (modifyHandle.model != null) &&
                (modifyHandle.model.Selected == true)
                )
            {
                return;
            }
            CurveHandle handle = null;

            foreach (var segment in segments)
            {
                handle = segment.Handle(hoverModel);
                if (handle != null)
                {
                    break;
                }
            }

            modifyHandle = handle;

            if (handle == null)
            {
                return;
            }

            TCB[0] = modifyHandle.Parameters[0];
            TCB[1] = modifyHandle.Parameters[1];
            TCB[2] = modifyHandle.Parameters[2];

#if false // TODO
            if (selectionManager.HoverModel == TubeModel)
            {
                //  Move EditT to new position
                bool locked = LockEditHandle;
                LockEditHandle = false;
                EditT          = MouseT;
                selectionManager.ClearSelection();
                selectionManager.Add(EditHandle);
                Update();
                LockEditHandle = locked;
            }
#endif
        }