Esempio n. 1
0
//---------------------------------------------------------
void CVIEW_Map_3D::_Play_Pos_Edit(void)
{
	if( m_Play_Mode == PLAY_MODE_NONE )
	{
		DLG_Table(LNG("[CAP] 3D-View: Player Sequence"), &m_Play);
	}
}
//---------------------------------------------------------
void CVIEW_Map_3D::On_Command(wxCommandEvent &event)
{
    switch( event.GetId() )
    {
    default:
        return;

    //-----------------------------------------------------
    case ID_CMD_MAP3D_PARAMETERS:
    {
        Parameters_Update(true);

        if( DLG_Parameters(&m_Parameters) )
        {
            Parameters_Update(false);
        }
    }
    return;

    //-----------------------------------------------------
    case ID_CMD_MAP3D_SAVE:
    {
        int				FileType;
        wxString		FileName;
        CSG_Parameters	P(NULL, _TL("Image Resolution"), _TL(""));

        P.Add_Value(NULL, "NX", _TL("Width" ), _TL(""), PARAMETER_TYPE_Int, m_pPanel->GetSize().x, 1, true);
        P.Add_Value(NULL, "NY", _TL("Height"), _TL(""), PARAMETER_TYPE_Int, m_pPanel->GetSize().y, 1, true);

        if( DLG_Image_Save(FileName, FileType) && DLG_Parameters(&P) )
        {
            Set_Buisy_Cursor(true);

            if( P("NX")->asInt() == m_pPanel->GetSize().x
                    &&  P("NY")->asInt() == m_pPanel->GetSize().y )
            {
                m_pPanel->Save_asImage(&FileName);
            }
            else
            {
                wxSize	Size(m_pPanel->GetSize());

                Freeze();
                m_pPanel->SetSize(P("NX")->asInt(), P("NY")->asInt());
                m_pPanel->Save_asImage(&FileName);
                m_pPanel->SetSize(Size);
                Thaw();
            }

            Set_Buisy_Cursor(false);
        }
    }
    return;

    //-----------------------------------------------------
    case ID_CMD_MAP3D_SEQ_POS_EDIT:
    {
        DLG_Table(_TL("Edit 3D-View Sequencer Positions"), m_pPanel->m_Parameters("PLAY")->asTable());
    }
    return;

    //-----------------------------------------------------
    case ID_CMD_MAP3D_SEQ_POS_ADD    :
        m_pPanel->Play_Pos_Add();
        return;
    case ID_CMD_MAP3D_SEQ_POS_DEL    :
        m_pPanel->Play_Pos_Del();
        return;
    case ID_CMD_MAP3D_SEQ_POS_DEL_ALL:
        m_pPanel->Play_Pos_Clr();
        return;
    case ID_CMD_MAP3D_SEQ_PLAY       :
        m_pPanel->Play_Once   ();
        return;
    case ID_CMD_MAP3D_SEQ_PLAY_LOOP  :
        m_pPanel->Play_Loop   ();
        return;
    case ID_CMD_MAP3D_SEQ_SAVE       :
    {
        int			Type;
        wxString	File;

        if( DLG_Image_Save(File, Type) )
        {
            m_pPanel->m_Parameters("PLAY_FILE")->Set_Value(File.wc_str());
            m_pPanel->Play_Save();
        }
    }
    return;

    //-----------------------------------------------------
    case ID_CMD_MAP3D_ROTATE_X_LESS  :
        m_pPanel->Get_Projector().Set_xRotation(m_pPanel->Get_Projector().Get_xRotation() + 4.0 * M_DEG_TO_RAD);
        break;
    case ID_CMD_MAP3D_ROTATE_X_MORE  :
        m_pPanel->Get_Projector().Set_xRotation(m_pPanel->Get_Projector().Get_xRotation() - 4.0 * M_DEG_TO_RAD);
        break;
    case ID_CMD_MAP3D_ROTATE_Y_LESS  :
        m_pPanel->Get_Projector().Set_yRotation(m_pPanel->Get_Projector().Get_yRotation() + 4.0 * M_DEG_TO_RAD);
        break;
    case ID_CMD_MAP3D_ROTATE_Y_MORE  :
        m_pPanel->Get_Projector().Set_yRotation(m_pPanel->Get_Projector().Get_yRotation() - 4.0 * M_DEG_TO_RAD);
        break;
    case ID_CMD_MAP3D_ROTATE_Z_LESS  :
        m_pPanel->Get_Projector().Set_zRotation(m_pPanel->Get_Projector().Get_zRotation() + 4.0 * M_DEG_TO_RAD);
        break;
    case ID_CMD_MAP3D_ROTATE_Z_MORE  :
        m_pPanel->Get_Projector().Set_zRotation(m_pPanel->Get_Projector().Get_zRotation() - 4.0 * M_DEG_TO_RAD);
        break;

    case ID_CMD_MAP3D_SHIFT_X_LESS   :
        m_pPanel->Get_Projector().Set_xShift(m_pPanel->Get_Projector().Get_xShift() - 10.0);
        break;
    case ID_CMD_MAP3D_SHIFT_X_MORE   :
        m_pPanel->Get_Projector().Set_xShift(m_pPanel->Get_Projector().Get_xShift() + 10.0);
        break;
    case ID_CMD_MAP3D_SHIFT_Y_LESS   :
        m_pPanel->Get_Projector().Set_yShift(m_pPanel->Get_Projector().Get_yShift() + 10.0);
        break;
    case ID_CMD_MAP3D_SHIFT_Y_MORE   :
        m_pPanel->Get_Projector().Set_yShift(m_pPanel->Get_Projector().Get_yShift() - 10.0);
        break;
    case ID_CMD_MAP3D_SHIFT_Z_LESS   :
        m_pPanel->Get_Projector().Set_zShift(m_pPanel->Get_Projector().Get_zShift() - 10.0);
        break;
    case ID_CMD_MAP3D_SHIFT_Z_MORE   :
        m_pPanel->Get_Projector().Set_zShift(m_pPanel->Get_Projector().Get_zShift() + 10.0);
        break;

//	case ID_CMD_MAP3D_DRAW_BOX       :	m_pPanel->m_Parameters("DRAW_BOX"    )->Set_Value(m_pPanel->m_Parameters("DRAW_BOX"    )->asBool() ==  true    );	break;
    case ID_CMD_MAP3D_STEREO         :
        m_pPanel->m_Parameters("STEREO"      )->Set_Value(m_pPanel->m_Parameters("STEREO"      )->asBool() == false    );
        break;
    case ID_CMD_MAP3D_STEREO_LESS    :
        m_pPanel->m_Parameters("STEREO_DIST" )->Set_Value(m_pPanel->m_Parameters("STEREO_DIST" )->asDouble() - 2       );
        break;
    case ID_CMD_MAP3D_STEREO_MORE    :
        m_pPanel->m_Parameters("STEREO_DIST" )->Set_Value(m_pPanel->m_Parameters("STEREO_DIST" )->asDouble() + 2       );
        break;
    case ID_CMD_MAP3D_CENTRAL        :
        m_pPanel->m_Parameters("CENTRAL"     )->Set_Value(m_pPanel->m_Parameters("CENTRAL"     )->asBool() == false    );
        break;
    case ID_CMD_MAP3D_CENTRAL_LESS   :
        m_pPanel->m_Parameters("CENTRAL_DIST")->Set_Value(m_pPanel->m_Parameters("CENTRAL_DIST")->asDouble() - 50      );
        break;
    case ID_CMD_MAP3D_CENTRAL_MORE   :
        m_pPanel->m_Parameters("CENTRAL_DIST")->Set_Value(m_pPanel->m_Parameters("CENTRAL_DIST")->asDouble() + 50      );
        break;
    case ID_CMD_MAP3D_INTERPOLATED   :
        m_pPanel->m_Parameters("DRAPE_MODE"  )->Set_Value(m_pPanel->m_Parameters("DRAPE_MODE"  )->asInt() == 0 ? 1 : 0 );
        break;

    case ID_CMD_MAP3D_EXAGGERATE_LESS:
        m_pPanel->m_zScale	-= 0.5;
        break;
    case ID_CMD_MAP3D_EXAGGERATE_MORE:
        m_pPanel->m_zScale	+= 0.5;
        break;

//	case ID_CMD_MAP3D_SRC_RES_LESS   :	m_pPanel->;	break;
//	case ID_CMD_MAP3D_SRC_RES_MORE   :	m_pPanel->;	break;
    }

    Parameters_Update(true);
    m_pPanel->Update_View();
}