NIREP

C:/Programs/source/NIREP/DisplayManager/NIREPDisplay.h

00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 #pragma once
00014 #ifndef _NIREPDisplay_h_
00015 #define _NIREPDisplay_h_
00016 
00017 // For compilers that supports precompilation , includes  wx/wx.h
00018 #include  "wx/wxprec.h"
00019 
00020 #ifndef WX_PRECOMP
00021 #include  "wx/wx.h"
00022 #endif
00023 
00024 #include <vector>
00025 #include <map>
00026 #include <list>
00027 #include <NIREPvtkViewImage2D.h>
00028 #include "Panel.h"
00029 #include "NIREPDataManager.h"
00030 #include "DisplayDescription.h"
00031 #include "NIREPEvaluator.h"
00032 
00033 enum{
00034 
00035 //---------file id's--------------
00036 ID_SAVE = 10000,
00037 ID_OPEN_NIREPDisplay_DESCRIPTION,
00038 ID_NEW_WINDOW,
00039 ID_CLOSE,
00040 ID_ADD_ROW,
00041 ID_ADD_COLUMN,
00042 ID_TURN_OFF_TITLES,
00043 ID_TURN_ON_TITLES,
00044 ID_TURN_ON_ALL_CURSORS,
00045 ID_TURN_OFF_ALL_CURSORS,
00046 //---------end of file id's--------
00047 
00048 
00049 //-------cursor lock id's-----------
00050 ID_LOCK_ALL,
00051 ID_LOCK_ROWS,
00052 ID_LOCK_COLS,
00053 ID_UNLOCK_ALL,
00054 ID_UNLOCK_ROWS,
00055 ID_UNLOCK_COLS,
00056 //-------end of cursor lock id's-----------
00057 
00058 
00059 //-------database view id's-----------
00060 ID_GROUP1,
00061 ID_GROUP2,
00062 ID_GROUP3,
00063 ID_NEXT_GROUP,
00064 ID_PREVIOUS_GROUP,
00065 ID_ADD_OBJECT_MAPS,
00066 ID_ADD_LANKDMARKS,
00067 //-------end of database view id's-----------
00068 
00069 ID_EDIT_PANEL,
00070 ID_EDIT_DISPLAY_VARS,
00071 
00072 ID_SAC
00073 };
00074 
00075 /* +---------+
00076    | Classes |
00077    +---------+ */
00078 
00079 class vtkImageData;
00080 class NIREPwxVTKRenderWindowInteractor;
00081 
00082 enum{ 
00083   NOPRESET =0,
00084   DATABASE_QUERY,
00085   PAIRWISE_COMPARISON,
00086   GROUP_WISE
00087 };
00088 
00089 enum{
00090   NOGROUP=0,
00091   GROUP1,
00092   GROUP2,
00093   GROUP3
00094 };
00095 
00112 class NIREPDisplay : public wxFrame
00113 {
00114   DECLARE_CLASS( NIREPDisplay )
00115   DECLARE_EVENT_TABLE()
00116  public:
00117   
00130   NIREPDisplay(wxWindow* parent,NIREPEvaluator * ev,const std::string& FileName="",  int id = wxID_ANY, 
00131                    const wxString& title = wxT(""),
00132                    const wxPoint& pos=wxDefaultPosition,
00133                    const wxSize& size=wxDefaultSize,
00134                    long style=wxDEFAULT_FRAME_STYLE,
00135                    const wxString& name=wxT ("Frame")
00136                    );
00137 
00140   ~NIREPDisplay();
00141     
00142 
00147   //void RemoveView (const int&);
00148 
00151   void RemoveAll (void);
00152 
00155   void Render (void);
00156 
00160   void LinkViews (bool val);
00161 
00162   //void LinkViews (std::vector<std::string> Panels);
00163 
00167   void LinkViews (std::vector<int> Panels);
00168 
00177   void UnLinkViews (std::vector<int> LinkedPanels, std::vector<int> UnLinkedPanels);
00178 
00181   void ShowCursors(bool value);
00182 
00183 
00189   void SetColumns(int col);
00190 
00194   int GetColumns(){return m_Sizer->GetCols();};
00195   
00205   void DeleteWidget(const int &Location);
00206 
00207 
00214   void CreateGrid();
00215 
00220   DisplayDescription* GetDisplayDescription(){return displayDescription;};
00221 
00222   void SetDisplayDescription(DisplayDescription * dd){displayDescription = dd;};
00223 
00224 
00231   wxStaticText * GetPanelTitle(int panelID);
00232 
00234   void OnSaveClick( wxCommandEvent& event );
00235 
00237   void OnOpenDisplayDescriptionClick( wxCommandEvent& event );
00238 
00240   void OnNewWindowClick( wxCommandEvent& event );
00241 
00243   void OnCloseClick( wxCommandEvent& event );
00244 
00246   void OnLockAllClick( wxCommandEvent& event );
00247 
00249   void OnLockRowsClick( wxCommandEvent& event );
00250 
00252   void OnLockColsClick( wxCommandEvent& event );
00253 
00255   void OnUnLockAllClick( wxCommandEvent& event );
00256 
00257 
00258 
00260   void OnGroup1Click( wxCommandEvent& event );
00261 
00263   void OnGroup2Click( wxCommandEvent& event );
00264 
00266   void OnGroup3Click( wxCommandEvent& event );
00267 
00269   void OnNextGroupClick( wxCommandEvent& event );
00271   void OnPreviousGroupClick( wxCommandEvent& event );
00272 
00274   void OnAddObjectMapsClick( wxCommandEvent& event );
00275 
00277   void OnAddLandmarksClick( wxCommandEvent& event );
00278 
00280   void OnEditPanelClick( wxCommandEvent& event );
00281 
00283   void OnEditDisplayFileClick( wxCommandEvent& event );
00284 
00286   void OnAddRowClick( wxCommandEvent& event );
00287 
00289   void OnAddColumnClick( wxCommandEvent& event );
00290 
00292   void OnTurnOffTitlesClick( wxCommandEvent& event );
00293 
00295   void OnTurnOnTitlesClick( wxCommandEvent& event );
00296 
00297   void OnTurnOnAllCursorsClick( wxCommandEvent& event );
00298   void OnTurnOffAllCursorsClick( wxCommandEvent& event );
00299 
00301   void OnSingleAlgorithmComparisonClick( wxCommandEvent& event );
00302 
00303   void EditPanel(int row, int col, bool editViewPanel=false);
00304   
00305 
00306 
00307   void CreateNIREPDisplay(const std::string& FileName);
00308 
00309   void SetPresetView(int pv);
00310 
00311   int GetPresetView();
00312 
00313   Panel* GetPanel(int i){return panel.at(i);};
00314 
00315   Panel* GetPanel(int r, int c){return panel.at((r)*this->GetColumns()+(c));};
00316 
00317   void UpdatePanels();
00318 
00320   wxString GetFileName(){return m_fileName;};
00321 
00323   void SetFileName(wxString fn){m_fileName = fn;};
00324   
00325   
00326  protected:
00327   
00328    
00329   
00330  private:
00331 
00332   /* +-----------------+
00333      | Private Methods |
00334      +-----------------+ */
00335 
00338   void SetProperties (void);
00339 
00342   void DoLayout (void);
00343 
00351   void AddWidget(std::string type, std::vector<std::string> parameters);
00352 
00357   std::vector<std::string> ReadInFile(wxString *fileName);
00358 
00359   void DistributeAttributes();
00360   
00361 
00362   /* +--------------------+
00363      | Private Parameters |
00364      +--------------------+ */
00365   std::vector<Panel*> panel;                                 
00366   //std::map<int,Panel*> panels;
00367   std::map<int, wxStaticText*> panelTitle;                   
00368 
00369   int m_InteractionStyle;                                    
00370   bool m_LinkViews;                                          
00371   unsigned int m_OrientationFlag;                            
00372   bool m_ShowCursors;                                        
00373 
00374   NIREPEvaluator *evaluator;                                 
00375   DisplayDescription *displayDescription;                    
00376   wxFlexGridSizer* m_Sizer;                                  
00377 
00378   int presetView;
00379   int groupNumber;
00380 
00381   wxString m_fileName;
00382 
00383   wxScrolledWindow* m_scrolledWindow;
00384   wxFlexGridSizer* m_SizerTwo;
00385 
00386   //struct PanelStorage
00387   //{
00388   //  PanelStorage() {
00389   //    next = NULL;
00390   //    panel = NULL;
00391   //    text = NULL;
00392   //  }
00393   //  PanelStorage *next;
00394   //  Panel *panel;
00395   //  wxStaticText *text;
00396 
00397   //};
00398 
00399   //PanelStorage *head;
00400   //PanelStorage *tail;
00401 
00402   //void InsertIntoLink(int location, PanelStorage*);
00403   //PanelStorage* GetPanelStorage(int location);
00404   
00405   
00406 };
00407 
00408 #endif
 All Classes Functions Variables Typedefs Enumerations Enumerator