Changeset 4198 in ntrip
- Timestamp:
- May 21, 2012, 2:58:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmap.cpp
r3288 r4198 1 // ------------ 2 // author: jan dousa (jan.dousa@pecny.cz) 3 // ------------ 1 // Part of BNC, a utility for retrieving decoding and 2 // converting GNSS data streams from NTRIP broadcasters. 3 // 4 // Copyright (C) 2007 5 // German Federal Agency for Cartography and Geodesy (BKG) 6 // http://www.bkg.bund.de 7 // Czech Technical University Prague, Department of Geodesy 8 // http://www.fsv.cvut.cz 9 // 10 // Email: euref-ip@bkg.bund.de 11 // 12 // This program is free software; you can redistribute it and/or 13 // modify it under the terms of the GNU General Public License 14 // as published by the Free Software Foundation, version 2. 15 // 16 // This program is distributed in the hope that it will be useful, 17 // but WITHOUT ANY WARRANTY; without even the implied warranty of 18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 // GNU General Public License for more details. 20 // 21 // You should have received a copy of the GNU General Public License 22 // along with this program; if not, write to the Free Software 23 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 25 /* ------------------------------------------------------------------------- 26 * BKG NTRIP Client 27 * ------------------------------------------------------------------------- 28 * 29 * Class: bncmap 30 * 31 * Purpose: This class plots map from Ntrip source-table meta data 32 * 33 * Author: J. Dousa, Pecny, Czech Republic 34 * Created: 21-may-2012 35 * 36 * Changes: 37 * 38 * -----------------------------------------------------------------------*/ 4 39 5 40 #include <iostream> 6 41 #include "bncmap.h" 7 8 42 9 43 // ------------ … … 180 214 slotCreateMap(); 181 215 182 float font size = _mapView->scale_rate();183 float point size = _mapView->scale_rate();216 float fontrate = _mapView->scale_rate(); 217 float pointrate = _mapView->scale_rate(); 184 218 185 219 QMapIterator<QString, QList<QVariant> > it(_allNames); … … 196 230 double basFT = tmp.at(3).toDouble(); 197 231 198 float tmpPT = pointsize * basPT; 199 float tmpFT = fontsize * basFT; 200 201 QFont font(QFont("Arial", 2, 1)); 232 float tmpPT = pointrate * basPT; 233 float tmpFT = fontrate * basFT; 234 235 if( fontrate > 1 ){ 236 tmpPT = basPT; 237 tmpFT = basFT; 238 } 239 240 QFont font(QFont("Arial",2)); 202 241 font.setPointSizeF( tmpFT ); 242 font.setStretch(QFont::Unstretched); 243 font.setCapitalization(QFont::Capitalize); 203 244 204 245 QGraphicsTextItem* nameItem = new QGraphicsTextItem( name ); 205 246 nameItem->setFont( font ); 206 207 if( floor(fontsize) < 1 ){ 208 nameItem->setPos( la - 4.0 - floor(fontsize), fi - 5.0 - floor(fontsize) ); 209 }else{ 210 nameItem->setPos( la - 1.0 - floor(fontsize), fi - 4.0 - floor(fontsize) ); 211 } 212 213 if( tmpPT < 0.25 ) tmpPT = 0.25; 247 248 nameItem->setPos( la - basFT, fi - basFT ); 249 250 if( tmpPT < 0.15 ) tmpPT = 0.15; 214 251 pen.setWidthF(tmpPT); 215 252 … … 225 262 { 226 263 _mapView->zoom( 1.2 ); 264 slotFitFont(); 227 265 } 228 266 … … 232 270 { 233 271 _mapView->zoom( 1/1.2 ); 272 slotFitFont(); 234 273 } 235 274 … … 252 291 tmp << tmppoint // QPoint 253 292 << pen // QPen 254 << size << 4.5; // base pointsize, font size293 << size << 4.5; // base pointsize, fontrate 255 294 _allNames.insert( name, tmp ); 256 295 }
Note:
See TracChangeset
for help on using the changeset viewer.