Evita  0.16
evGUIComponentBrowser.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evGUIComponentBrowser_h
25 #define __evGUIComponentBrowser_h
26 
27 
28 #include <FL/Fl_Hold_Browser.H>
29 
30 #include "evGUIObject.h"
31 
32 
33 class evGUIComponentBrowser : public evGUIObject, public Fl_Hold_Browser
34 {
35 public:
36  evGUIComponentBrowser(const int x, const int y,
37  const int width, const int height, const char *title);
38  virtual ~evGUIComponentBrowser(void);
39 
40  virtual const evString GetClassName(void) const
41  {
42  return(evString("evGUIComponentBrowser"));
43  }
44 
45  void clear();
46 
47  unsigned int GetVectorDimension(const unsigned int browser_line) const;
48  void AddVectorDimension(const unsigned int vector_dimension);
49 
50 protected:
51 
52 private:
53  std::vector<unsigned int> VectorDimensions;
54 };
55 
56 
57 inline evGUIComponentBrowser::evGUIComponentBrowser(const int x, const int y,
58  const int width,
59  const int height,
60  const char *title) :
61  Fl_Hold_Browser(x, y, width, height, title)
62 {
63 }
64 
65 
67 {
68 }
69 
70 
72 {
73  this->VectorDimensions.clear();
74  Fl_Hold_Browser::clear();
75 }
76 
77 
78 inline unsigned int
79 evGUIComponentBrowser::GetVectorDimension(const unsigned int browser_line)
80  const
81 {
82  if ((browser_line < 1) || (browser_line > this->VectorDimensions.size()))
83  return(0);
84  else
85  return(this->VectorDimensions[browser_line - 1]);
86 }
87 
88 
89 inline void evGUIComponentBrowser::AddVectorDimension(const unsigned int
90  vector_dimension)
91 {
92  this->VectorDimensions.push_back(vector_dimension);
93 }
94 
95 
96 #endif
void AddVectorDimension(const unsigned int vector_dimension)
Definition: evGUIComponentBrowser.h:89
virtual ~evGUIComponentBrowser(void)
Definition: evGUIComponentBrowser.h:66
std::vector< unsigned int > VectorDimensions
Definition: evGUIComponentBrowser.h:53
virtual const evString GetClassName(void) const
Definition: evGUIComponentBrowser.h:40
evGUIComponentBrowser(const int x, const int y, const int width, const int height, const char *title)
Definition: evGUIComponentBrowser.h:57
Definition: evGUIObject.h:33
Definition: evGUIComponentBrowser.h:33
Definition: evString.h:30
unsigned int GetVectorDimension(const unsigned int browser_line) const
Definition: evGUIComponentBrowser.h:79
void clear()
Definition: evGUIComponentBrowser.h:71