Changeset 4198 in ntrip


Ignore:
Timestamp:
May 21, 2012, 2:58:22 PM (12 years ago)
Author:
weber
Message:

Character size modified

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 * -----------------------------------------------------------------------*/
    439 
    540#include <iostream>
    641#include "bncmap.h"
    7 
    842
    943// ------------
     
    180214  slotCreateMap();
    181215
    182   float fontsize  = _mapView->scale_rate();
    183   float pointsize = _mapView->scale_rate();
     216  float fontrate  = _mapView->scale_rate();
     217  float pointrate = _mapView->scale_rate();
    184218   
    185219  QMapIterator<QString, QList<QVariant> >  it(_allNames);
     
    196230     double basFT = tmp.at(3).toDouble();
    197231     
    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));
    202241           font.setPointSizeF( tmpFT );
     242           font.setStretch(QFont::Unstretched);
     243           font.setCapitalization(QFont::Capitalize);
    203244
    204245     QGraphicsTextItem* nameItem = new QGraphicsTextItem( name );
    205246     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;
    214251     pen.setWidthF(tmpPT);
    215252
     
    225262
    226263  _mapView->zoom( 1.2 );
     264  slotFitFont();
    227265}
    228266
     
    232270
    233271  _mapView->zoom( 1/1.2 );
     272  slotFitFont();
    234273}
    235274
     
    252291    tmp << tmppoint      // QPoint
    253292        << pen           // QPen
    254         << size << 4.5;  // base pointsize, fontsize
     293        << size << 4.5;  // base pointsize, fontrate
    255294    _allNames.insert( name, tmp );
    256295  }
Note: See TracChangeset for help on using the changeset viewer.