Changeset 394 for cafu/trunk

Show
Ignore:
Timestamp:
09/26/11 13:37:46 (8 months ago)
Author:
Carsten
Message:

Model Editor: Added support for animation channels.

Location:
cafu/trunk
Files:
4 added
15 modified

Legend:

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

    r393 r394  
    2222#include "ChildFrame.hpp" 
    2323#include "AnimInspector.hpp" 
     24#include "ChannelInspector.hpp" 
    2425#include "ElementsList.hpp" 
    2526#include "GlobalsInspector.hpp" 
     
    8990      m_AnimsList(NULL), 
    9091      m_AnimInspector(NULL), 
     92      m_ChannelsList(NULL), 
     93      m_ChannelInspector(NULL), 
    9194      m_SkinsList(NULL), 
     95   // m_SkinInspector(NULL), 
    9296      m_GuiFixturesList(NULL), 
    9397      m_GuiFixtureInspector(NULL), 
     
    143147    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_ANIMS_LIST,           "Animations List",       "Show or hide the animations list"); 
    144148    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_ANIM_INSPECTOR,       "Animation Inspector",   "Show or hide the animation inspector"); 
     149    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_CHANNELS_LIST,        "Channels List",         "Show or hide the animation channels list"); 
     150    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_CHANNEL_INSPECTOR,    "Channel Inspector",     "Show or hide the animation channel inspector"); 
    145151    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_GUIFIXTURES_LIST,     "GUI Fixtures List",     "Show or hide the GUI fixtures list"); 
    146152    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_GUIFIXTURE_INSPECTOR, "GUI Fixture Inspector", "Show or hide the GUI fixture inspector"); 
    147153    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_SKINS_LIST,           "Skins List",            "Show or hide the skins list"); 
     154 // ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_SKIN_INSPECTOR,       "Skin Inspector",        "Show or hide the skin inspector"); 
    148155    ViewMenu->AppendSeparator(); 
    149156    ViewMenu->AppendCheckItem(ID_MENU_VIEW_AUIPANE_SCENE_SETUP,          "Scene Setup",           "Show or hide the scene setup inspector"); 
     
    162169    ModelMenu->Append(ID_MENU_MODEL_TRANSFORM, "&Transform...\tCtrl+T", "Transform the model"); 
    163170    ModelMenu->Append(ID_MENU_MODEL_GUIFIXTURE_ADD, "Add GUI fixture", "Adds a new GUI fixture to the model"); 
     171 // ModelMenu->Append(ID_MENU_MODEL_SKIN_ADD, "Add skin", "Adds a new skin to the model"); 
     172 // ModelMenu->Append(ID_MENU_MODEL_CHANNEL_ADD, "Add channel", "Adds a new animation channel to the model"); 
    164173    ModelMenu->Append(-1, "Run benchmark", "Move the camera along a predefined path and determine the time taken")->Enable(false); 
    165174    ModelMenu->AppendSeparator(); 
     
    224233                         Float().Hide()); 
    225234 
     235    m_ChannelsList=new ElementsPanelT(this, wxSize(230, 150), CHAN); 
     236    m_AUIManager.AddPane(m_ChannelsList, wxAuiPaneInfo(). 
     237                         Name("ChannelsList").Caption("Channels List"). 
     238                         Left().Position(7)); 
     239 
     240    m_ChannelInspector=new ChannelInspectorT(this, wxSize(260, 320)); 
     241    m_AUIManager.AddPane(m_ChannelInspector, wxAuiPaneInfo(). 
     242                         Name("ChannelInspector").Caption("Channel Inspector"). 
     243                         Float().Hide()); 
     244 
    226245    m_GuiFixturesList=new ElementsPanelT(this, wxSize(230, 150), GFIX); 
    227246    m_AUIManager.AddPane(m_GuiFixturesList, wxAuiPaneInfo(). 
    228247                         Name("GuiFixturesList").Caption("Gui Fixtures List"). 
    229                          Left().Position(7)); 
     248                         Left().Position(9)); 
    230249 
    231250    m_GuiFixtureInspector=new GuiFixInspectorT(this, wxSize(260, 320)); 
     
    282301    AnimToolbar->AddTool(ID_MENU_MODEL_TRANSFORM,      "Transform",       wxArtProvider::GetBitmap("transform-rotate-right", wxART_TOOLBAR), "Transform model"); 
    283302    AnimToolbar->AddTool(ID_MENU_MODEL_GUIFIXTURE_ADD, "Add GUI fixture", wxArtProvider::GetBitmap("window-new", wxART_TOOLBAR), "Add GUI fixture"); 
     303 // AnimToolbar->AddTool(ID_MENU_MODEL_SKIN_ADD,       "Add skin",        wxArtProvider::GetBitmap("window-new", wxART_TOOLBAR), "Add skin"); 
     304 // AnimToolbar->AddTool(ID_MENU_MODEL_CHANNEL_ADD,    "Add channel",     wxArtProvider::GetBitmap("window-new", wxART_TOOLBAR), "Add channel"); 
    284305    AnimToolbar->Realize(); 
    285306 
     
    578599    else if (List==m_MeshesList)      Insp=m_MeshInspector; 
    579600    else if (List==m_AnimsList)       Insp=m_AnimInspector; 
     601    else if (List==m_ChannelsList)    Insp=m_ChannelInspector; 
    580602    else if (List==m_GuiFixturesList) Insp=m_GuiFixtureInspector; 
    581603 
     
    722744        case ID_MENU_VIEW_AUIPANE_ANIMS_LIST:           PaneToggleShow(m_AUIManager.GetPane(m_AnimsList          )); break; 
    723745        case ID_MENU_VIEW_AUIPANE_ANIM_INSPECTOR:       PaneToggleShow(m_AUIManager.GetPane(m_AnimInspector      )); break; 
     746        case ID_MENU_VIEW_AUIPANE_CHANNELS_LIST:        PaneToggleShow(m_AUIManager.GetPane(m_ChannelsList       )); break; 
     747        case ID_MENU_VIEW_AUIPANE_CHANNEL_INSPECTOR:    PaneToggleShow(m_AUIManager.GetPane(m_ChannelInspector   )); break; 
    724748        case ID_MENU_VIEW_AUIPANE_SKINS_LIST:           PaneToggleShow(m_AUIManager.GetPane(m_SkinsList          )); break; 
     749     // case ID_MENU_VIEW_AUIPANE_SKINS_INSPECTOR:      PaneToggleShow(m_AUIManager.GetPane(m_SkinsInspector     )); break; 
    725750        case ID_MENU_VIEW_AUIPANE_GUIFIXTURES_LIST:     PaneToggleShow(m_AUIManager.GetPane(m_GuiFixturesList    )); break; 
    726751        case ID_MENU_VIEW_AUIPANE_GUIFIXTURE_INSPECTOR: PaneToggleShow(m_AUIManager.GetPane(m_GuiFixtureInspector)); break; 
     
    755780        case ID_MENU_VIEW_AUIPANE_ANIMS_LIST:           UE.Check(m_AUIManager.GetPane(m_AnimsList          ).IsShown()); break; 
    756781        case ID_MENU_VIEW_AUIPANE_ANIM_INSPECTOR:       UE.Check(m_AUIManager.GetPane(m_AnimInspector      ).IsShown()); break; 
     782        case ID_MENU_VIEW_AUIPANE_CHANNELS_LIST:        UE.Check(m_AUIManager.GetPane(m_ChannelsList       ).IsShown()); break; 
     783        case ID_MENU_VIEW_AUIPANE_CHANNEL_INSPECTOR:    UE.Check(m_AUIManager.GetPane(m_ChannelInspector   ).IsShown()); break; 
    757784        case ID_MENU_VIEW_AUIPANE_SKINS_LIST:           UE.Check(m_AUIManager.GetPane(m_SkinsList          ).IsShown()); break; 
     785     // case ID_MENU_VIEW_AUIPANE_SKIN_INSPECTOR:       UE.Check(m_AUIManager.GetPane(m_SkinInspector      ).IsShown()); break; 
    758786        case ID_MENU_VIEW_AUIPANE_GUIFIXTURES_LIST:     UE.Check(m_AUIManager.GetPane(m_GuiFixturesList    ).IsShown()); break; 
    759787        case ID_MENU_VIEW_AUIPANE_GUIFIXTURE_INSPECTOR: UE.Check(m_AUIManager.GetPane(m_GuiFixtureInspector).IsShown()); break; 
     
    822850            break; 
    823851        } 
     852 
     853        // case ID_MENU_MODEL_SKIN_ADD: 
     854        // { 
     855        //     break; 
     856        // } 
     857 
     858        // case ID_MENU_MODEL_CHANNEL_ADD: 
     859        // { 
     860        //     break; 
     861        // } 
    824862 
    825863        case ID_MENU_MODEL_LOAD_SUBMODEL: 
  • cafu/trunk/CaWE/ModelEditor/ChildFrame.hpp

    r393 r394  
    3535{ 
    3636    class AnimInspectorT; 
     37    class ChannelInspectorT; 
    3738    class ElementsPanelT; 
    3839    class GlobalsInspectorT; 
     
    109110        ElementsPanelT*    m_AnimsList; 
    110111        AnimInspectorT*    m_AnimInspector; 
     112        ElementsPanelT*    m_ChannelsList; 
     113        ChannelInspectorT* m_ChannelInspector; 
    111114        ElementsPanelT*    m_SkinsList; 
     115     // SkinInspectorT*    m_SkinInspector; 
    112116        ElementsPanelT*    m_GuiFixturesList; 
    113117        GuiFixInspectorT*  m_GuiFixtureInspector; 
     
    133137            ID_MENU_VIEW_AUIPANE_ANIMS_LIST, 
    134138            ID_MENU_VIEW_AUIPANE_ANIM_INSPECTOR, 
     139            ID_MENU_VIEW_AUIPANE_CHANNELS_LIST, 
     140            ID_MENU_VIEW_AUIPANE_CHANNEL_INSPECTOR, 
    135141            ID_MENU_VIEW_AUIPANE_SKINS_LIST, 
     142         // ID_MENU_VIEW_AUIPANE_SKIN_INSPECTOR, 
    136143            ID_MENU_VIEW_AUIPANE_GUIFIXTURES_LIST, 
    137144            ID_MENU_VIEW_AUIPANE_GUIFIXTURE_INSPECTOR, 
     
    149156            ID_MENU_MODEL_TRANSFORM, 
    150157            ID_MENU_MODEL_GUIFIXTURE_ADD, 
     158         // ID_MENU_MODEL_SKIN_ADD, 
     159         // ID_MENU_MODEL_CHANNEL_ADD, 
    151160            ID_MENU_MODEL_LOAD_SUBMODEL, 
    152161            ID_MENU_MODEL_UNLOAD_SUBMODELS 
  • cafu/trunk/CaWE/ModelEditor/Commands/Add.cpp

    r390 r394  
    4747 
    4848 
     49CommandAddT::CommandAddT(ModelDocumentT* ModelDoc, const CafuModelT::ChannelT& Channel) 
     50    : m_ModelDoc(ModelDoc), 
     51      m_Type(CHAN), 
     52      m_Channels() 
     53{ 
     54    m_Channels.PushBack(Channel); 
     55} 
     56 
     57 
    4958bool CommandAddT::Do() 
    5059{ 
     
    5665    switch (m_Type) 
    5766    { 
     67        case JOINT: 
     68            // If we supported adding joints, note that we had to update all channels as well. 
     69            break; 
     70 
    5871        case MESH: 
    5972            // If we supported adding meshes, note that we had to add a 
     
    7790            break; 
    7891 
     92        case CHAN: 
     93            for (unsigned long ChannelNr=0; ChannelNr<m_Channels.Size(); ChannelNr++) 
     94            { 
     95                Indices.PushBack(m_ModelDoc->GetModel()->m_Channels.Size()); 
     96                m_ModelDoc->GetModel()->m_Channels.PushBack(m_Channels[ChannelNr]); 
     97            } 
     98            break; 
     99 
    79100        default: 
    80101            break; 
     
    100121    switch (m_Type) 
    101122    { 
     123        case JOINT: 
     124            // For undoing the addition of joints, note that we had to update all channels as well. 
     125            break; 
     126 
    102127        case MESH: 
    103128            // For undoing the addition of a mesh, note that we had to remove 
     
    118143                m_ModelDoc->GetModel()->m_GuiFixtures.DeleteBack(); 
    119144                Indices.InsertAt(0, m_ModelDoc->GetModel()->m_GuiFixtures.Size()); 
     145            } 
     146            break; 
     147 
     148        case CHAN: 
     149            for (unsigned long ChannelNr=0; ChannelNr<m_Channels.Size(); ChannelNr++) 
     150            { 
     151                m_ModelDoc->GetModel()->m_Channels.DeleteBack(); 
     152                Indices.InsertAt(0, m_ModelDoc->GetModel()->m_Channels.Size()); 
    120153            } 
    121154            break; 
     
    157190            break; 
    158191        } 
     192 
     193        case CHAN: 
     194        { 
     195            Name=(m_Channels.Size()==1) ? wxString("Add channel") : wxString::Format("Add %lu channels", m_Channels.Size()); 
     196            break; 
     197        } 
    159198    } 
    160199 
  • cafu/trunk/CaWE/ModelEditor/Commands/Add.hpp

    r383 r394  
    4040        CommandAddT(ModelDocumentT* ModelDoc, const CafuModelT::SkinT& Skin); 
    4141        CommandAddT(ModelDocumentT* ModelDoc, const ArrayT<CafuModelT::GuiFixtureT>& GuiFixtures); 
     42        CommandAddT(ModelDocumentT* ModelDoc, const CafuModelT::ChannelT& Channel); 
    4243 
    4344        // CommandT implementation. 
     
    5758        ArrayT<CafuModelT::SkinT>       m_Skins;        ///< The added skins (if m_Type==SKIN). 
    5859        ArrayT<CafuModelT::GuiFixtureT> m_GuiFixtures;  ///< The added GUI fixtures (if m_Type==GFIX). 
     60        ArrayT<CafuModelT::ChannelT>    m_Channels;     ///< The added channels (if m_Type==CHAN). 
    5961    }; 
    6062} 
  • cafu/trunk/CaWE/ModelEditor/Commands/Delete.cpp

    r383 r394  
    6565      m_MeshInfos(), 
    6666      m_Anims(), 
     67      m_Channels(), 
    6768      m_Skins(), 
    6869      m_GuiFixtures(), 
     
    7879            case JOINT: m_Joints     .PushBack(m_ModelDoc->GetModel()->GetJoints()     [i]); break; 
    7980            case ANIM:  m_Anims      .PushBack(m_ModelDoc->GetModel()->GetAnims()      [i]); break; 
     81            case CHAN:  m_Channels   .PushBack(m_ModelDoc->GetModel()->GetChannels()   [i]); break; 
    8082            case SKIN:  m_Skins      .PushBack(m_ModelDoc->GetModel()->GetSkins()      [i]); break; 
    8183            case GFIX:  m_GuiFixtures.PushBack(m_ModelDoc->GetModel()->GetGuiFixtures()[i]); break; 
     
    147149        //   - decide what to with meshes whose weights refer to the joint or one of its children (probably refuse to delete the joint), 
    148150        //   - unload the submodel (if any), 
     151        //   - delete the joint also from the anim channels, 
    149152        //   - delete the joint also from the anim joints (this is easy), and restore the deleted anim joints on undo (not so easy). 
    150153        // (It might help though to restrict deleting joints to one joint at a time.) 
     
    175178            case JOINT: m_ModelDoc->GetModel()->m_Joints     .RemoveAtAndKeepOrder(i); break; 
    176179            case ANIM:  m_ModelDoc->GetModel()->m_Anims      .RemoveAtAndKeepOrder(i); break; 
     180            case CHAN:  m_ModelDoc->GetModel()->m_Channels   .RemoveAtAndKeepOrder(i); break; 
    177181            case SKIN:  m_ModelDoc->GetModel()->m_Skins      .RemoveAtAndKeepOrder(i); break; 
    178182            case GFIX:  m_ModelDoc->GetModel()->m_GuiFixtures.RemoveAtAndKeepOrder(i); break; 
     
    215219            case JOINT: m_ModelDoc->GetModel()->m_Joints     .InsertAt(i, m_Joints     [INr]); break; 
    216220            case ANIM:  m_ModelDoc->GetModel()->m_Anims      .InsertAt(i, m_Anims      [INr]); break; 
     221            case CHAN:  m_ModelDoc->GetModel()->m_Channels   .InsertAt(i, m_Channels   [INr]); break; 
    217222            case SKIN:  m_ModelDoc->GetModel()->m_Skins      .InsertAt(i, m_Skins      [INr]); break; 
    218223            case GFIX:  m_ModelDoc->GetModel()->m_GuiFixtures.InsertAt(i, m_GuiFixtures[INr]); break; 
     
    255260        case MESH:  Name+=(m_Indices.Size()==1) ? "mesh"        : "meshes";       break; 
    256261        case ANIM:  Name+=(m_Indices.Size()==1) ? "animation"   : "animations";   break; 
     262        case CHAN:  Name+=(m_Indices.Size()==1) ? "channel"     : "channels";     break; 
    257263        case SKIN:  Name+=(m_Indices.Size()==1) ? "skin"        : "skins";        break; 
    258264        case GFIX:  Name+=(m_Indices.Size()==1) ? "GUI fixture" : "GUI fixtures"; break; 
  • cafu/trunk/CaWE/ModelEditor/Commands/Delete.hpp

    r383 r394  
    6565        ArrayT<MeshInfoT>               m_MeshInfos;        ///< Information about the deleted meshes (if m_Type==MESH). 
    6666        ArrayT<CafuModelT::AnimT>       m_Anims;            ///< The deleted anims (if m_Type==ANIM). 
     67        ArrayT<CafuModelT::ChannelT>    m_Channels;         ///< The deleted channels (if m_Type==CHAN). 
    6768        ArrayT<CafuModelT::SkinT>       m_Skins;            ///< The deleted skins (if m_Type==SKIN). 
    6869        ArrayT<CafuModelT::GuiFixtureT> m_GuiFixtures;      ///< The deleted GUI fixtures (if m_Type==GFIX). 
  • cafu/trunk/CaWE/ModelEditor/Commands/Rename.cpp

    r383 r394  
    7777        case MESH:  return "Rename mesh"; 
    7878        case ANIM:  return "Rename anim"; 
     79        case CHAN:  return "Rename channel"; 
    7980        case SKIN:  return "Rename skin"; 
    8081        case GFIX:  return "Rename GUI fixture"; 
     
    9394        case MESH:  return m_ModelDoc->GetModel()->m_Meshes     [m_ElemNr].Name; 
    9495        case ANIM:  return m_ModelDoc->GetModel()->m_Anims      [m_ElemNr].Name; 
     96        case CHAN:  return m_ModelDoc->GetModel()->m_Channels   [m_ElemNr].Name; 
    9597        case SKIN:  return m_ModelDoc->GetModel()->m_Skins      [m_ElemNr].Name; 
    9698        case GFIX:  return m_ModelDoc->GetModel()->m_GuiFixtures[m_ElemNr].Name; 
     
    110112        case MESH:  m_ModelDoc->UpdateAllObservers_MeshChanged      (m_ElemNr); break; 
    111113        case ANIM:  m_ModelDoc->UpdateAllObservers_AnimChanged      (m_ElemNr); break; 
     114        case CHAN:  m_ModelDoc->UpdateAllObservers_ChannelChanged   (m_ElemNr); break; 
    112115        case SKIN:  m_ModelDoc->UpdateAllObservers_SkinChanged      (m_ElemNr); break; 
    113116        case GFIX:  m_ModelDoc->UpdateAllObservers_GuiFixtureChanged(m_ElemNr); break; 
  • cafu/trunk/CaWE/ModelEditor/ElementTypes.hpp

    r383 r394  
    3232        MESH =1, 
    3333        ANIM =2, 
    34         SKIN =3, 
    35         GFIX =4 
     34        CHAN =3, 
     35        SKIN =4, 
     36        GFIX =5 
    3637    }; 
    3738} 
  • cafu/trunk/CaWE/ModelEditor/ElementsList.cpp

    r393 r394  
    5050    : wxListView(Parent, wxID_ANY, wxDefaultPosition, Size, wxLC_REPORT | wxLC_EDIT_LABELS), 
    5151      m_TYPE(Type), 
    52       m_NUM_DEFAULT_ITEMS(m_TYPE==SKIN ? 1 : 0), 
     52      m_NUM_DEFAULT_ITEMS(m_TYPE==SKIN || m_TYPE==CHAN ? 1 : 0), 
    5353      m_ModelDoc(MainFrame->GetModelDoc()), 
    5454      m_MainFrame(MainFrame), 
    5555      m_IsRecursiveSelfNotify(false) 
    5656{ 
    57     wxASSERT(m_TYPE==MESH || m_TYPE==SKIN || m_TYPE==GFIX || m_TYPE==ANIM); 
     57    wxASSERT(m_TYPE==MESH || m_TYPE==SKIN || m_TYPE==GFIX || m_TYPE==ANIM || m_TYPE==CHAN); 
    5858 
    5959    // TODO: Make it up to the caller code to call this? 
     
    146146 
    147147 
     148void ElementsListT::Notify_ChannelChanged(SubjectT* Subject, unsigned int ChannelNr) 
     149{ 
     150    if (m_IsRecursiveSelfNotify) return; 
     151    if (m_TYPE!=CHAN) return; 
     152 
     153    InitListItems(); 
     154} 
     155 
     156 
    148157void ElementsListT::Notify_SkinChanged(SubjectT* Subject, unsigned int SkinNr) 
    149158{ 
     
    218227 
    219228                if (Sel.Find(ElemNr)!=-1) Select(ElemNr); 
     229            } 
     230            break; 
     231 
     232        case CHAN: 
     233            InsertItem(0, "all (default)"); 
     234            SetItem(0, 1, "-1"); 
     235            if (Sel.Size()==0) Select(0); 
     236 
     237            for (unsigned long ElemNr=0; ElemNr<m_ModelDoc->GetModel()->GetChannels().Size(); ElemNr++) 
     238            { 
     239                InsertItem(ElemNr+1, m_ModelDoc->GetModel()->GetChannels()[ElemNr].Name); 
     240                SetItem(ElemNr+1, 1, wxString::Format("%lu", ElemNr)); 
     241 
     242                if (Sel.Find(ElemNr)!=-1) Select(ElemNr+1); 
    220243            } 
    221244            break; 
     
    277300    if (m_TYPE!=SKIN) Menu.Append(ID_MENU_INSPECT_EDIT, "Inspect / Edit\tEnter"); 
    278301    Menu.Append(ID_MENU_RENAME, "Rename\tF2"); 
    279     if (m_TYPE==GFIX) Menu.Append(ID_MENU_ADD_NEW, "Add/create new"); 
     302    if (m_TYPE==GFIX || m_TYPE==SKIN || m_TYPE==CHAN) Menu.Append(ID_MENU_ADD_NEW, "Add/create new"); 
    280303 
    281304    /* if (m_TYPE==MESH) 
     
    321344 
    322345                m_MainFrame->SubmitCommand(new CommandAddT(m_ModelDoc, GuiFixtures)); 
     346            } 
     347            else if (m_TYPE==CHAN) 
     348            { 
     349                CafuModelT::ChannelT Channel; 
     350 
     351                Channel.Name="New Channel"; 
     352                m_MainFrame->SubmitCommand(new CommandAddT(m_ModelDoc, Channel)); 
    323353            } 
    324354            break; 
     
    465495                m_MainFrame->SubmitCommand(new CommandAddT(m_ModelDoc, GuiFixtures)); 
    466496            } 
     497            else if (m_TYPE==CHAN) 
     498            { 
     499                CafuModelT::ChannelT Channel; 
     500 
     501                Channel.Name="New Channel"; 
     502                m_MainFrame->SubmitCommand(new CommandAddT(m_ModelDoc, Channel)); 
     503            } 
    467504            break; 
    468505        } 
     
    487524        case ID_BUTTON_ADD: 
    488525        { 
    489             UE.Enable(m_TYPE==SKIN || m_TYPE==GFIX); 
     526            UE.Enable(m_TYPE==SKIN || m_TYPE==GFIX || m_TYPE==CHAN); 
    490527            break; 
    491528        } 
  • cafu/trunk/CaWE/ModelEditor/ElementsList.hpp

    r393 r394  
    5454        void Notify_MeshChanged(SubjectT* Subject, unsigned int MeshNr); 
    5555        void Notify_AnimChanged(SubjectT* Subject, unsigned int AnimNr); 
     56        void Notify_ChannelChanged(SubjectT* Subject, unsigned int ChannelNr); 
    5657        void Notify_SkinChanged(SubjectT* Subject, unsigned int SkinNr); 
    5758        void Notify_GuiFixtureChanged(SubjectT* Subject, unsigned int GuiFixtureNr); 
  • cafu/trunk/CaWE/ModelEditor/ModelDocument.cpp

    r383 r394  
    127127void ModelEditor::ModelDocumentT::SetSelection(ModelElementTypeT Type, const ArrayT<unsigned int>& NewSel) 
    128128{ 
    129     wxASSERT(Type<5); 
     129    wxASSERT(Type<6); 
    130130    m_Selection[Type]=NewSel; 
    131131 
  • cafu/trunk/CaWE/ModelEditor/ModelDocument.hpp

    r383 r394  
    102102 
    103103        const CafuModelT*               GetModel() const           { return m_Model; } 
    104         const ArrayT<unsigned int>&     GetSelection(ModelElementTypeT Type) const { wxASSERT(Type<5); return m_Selection[Type]; } 
     104        const ArrayT<unsigned int>&     GetSelection(ModelElementTypeT Type) const { wxASSERT(Type<6); return m_Selection[Type]; } 
    105105        const BoundingBox3fT&           GetSequenceBB() const      { return m_SequenceBB; } 
    106106        int                             GetSelSkinNr() const;      ///< Return the index number of the currently selected skin, or -1 when no skin (that is, the default skin) is selected. 
     
    137137 
    138138        CafuModelT*              m_Model;           ///< The model that is being edited. 
    139         ArrayT<unsigned int>     m_Selection[5];    ///< The selected joints, meshes, animations, skins and GUI fixtures. 
     139        ArrayT<unsigned int>     m_Selection[6];    ///< The selected joints, meshes, animations, channels, skins and GUI fixtures. 
    140140        BoundingBox3fT           m_SequenceBB;      ///< The bounding-box encompassing all frames of the currently selected animation sequence(s). 
    141141        ArrayT<EditorMaterialI*> m_EditorMaterials; ///< One editor material for each material in the model (its material manager). 
  • cafu/trunk/CaWE/ModelEditor/ObserverPattern.cpp

    r383 r394  
    102102 
    103103 
     104void SubjectT::UpdateAllObservers_ChannelChanged(unsigned int ChannelNr) 
     105{ 
     106    for (unsigned long ObsNr=0; ObsNr<m_Observers.Size(); ObsNr++) 
     107        m_Observers[ObsNr]->Notify_ChannelChanged(this, ChannelNr); 
     108} 
     109 
     110 
    104111void SubjectT::UpdateAllObservers_SkinChanged(unsigned int SkinNr) 
    105112{ 
  • cafu/trunk/CaWE/ModelEditor/ObserverPattern.hpp

    r388 r394  
    7979        virtual void Notify_AnimChanged(SubjectT* Subject, unsigned int AnimNr) { } 
    8080 
     81        /// Notifies the observer that an animation channel has changed. 
     82        /// @param Subject     The model document with the model in which the channel has changed. 
     83        /// @param ChannelNr   The number of the anim channel that has changed. 
     84        virtual void Notify_ChannelChanged(SubjectT* Subject, unsigned int ChannelNr) { } 
     85 
    8186        /// Notifies the observer that a skin has changed. 
    8287        /// @param Subject   The model document with the model in which the skin has changed. 
     
    130135        virtual void UpdateAllObservers_MeshChanged(unsigned int MeshNr); 
    131136        virtual void UpdateAllObservers_AnimChanged(unsigned int AnimNr); 
     137        virtual void UpdateAllObservers_ChannelChanged(unsigned int ChannelNr); 
    132138        virtual void UpdateAllObservers_SkinChanged(unsigned int SkinNr); 
    133139        virtual void UpdateAllObservers_GuiFixtureChanged(unsigned int GuiFixtureNr); 
  • cafu/trunk/Libs/Models/Model_cmdl.hpp

    r391 r394  
    4848namespace ModelEditor { class CommandTransformJointT; } 
    4949namespace ModelEditor { class CommandUpdateAnimT; } 
     50namespace ModelEditor { class CommandUpdateChannelT; } 
    5051namespace ModelEditor { class CommandUpdateGuiFixtureT; } 
    5152 
     
    323324    friend class ModelEditor::CommandTransformJointT; 
    324325    friend class ModelEditor::CommandUpdateAnimT; 
     326    friend class ModelEditor::CommandUpdateChannelT; 
    325327    friend class ModelEditor::CommandUpdateGuiFixtureT; 
    326328