Changeset 407 for cafu/trunk

Show
Ignore:
Timestamp:
10/12/11 10:42:16 (7 months ago)
Author:
Carsten
Message:

Model Editor:
Added an info pane about the level-of-detail models used with the current model.

Location:
cafu/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/CaWE/ModelEditor/ChildFrame.cpp

    r400 r407  
    100100      m_ScenePropGrid(NULL), 
    101101      m_SubmodelsPanel(NULL), 
     102      m_DlodModelsList(NULL), 
    102103      m_TransformDialog(NULL) 
    103104{ 
     
    156157    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_SCENE_SETUP,          "Scene Setup",           "Show or hide the scene setup inspector"); 
    157158    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_SUBMODELS_LIST,       "Submodels List",        "Show or hide the submodels list"); 
     159    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_DLOD_MODELS_LIST,     "LoD Models",            "Show or hide the list of models for reduced levels of detail"); 
    158160    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_TRANSFORM_DIALOG,     "Transform Dialog",      "Show or hide the model transform dialog"); 
    159161    ViewMenu->AppendSeparator(); 
     
    272274                         Name("SubmodelsPanel").Caption("Submodels"). 
    273275                         Right().Position(5)); 
     276 
     277    m_DlodModelsList=new wxStaticText(this, wxID_ANY, GetLodModelsString(), wxDefaultPosition, wxSize(260, 180), wxST_ELLIPSIZE_START); 
     278    m_AUIManager.AddPane(m_DlodModelsList, wxAuiPaneInfo(). 
     279                         Name("DlodModelsList").Caption("Level-of-Detail Models"). 
     280                         Right().Position(6)); 
    274281 
    275282    m_TransformDialog=new TransformDialogT(this, wxSize(248, 240)); 
     
    771778 
    772779 
     780wxString ModelEditor::ChildFrameT::GetLodModelsString() const 
     781{ 
     782    wxString s; 
     783 
     784    for (const CafuModelT* Model=m_ModelDoc->GetModel(); Model; Model=Model->GetDlodModel()) 
     785    { 
     786        wxFileName fn(Model->GetFileName()); 
     787 
     788        fn.MakeRelativeTo(m_ModelDoc->GetGameConfig()->ModDir); 
     789        s+=fn.GetFullPath(wxPATH_UNIX); 
     790 
     791        if (Model->GetDlodModel()) 
     792            s+=wxString::Format(" (%.2f)\n", Model->GetDlodDist()); 
     793        else 
     794            s+=" (inf)"; 
     795    } 
     796 
     797    return s; 
     798} 
     799 
     800 
    773801void ModelEditor::ChildFrameT::OnMenuView(wxCommandEvent& CE) 
    774802{ 
     
    790818        case ID_MENU_VIEW_AUIPANE_SCENE_SETUP:          PaneToggleShow(m_AUIManager.GetPane(m_ScenePropGrid      )); break; 
    791819        case ID_MENU_VIEW_AUIPANE_SUBMODELS_LIST:       PaneToggleShow(m_AUIManager.GetPane(m_SubmodelsPanel     )); break; 
     820        case ID_MENU_VIEW_AUIPANE_DLOD_MODELS_LIST:     PaneToggleShow(m_AUIManager.GetPane(m_DlodModelsList     )); break; 
    792821        case ID_MENU_VIEW_AUIPANE_TRANSFORM_DIALOG:     PaneToggleShow(m_AUIManager.GetPane(m_TransformDialog    )); break; 
    793822 
     
    826855        case ID_MENU_VIEW_AUIPANE_SCENE_SETUP:          UE.Check(m_AUIManager.GetPane(m_ScenePropGrid      ).IsShown()); break; 
    827856        case ID_MENU_VIEW_AUIPANE_SUBMODELS_LIST:       UE.Check(m_AUIManager.GetPane(m_SubmodelsPanel     ).IsShown()); break; 
     857        case ID_MENU_VIEW_AUIPANE_DLOD_MODELS_LIST:     UE.Check(m_AUIManager.GetPane(m_DlodModelsList     ).IsShown()); break; 
    828858        case ID_MENU_VIEW_AUIPANE_TRANSFORM_DIALOG:     UE.Check(m_AUIManager.GetPane(m_TransformDialog    ).IsShown()); break; 
    829859    } 
  • cafu/trunk/CaWE/ModelEditor/ChildFrame.hpp

    r396 r407  
    103103        void PaneToggleShow(wxAuiPaneInfo& PaneInfo); 
    104104 
     105        /// Returns a string with all the LoD models loaded with the main model. 
     106        wxString GetLodModelsString() const; 
     107 
    105108        wxString           m_FileName; 
    106109        ModelDocumentT*    m_ModelDoc; 
     
    130133        ScenePropGridT*    m_ScenePropGrid; 
    131134        SubmodelsPanelT*   m_SubmodelsPanel; 
     135        wxStaticText*      m_DlodModelsList; 
    132136        TransformDialogT*  m_TransformDialog; 
    133137 
     
    154158            ID_MENU_VIEW_AUIPANE_SCENE_SETUP, 
    155159            ID_MENU_VIEW_AUIPANE_SUBMODELS_LIST, 
     160            ID_MENU_VIEW_AUIPANE_DLOD_MODELS_LIST, 
    156161            ID_MENU_VIEW_AUIPANE_TRANSFORM_DIALOG, 
    157162            ID_MENU_VIEW_LOAD_DEFAULT_PERSPECTIVE, 
  • cafu/trunk/Libs/Models/Model_cmdl.hpp

    r406 r407  
    321321    BoundingBox3fT       m_BindPoseBB;              ///< [REMOVE???] The bounding-box for the base pose of the model. 
    322322 
    323     CafuModelT*          m_DlodModel;               ///< Use the m_DlodModel instead of this when the camera is more that m_DlodDist away. 
     323    CafuModelT*          m_DlodModel;               ///< Use the m_DlodModel instead of this when the camera is more than m_DlodDist away. 
    324324    float                m_DlodDist;                ///< The distance beyond which the m_DlodModel is used instead of this. 
    325325