rasdaman complete source
rviewTypeMan.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
23 
35 #ifndef _RVIEW_TYPE_MAN_H_
36 #define _RVIEW_TYPE_MAN_H_
37 
38 
39 #ifdef __GNUG__
40 #pragma interface
41 #endif
42 
43 
44 #include "rviewUtils.hh"
45 #include "rviewDisplay.hh"
46 
47 
48 
49 class rviewTypeMan: public rviewFrame
50 {
51 public:
52 
53  rviewTypeMan(rviewFrame *parentWindow);
54  rviewTypeMan(rviewFrame *parentWindow, const r_Type *type);
55  ~rviewTypeMan(void);
56 
57  void unlinkParent(void);
58 
59  void setType(const r_Type *type);
60  void label(void);
61  int process(wxObject &obj, wxEvent &evt);
62  void OnSize(int w, int h);
63  int convert(r_Ref<r_GMarray> &src, r_Ref<r_GMarray> &dest);
64 
65 
66 protected:
67 
68  void clearData(void);
69 
70  wxPanel *panel;
71  wxGroupBox **structures;
72  rviewCheckBox **members;
73  unsigned int *offsets;
74  unsigned char *primtypes;
75  unsigned int numStruct, numMembers, typeDepth;
76  unsigned int baseTypeLength;
77  r_Type *myType;
78  rviewFrame *parent;
79  rviewButton *closeBut, *convertBut;
80  const char **typeNames;
81  DynamicString baseTypeName;
82 
83 
84 private:
85 
86  void initShare(rviewFrame *parentWindow);
87  void parseStructType(const r_Structure_Type *tp, unsigned int &nums, unsigned int &numm, unsigned int depth, unsigned int offset=0, wxRect *bbox=NULL);
88  void parsePrimitiveType(const r_Primitive_Type *tp, const char *name, unsigned int &numm, unsigned int offset=0, wxRect *bbox=NULL);
89 
90  static const char structName[];
91  static const char marrayName[];
92  static const char typeBool[];
93  static const char typeChar[];
94  static const char typeOctet[];
95  static const char typeShort[];
96  static const char typeUShort[];
97  static const char typeLong[];
98  static const char typeULong[];
99  static const char typeFloat[];
100  static const char typeDouble[];
101 
102  // constants
103  static const int tman_width;
104  static const int tman_height;
105  static const int tman_border;
106  static const int tman_basewidth;
107  static const int tman_cheight;
108  static const int tman_bheight;
109  static const int tman_bwidth;
110 };
111 
112 #endif