#include "TeGUIUtils.h"
#include "../../kernel/TeViewNode.h"
#include "../../kernel/TeView.h"
#include "../../kernel/TeDatabase.h"
Go to the source code of this file.
Functions | |
| bool | fillColumnCombo (vector< TeAttrDataType > &aTypeVec, TeTheme *theme, QComboBox *cColumnCombo, bool clear) |
| Fills the comboBox (cColumnCombo) with the all columns of specific types of the current theme "tableName.columnName". | |
| bool | fillColumnCombo (vector< TeAttrDataType > &aTypeVec, TeTheme *theme, QComboBox *cColumnCombo, QComboBox *cTableCombo, string selName, bool clear) |
| bool | fillColumnCombo (TeAttrDataType aType, TeTheme *theme, QComboBox *cColumnCombo, QComboBox *cTableCombo, string selName, bool clear) |
| bool | fillLayerCombo (TeDatabase *db, TeGeomRep rep, QComboBox *lColumnCombo, const string ¤t, bool clear) |
| bool | fillTableCombo (TeView *view, QComboBox *cTableCombo, QComboBox *cThemeCombo, string selName, bool clear, TeAttrTableType tableType) |
| bool | fillThemeCombo (TeView *view, QComboBox *cBox, string selName, bool clear) |
| bool | fillThemeCombo (vector< TeGeomRep > &tg, TeView *view, QComboBox *cBox, string selName, bool clear) |
| bool | fillThemeCombo (TeGeomRep tg, TeView *view, QComboBox *cBox, string selName, bool clear) |
| bool fillColumnCombo | ( | vector< TeAttrDataType > & | aTypeVec, | |
| TeTheme * | theme, | |||
| QComboBox * | cColumnCombo, | |||
| bool | clear | |||
| ) |
Definition at line 224 of file TeGUIUtils.cpp.
00225 { 00226 if(clear) 00227 cColumnCombo->clear(); 00228 TeAttrTableVector attrTables = theme->attrTables(); 00229 for(unsigned int i=0; i<attrTables.size(); ++i) 00230 { 00231 TeAttributeList attrList = attrTables[i].attributeList(); 00232 for(unsigned int j=0; j<attrList.size(); ++j) 00233 { 00234 for(unsigned int type=0; type<aTypeVec.size(); ++type) 00235 { 00236 if(attrList[j].rep_.type_==aTypeVec[type]) 00237 { 00238 string tableCol = attrTables[i].name()+"."+attrList[j].rep_.name_; 00239 cColumnCombo->insertItem(tableCol.c_str()); 00240 } 00241 } 00242 } 00243 } 00244 return true; 00245 }
| bool fillColumnCombo | ( | vector< TeAttrDataType > & | aTypeVec, | |
| TeTheme * | theme, | |||
| QComboBox * | cColumnCombo, | |||
| QComboBox * | cTableCombo, | |||
| string | selName, | |||
| bool | clear | |||
| ) |
Definition at line 209 of file TeGUIUtils.cpp.
References fillColumnCombo().
00214 { 00215 if(clear) 00216 cColumnCombo->clear(); 00217 00218 for(unsigned int i = 0; i < aTypeVec.size(); i++) 00219 fillColumnCombo(aTypeVec[i], theme, cColumnCombo, cTableCombo, selName, false); 00220 00221 return true; 00222 }
| bool fillColumnCombo | ( | TeAttrDataType | aType, | |
| TeTheme * | theme, | |||
| QComboBox * | cColumnCombo, | |||
| QComboBox * | cTableCombo, | |||
| string | selName, | |||
| bool | clear | |||
| ) |
Definition at line 154 of file TeGUIUtils.cpp.
References TeTable::attributeList(), TeTheme::getAttTables(), and TeUNKNOWN.
Referenced by fillColumnCombo().
00159 { 00160 00161 // bool done = false; 00162 00163 TeAttributeList columns; 00164 TeAttrTableVector atvec; 00165 theme->getAttTables(atvec); 00166 00167 string tableName = string(cTableCombo->currentText().ascii()); 00168 unsigned int t; 00169 00170 for (t = 0; t < atvec.size(); t++) 00171 { 00172 if (!tableName.compare(atvec[t].name())) 00173 break; 00174 } 00175 00176 if (t == atvec.size()) 00177 return false; 00178 00179 TeTable ttable = atvec[t]; 00180 columns = ttable.attributeList(); 00181 00182 if (clear) 00183 cColumnCombo->clear(); 00184 00185 int idx = 0; 00186 int count = 0; 00187 00188 for(unsigned int i=0; i<columns.size(); i++) 00189 { 00190 int type = columns[i].rep_.type_; 00191 string colName = columns[i].rep_.name_; 00192 if ((aType == TeUNKNOWN) || (type == aType)) 00193 { 00194 cColumnCombo->insertItem(colName.c_str()); 00195 if (!selName.compare(colName)) 00196 { 00197 idx = count; 00198 } 00199 count++; 00200 } 00201 } 00202 00203 if (count > 0) 00204 cColumnCombo->setCurrentItem(idx); 00205 00206 return count> 0; 00207 }
| bool fillLayerCombo | ( | TeDatabase * | db, | |
| TeGeomRep | rep, | |||
| QComboBox * | lColumnCombo, | |||
| const string & | current, | |||
| bool | clear | |||
| ) |
Definition at line 247 of file TeGUIUtils.cpp.
References TeDatabase::layerMap().
00248 { 00249 int cur=0; 00250 if (clear) 00251 lColumnCombo->clear(); 00252 else 00253 cur=lColumnCombo->count(); 00254 00255 TeLayerMap& layerMap = db->layerMap(); 00256 TeLayerMap::iterator itlay = layerMap.begin(); 00257 int i=0; 00258 while ( itlay != layerMap.end() ) 00259 { 00260 if ((*itlay).second->geomRep() & rep) 00261 { 00262 lColumnCombo->insertItem((*itlay).second->name().c_str()); 00263 if ((*itlay).second->name() == current) 00264 cur += i; 00265 ++i; 00266 } 00267 ++itlay; 00268 } 00269 lColumnCombo->setCurrentItem(cur); 00270 return i>0; 00271 }
| bool fillTableCombo | ( | TeView * | view, | |
| QComboBox * | cTableCombo, | |||
| QComboBox * | cThemeCombo, | |||
| string | selName, | |||
| bool | clear, | |||
| TeAttrTableType | tableType | |||
| ) |
Definition at line 115 of file TeGUIUtils.cpp.
References TeView::get(), TeTable::name(), and NULL.
00119 { 00120 TeTable ttable; 00121 string tableName; 00122 string themeName = string(cThemeCombo->currentText().ascii()); 00123 TeTheme* currTheme = view->get(themeName); 00124 00125 if (currTheme == NULL) 00126 return false; 00127 00128 TeAttrTableVector atvec; 00129 currTheme->getAttTables(atvec, tableType); 00130 00131 if (atvec.size() == 0) 00132 return false; 00133 00134 if (clear) 00135 cTableCombo->clear(); 00136 int idx = 0; 00137 00138 for(unsigned int i=0; i<atvec.size(); i++) 00139 { 00140 TeTable ttable = atvec[i]; 00141 tableName = ttable.name(); 00142 cTableCombo->insertItem(tableName.c_str()); 00143 if(selName.compare(tableName)) 00144 { 00145 idx = i; 00146 } 00147 } 00148 00149 cTableCombo->setCurrentItem(idx); 00150 return true; 00151 }
Definition at line 83 of file TeGUIUtils.cpp.
References TeViewNode::name(), TeView::themes(), and TeViewNode::type().
00084 { 00085 vector<TeViewNode *> themeVec = view->themes(); 00086 00087 if (clear) 00088 cBox->clear(); 00089 00090 int idx = 0; 00091 int count = 0; 00092 00093 for(unsigned int i=0; i<themeVec.size(); i++) 00094 { 00095 TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i]; 00096 if (t->type() >= 2) 00097 continue; 00098 cBox->insertItem(t->name().c_str()); 00099 if (!t->name().compare(selName)) 00100 { 00101 idx = count; 00102 } 00103 count++; 00104 } 00105 00106 if (count > 0) 00107 { 00108 cBox->setCurrentItem(idx); 00109 } 00110 00111 return (count > 0); 00112 }
| bool fillThemeCombo | ( | vector< TeGeomRep > & | tg, | |
| TeView * | view, | |||
| QComboBox * | cBox, | |||
| string | selName, | |||
| bool | clear | |||
| ) |
Definition at line 39 of file TeGUIUtils.cpp.
References TeViewNode::name(), TeView::themes(), TeViewNode::type(), and TeAbstractTheme::visibleGeoRep().
00040 { 00041 if(clear) 00042 cBox->clear(); 00043 00044 vector<TeViewNode *> themeVec = view->themes(); 00045 if (clear) 00046 cBox->clear(); 00047 00048 int idx = 0; 00049 int count = 0; 00050 00051 for(unsigned int i=0; i<themeVec.size(); i++) 00052 { 00053 TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i]; 00054 if (t->type() >= 2) 00055 continue; 00056 00057 bool hasGeomRep = false; 00058 for(unsigned int j=0; j<tg.size(); ++j) 00059 { 00060 if(t->visibleGeoRep() & tg[j]) 00061 hasGeomRep = true; 00062 } 00063 00064 if(hasGeomRep) 00065 { 00066 cBox->insertItem(t->name().c_str()); 00067 if (!t->name().compare(selName)) 00068 { 00069 idx = count; 00070 } 00071 count++; 00072 } 00073 } 00074 00075 if (count > 0) 00076 { 00077 cBox->setCurrentItem(idx); 00078 } 00079 00080 return (count > 0); 00081 }
Definition at line 6 of file TeGUIUtils.cpp.
References TeViewNode::name(), TeView::themes(), TeViewNode::type(), and TeAbstractTheme::visibleGeoRep().
00007 { 00008 // bool enableWindow = false; 00009 00010 if (clear) 00011 cBox->clear(); 00012 00013 int idx = 0; 00014 int count = 0; 00015 00016 vector<TeViewNode *>& themeVec = view->themes(); 00017 for(unsigned int i=0; i<themeVec.size(); i++) 00018 { 00019 TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i]; 00020 if(t->type() < 2 && t->visibleGeoRep() & tg) 00021 { 00022 cBox->insertItem(t->name().c_str()); 00023 if (!t->name().compare(selName)) 00024 { 00025 idx = count; 00026 } 00027 count++; 00028 } 00029 } 00030 00031 if (count > 0) 00032 { 00033 cBox->setCurrentItem(idx); 00034 } 00035 00036 return (count > 0); 00037 }
1.5.3