QMsg CreatMsg(Model_E eventid, Model_E modleevent = Model_E.Begin, ModelTranslate_E modeltranslate = ModelTranslate_E.Begin, float valuedir = 0)
    {
        QMsg modelmsg = new ModelMsg()
        {
            EventID = (int)eventid, modelevent = modleevent, translateevent = modeltranslate, Changdir = valuedir
        };

        return(modelmsg);
    }
Example #2
0
    /// <summary>
    /// 根据发送来的消息回调刷新
    /// </summary>
    /// <param name="obj"></param>
    public override void HandlerEvent(QMsg obj)
    {
        ModelMsg mm = obj as ModelMsg;
        //主模型过程控制
        Model_E modelx = mm.modelevent;
        //modletranslate方式控制
        ModelTranslate_E mte = mm.translateevent;
        //传来的数据
        float value = mm.Changdir;

        //模型状态使用
        switch (modelx)
        {
        case Model_E.LoadModel:
            LoadModel(mm);
            break;

        case Model_E.Hidden:
            Hidden();
            break;

        case Model_E.Display:
            Display();
            break;

        case Model_E.SetCamera:
            selfcamera = mm.selfcamera;
            break;

        case Model_E.translate:
        case Model_E.Rotate:
        case Model_E.Scaler:
            modelcontrollmode = modelx;
            break;

        default:
            break;
        }

        //调整(位移旋转缩放)使用
        tranlatmode = mte;
        switch (mte)
        {
        case ModelTranslate_E.Up:
        case ModelTranslate_E.Down:
        case ModelTranslate_E.Left:
        case ModelTranslate_E.Right:
            TranslateCallback(mte);
            break;

        case ModelTranslate_E.Scaler:
        case ModelTranslate_E.ScalerX:
        case ModelTranslate_E.ScalerY:
        case ModelTranslate_E.ScalerZ:
            ScalerCallback(mte, value);
            break;

        case ModelTranslate_E.Rotate:
            RotateCallback(value);
            break;

        default:
            break;
        }

        //pointer使用
    }