1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 #ifndef __wxInstantChooserPanel_h_INCLUDED_H__
27 #define __wxInstantChooserPanel_h_INCLUDED_H__
30 // -----------------------------------------------------------------------------------------------------------
31 // WX headers inclusion.
32 // For compilers that support precompilation, includes <wx/wx.h>.
33 // -----------------------------------------------------------------------------------------------------------
35 #include <wx/wxprec.h>
44 //------------------------------------------------------------------------------------------------------------
46 //------------------------------------------------------------------------------------------------------------
50 #include "wxConceptControl.h"
52 #include "ConceptDataWrap.h"
54 //------------------------------------------------------------------------------------------------------------
56 //------------------------------------------------------------------------------------------------------------
58 BEGIN_DECLARE_EVENT_TYPES()
59 DECLARE_EVENT_TYPE(wxINSTANT_CHOOSER_CHANGE,400)
60 END_DECLARE_EVENT_TYPES()
63 /** file wxInstantChooserPanel.h */
66 //------------------------------------------------------------------------------------------------------------
68 //------------------------------------------------------------------------------------------------------------
70 class wxInstantChooserPanel : public wxPanel {
74 //------------------------------------------------------------------------------------------------------------
75 // Constructors & Destructors
76 //------------------------------------------------------------------------------------------------------------
78 wxInstantChooserPanel (wxWindow * parent, std::string title, bool theOrientation, bool resolutionALL = false, std::string configurationElem="", std::string groupConfig = "");
80 wxInstantChooserPanel (wxWindow * parent,wxWindowID id ,std::string title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, bool theOrientation=true, std::string configurationElem="", std::string groupConfig = "");
82 ~wxInstantChooserPanel();
84 //------------------------------------------------------------------------------------------------------------
85 // Creational and initialization methods
86 //------------------------------------------------------------------------------------------------------------
89 * Adds a concept to the instant managment. PRE: The concept doesn't exists in the included _concepts.
95 void addConcept(std::string aConceptName, int minV, int maxV, int actualV);
97 void setWxEventHandler( wxEvtHandler * theEventHandler );
99 //------------------------------------------------------------------------------------------------------------
100 // Methods for capturing events
101 //------------------------------------------------------------------------------------------------------------
102 void onResolutionSlider( wxScrollEvent& event );
104 void onCheckBoxClicked( wxCommandEvent& event );
106 void onConceptRelease( wxCommandEvent& event );
107 //------------------------------------------------------------------------------------------------------------
108 // Methods for sending events
109 //------------------------------------------------------------------------------------------------------------
111 //------------------------------------------------------------------------------------------------------------
112 // Attributes getters and setters
113 //------------------------------------------------------------------------------------------------------------
115 ConceptDataWrap * getLastConceptData();
117 //------------------------------------------------------------------------------------------------------------
118 // Other functional methods
119 //------------------------------------------------------------------------------------------------------------
121 void setInstant(std::vector<int> choiceInstant);
123 void setInstant(std::map<std::string,int>* _actualInstant );
125 void getInstant(std::vector<int> & choiceInstant);
127 void getInstantData(std::map<std::string,int> & choiceInstantData);
129 std::map<std::string,int>* getInstantData();
131 void setResolutionRangeWithLasUpdate();
133 void refreshConceptLabels();
135 void setConfiguration(std::string aConfiguration);
137 std::string getConfiguration();
139 void setResolutionOverAll( bool condition );
141 bool getIfResolutionOverAll();
143 void setConceptValue( std::string theConceptName, int theValue );
145 int getConceptValue( std::string theConceptName );
147 ConceptDataWrap * getConceptDataOf( std::string theConceptName );
149 bool getIfConceptCheckedAt( std::string theConceptName, int atChecksPosition );
151 void onChangeInstant( wxCommandEvent& event );
153 void addConcepts(std::vector<std::string> conceptNameVect,std::vector<int> conceptSizeVect);
156 //------------------------------------------------------------------------------------------------------------
158 //------------------------------------------------------------------------------------------------------------
159 void initializeResolutionSlider();
161 void changeResolutionAtConceptControl( wxConceptControl * theConceptToUpdate );
163 void setVerticalMaxSelectedNums( std::string groupMaxVertNums );
165 //------------------------------------------------------------------------------------------------------------
167 //------------------------------------------------------------------------------------------------------------
169 std::vector<wxConceptControl *> * _concepts;
171 wxConceptControl * _lastConceptUpdated;
173 wxSlider * _resolutionSlider;
175 wxFlexGridSizer * _outSizer;
179 bool _resolutionOverALL;
181 std::map<std::string,int>* _actualInstant;
183 std::vector<int> _verticalMaxSelected;
185 wxEvtHandler * _eventHandler;
187 std::string _configuration;
190 //DECLARE_CLASS(wxInstantChooserPanel)
191 // any class wishing to process wxWindows events must use this macro
192 //DECLARE_EVENT_TABLE()