public IList <MotionObject> EditObject(IList <MotionObjectInfo> targetInfoList, IList <ProcParam <MotionProcEnv> > args, ReadOnlyMotionFrame frame, bool previewMode)
        {
            List <MotionObject> ret = new List <MotionObject>();

            foreach (MotionObjectInfo info in targetInfoList)
            {
                MotionObject created = null;
                LineObject   line    = frame[info] as LineObject;
                if (line != null)
                {
                    created = new LineObject(line.Position, new Microsoft.DirectX.Vector3(line.Edge.X, 0, line.Edge.Z));
                }
                ret.Add(created);
            }
            return(ret);
        }
Exemplo n.º 2
0
 public IList <MotionObject> CreateObjects(IList <MotionObjectInfo> selectedInfoList, IList <ProcParam <MotionProcEnv> > args, ReadOnlyMotionFrame frame, bool previewMode)
 {
     return(_editOperation.EditObject(selectedInfoList, args, frame, previewMode));
 }
        public IList <MotionObject> EditObject(IList <MotionObjectInfo> targetInfoList, IList <ProcParam <MotionProcEnv> > args, ReadOnlyMotionFrame frame, bool previewMode)
        {
            SingleSelectParameter mode  = args[0] as SingleSelectParameter;
            NumberParameter       value = args[1] as NumberParameter;
            List <MotionObject>   ret   = new List <MotionObject>();

            foreach (MotionObjectInfo info in targetInfoList)
            {
                LineObject line = frame[info] as LineObject;
                if (line != null)
                {
                    float length = line.Edge.Length();
                    try {
                        switch (mode.Value)
                        {
                        case 0:
                            length *= (float)value.Value;
                            break;

                        case 1:
                            length = (float)value.Value;
                            break;

                        case 2:
                            length += (float)value.Value;
                            break;
                        }
                    } catch (ArithmeticException) { }
                    ret.Add(new LineObject(line.Position, line.Direction() * length));
                }
                else
                {
                    ret.Add(null);
                }
            }
            return(ret);
        }
        public IList <MotionObject> EditObject(IList <MotionObjectInfo> targetInfoList, IList <ProcParam <MotionProcEnv> > args, ReadOnlyMotionFrame frame, bool previewMode)
        {
            SingleSelectParameter modeRad   = args[0] as SingleSelectParameter;
            NumberParameter       valueRad  = args[1] as NumberParameter;
            SingleSelectParameter modeAxis  = args[2] as SingleSelectParameter;
            NumberParameter       valueAxis = args[3] as NumberParameter;
            List <MotionObject>   ret       = new List <MotionObject>();

            foreach (MotionObjectInfo info in targetInfoList)
            {
                CylinderObject cylinder = frame[info] as CylinderObject;
                if (cylinder != null)
                {
                    float radius = cylinder.Radius;
                    float axis   = cylinder.AxisLength();
                    try {
                        switch (modeRad.Value)
                        {
                        case 0:
                            radius *= (float)valueRad.Value;
                            break;

                        case 1:
                            radius = (float)valueRad.Value;
                            break;

                        case 2:
                            radius += (float)valueRad.Value;
                            break;
                        }
                    } catch (ArithmeticException) { }
                    try {
                        switch (modeAxis.Value)
                        {
                        case 0:
                            axis *= (float)valueAxis.Value;
                            break;

                        case 1:
                            axis = (float)valueAxis.Value;
                            break;

                        case 2:
                            axis += (float)valueAxis.Value;
                            break;
                        }
                    } catch (ArithmeticException) { }
                    ret.Add(new CylinderObject(cylinder.Position, cylinder.AxisDirection() * axis, radius));
                }
                else
                {
                    ret.Add(null);
                }
            }
            return(ret);
        }
        public IList <MotionObject> EditObject(IList <MotionObjectInfo> targetInfoList, IList <ProcParam <MotionProcEnv> > args, ReadOnlyMotionFrame frame, bool previewMode)
        {
            SingleSelectParameter mode  = args[0] as SingleSelectParameter;
            NumberParameter       value = args[1] as NumberParameter;
            List <MotionObject>   ret   = new List <MotionObject>();

            foreach (MotionObjectInfo info in targetInfoList)
            {
                SphereObject sphere = frame[info] as SphereObject;
                if (sphere != null)
                {
                    float radius = sphere.Radius;
                    try {
                        switch (mode.Value)
                        {
                        case 0:
                            radius *= (float)value.Value;
                            break;

                        case 1:
                            radius = (float)value.Value;
                            break;

                        case 2:
                            radius += (float)value.Value;
                            break;
                        }
                    } catch (ArithmeticException) { }
                    ret.Add(new SphereObject(sphere.Position, radius));
                }
                else
                {
                    ret.Add(null);
                }
            }
            return(ret);
        }
        public IList <MotionObject> EditObject(IList <MotionObjectInfo> targetInfoList, IList <ProcParam <MotionProcEnv> > args, ReadOnlyMotionFrame frame, bool previewMode)
        {
            NumberParameter     x   = args[0] as NumberParameter;
            NumberParameter     y   = args[1] as NumberParameter;
            NumberParameter     z   = args[2] as NumberParameter;
            List <MotionObject> ret = new List <MotionObject>();

            foreach (MotionObjectInfo info in targetInfoList)
            {
                MotionObject obj = frame[info];
                if (obj == null)
                {
                    ret.Add(null);
                }
                else
                {
                    ret.Add(obj.CloneOffsetObject(new Microsoft.DirectX.Vector3((float)x.Value, (float)y.Value, (float)z.Value)));
                }
            }
            return(ret);
        }
        public IList <MotionObject> EditObject(IList <MotionObjectInfo> targetInfoList, IList <ProcParam <MotionProcEnv> > args, ReadOnlyMotionFrame frame, bool previewMode)
        {
            SingleSelectParameter mode = args[0] as SingleSelectParameter;
            List <MotionObject>   ret  = new List <MotionObject>();

            foreach (MotionObjectInfo info in targetInfoList)
            {
                LineObject line = frame[info] as LineObject;
                if (line != null)
                {
                    switch (mode.Value)
                    {
                    case 0:
                        ret.Add(new LineObject(line.Position + line.Edge, -line.Edge));
                        break;

                    case 1:
                        ret.Add(new LineObject(line.Position, -line.Edge));
                        break;

                    default:
                        ret.Add((LineObject)line.Clone());
                        break;
                    }
                }
                else
                {
                    ret.Add(null);
                }
            }
            return(ret);
        }