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);
122 void setInstant(std::map<std::string,int>* _actualInstant );
123 void getInstant(std::vector<int> & choiceInstant);
124 void getInstantData(std::map<std::string,int> & choiceInstantData);
125 std::map<std::string,int>* getInstantData();
126 void setResolutionRangeWithLasUpdate();
127 void refreshConceptLabels();
128 void setConfiguration(std::string aConfiguration);
129 std::string getConfiguration();
130 void setResolutionOverAll( bool condition );
131 bool getIfResolutionOverAll();
132 void setConceptValue( std::string theConceptName, int theValue );
133 int getConceptValue( std::string theConceptName );
134 ConceptDataWrap * getConceptDataOf( std::string theConceptName );
135 bool getIfConceptCheckedAt( std::string theConceptName, int atChecksPosition );
136 void onChangeInstant( wxCommandEvent& event );
137 void addConcepts(std::vector<std::string> conceptNameVect,std::vector<int> conceptSizeVect);
140 //------------------------------------------------------------------------------------------------------------
142 //------------------------------------------------------------------------------------------------------------
143 void initializeResolutionSlider();
144 void changeResolutionAtConceptControl( wxConceptControl * theConceptToUpdate );
145 void setVerticalMaxSelectedNums( std::string groupMaxVertNums );
147 //------------------------------------------------------------------------------------------------------------
149 //------------------------------------------------------------------------------------------------------------
151 std::vector<wxConceptControl *> *_concepts;
152 wxConceptControl *_lastConceptUpdated;
153 wxSlider *_resolutionSlider;
154 wxFlexGridSizer *_outSizer;
156 bool _resolutionOverALL;
157 std::map<std::string,int> *_actualInstant;
158 std::vector<int> _verticalMaxSelected;
159 wxEvtHandler *_eventHandler;
160 std::string _configuration;
162 //DECLARE_CLASS(wxInstantChooserPanel)
163 // any class wishing to process wxWindows events must use this macro
164 //DECLARE_EVENT_TABLE()