wxGEditorTabPanel.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 Program:   bbtk
00003 Module:    $RCSfile: wxGEditorTabPanel.h,v $
00004 Language:  C++
00005 Date:      $Date: 2012/05/25 12:55:15 $
00006 Version:   $Revision: 1.32 $
00007 =========================================================================*/
00008 
00009 /* ---------------------------------------------------------------------
00010 
00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
00012 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
00013 *
00014 *  This software is governed by the CeCILL-B license under French law and
00015 *  abiding by the rules of distribution of free software. You can  use,
00016 *  modify and/ or redistribute the software under the terms of the CeCILL-B
00017 *  license as circulated by CEA, CNRS and INRIA at the following URL
00018 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
00019 *  or in the file LICENSE.txt.
00020 *
00021 *  As a counterpart to the access to the source code and  rights to copy,
00022 *  modify and redistribute granted by the license, users are provided only
00023 *  with a limited warranty  and the software's author,  the holder of the
00024 *  economic rights,  and the successive licensors  have only  limited
00025 *  liability.
00026 *
00027 *  The fact that you are presently reading this means that you have had
00028 *  knowledge of the CeCILL-B license and that you accept its terms.
00029 * ------------------------------------------------------------------------ */
00030 
00031 
00032 
00038 /****
00039 * Design and Developpement of BBTK GEditor
00040 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
00041 * RaC - 2010
00042 ****/
00043 
00044 #ifndef __wxGEditorTabPanel_h__
00045 #define __wxGEditorTabPanel_h__
00046 
00047 //Includes same project
00048 #include "wxVtkSceneManager.h"
00049 #include "wxTabPanelsManager.h"
00050 
00051 //Includes wxWidgets
00052 #include <wx/panel.h>
00053 #include <wx/aui/aui.h>
00054 #include <wx/dnd.h>
00055 
00056 //Includes creaMaracasVisu
00057 #include <wxVtk3DBaseView.h>
00058 
00059 //Includes std
00060 #include <fstream>
00061 
00062 namespace bbtk
00063 {
00064 
00065         class tmpClasswxTextDropTarget :   public wxTextDropTarget
00066         {
00067                 public:
00068                   virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data) { return false;}
00069         };
00070 
00071 
00072         //RaC: It is important if it exists a double relation
00073         //e.g. wxGEditorTabPanel includes wxVtkSceneManager, and wxVtkSceneManager includes wxGEditorTabPanel
00074         class wxVtkSceneManager;
00075         class wxTabPanelsManager;
00076 
00077         // RaC Be careful with the double heritance
00078         class wxGEditorTabPanel :  public wxPanel, public wxTextDropTarget
00079         {
00080         public:
00081                 wxGEditorTabPanel();
00082                 wxGEditorTabPanel(wxWindow *parent, int id);
00083                 ~wxGEditorTabPanel();
00084 
00085                 void initWxVtkCanvas();
00086 
00087                 // Sets the parent manager
00088                 void setPanelsManager(wxTabPanelsManager* panelsManager);
00089 
00090                 // Get the BBS script of the pipeline diagram included in the panel
00091                 std::string getDiagramBBS(bool wln=false);
00092 
00093                 // Saves the actual BBS as complex box
00094                 // RaC TOFIX It must be included the package of the complex box
00095                 std::string saveComplexBoxBBS();
00096 
00097                 // Shows the dialog to edit black box parameters
00098                 void editBlackBox(GBlackBoxModel *bbmodel);
00099 
00100                 // Save diagram as BBG
00101                 void saveDiagram(std::string &content, const std::string &path); //DFCH
00102 
00103                 // Save temporary diagram as BBG
00104                 void saveTempDiagram(const std::string &);
00105 
00106                 // Save temporary diagram as BBG and update buttons
00107                 void saveTempandUpdate(const std::string &);
00108 
00109                 // Load BBG diagram
00110                 void loadDiagram(ifstream &inputStream, const std::string &path); //DFCH
00111 
00112                 void saveStringAction(const std::string &action);
00113 
00114                 // Load temporary diagram as BBG
00115                 void  loadTempDiagram(unsigned short un);
00116 
00117                 // evaluate the position in the undo actions list
00118                 unsigned short getUndoState(std::string &);
00119 
00120                 // evaluate the position in the redo actions list
00121                 unsigned short getRedoState(std::string &);
00122 
00123                 // Add a new complex input object to the scene
00124                 void addComplexInputPort(std::string portName);
00125 
00126                 // Add a new complex output object to the scene
00127                 void addComplexOutputPort(std::string portName);
00128 
00129                 // Delete all boxes in the diagram
00130                 void deleteAllBoxes();
00131 
00132                 // Center the camera in the initial position
00133                 void centerView();
00134 
00135                 // Display feedback info in the GUI
00136                 void displayBlackBoxInfo(std::string packageName, std::string boxName);
00137                 void updateStatusBar(std::string textStatus);
00138 
00139                 int getPanelId();
00140                 bool isComplexBox();
00141                 void setComplexBox(bool val);
00142 
00143                 // Returns a map with the id,controller of all the objects selected
00144                 std::map<int,GObjectController*> getSelectedObjects();
00145 
00146                 void addObjects(std::map<int,GObjectController*> objectsMap);
00147                 int getNumSelectedObjects();
00148 
00149                 // Receives the string from a drag and drop source as for example the BBTK Package Browser
00150                 virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
00151 
00152                 wxVtkSceneManager* getSceneManager();
00153 
00154                 void SetFullPath( const std::string& );
00155                 void SetFileName( const std::string& );
00156                 void SetCbName(std::string cbName);
00157         void SetCbPackageName(std::string packagename);
00158         void SetAuthor(std::string author);
00159         void SetCategory(std::string category);
00160         void SetDescription(std::string description);
00161         //Getters
00162         std::string GetFullPath( );
00163         std::string GetFileName( );
00164         
00165         std::string GetCbName();
00166         std::string GetCbPackageName();
00167         std::string GetAuthor();
00168         std::string GetDescription();
00169         std::string GetCategory();
00170 
00171 
00172 
00173         //=========================================================================
00174 
00175         private:
00176                 std::vector<std::string> states; // represents each modification of the tab. Maxixum size 100!!
00177                 std::vector<std::string>::iterator _actualdo;   // actual position on modifications vector
00178                 std::vector<std::string> sstates; // represents string of each modification of the tab. Maxixum size 100!!
00179                 std::vector<std::string>::iterator _sactualdo;  // actual position onstring  modifications vector
00180 
00181                 int                                             _id;
00182                 wxAuiManager                    *_panelAUIMgr;
00183                 wxVtkSceneManager               *_sceneManager;
00184                 wxTabPanelsManager              *_panelsManager;
00185                 std::string                             _fullPath;
00186                 std::string                             _fileName;
00187 
00188         protected:
00189 
00190         };
00191 
00192 
00193 }
00194 // namespace bbtk
00195 #endif
00196 

Generated on Thu May 31 15:12:19 2012 for bbtkGEditor by  doxygen 1.5.7.1