提交 5a3ad8d6 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

turn gb2312 2 utf8

上级 d776b3a2
#include "osm_frame_widget.h"
#include "osm_frame_widget.h"
#include <QApplication>
int main(int argc, char *argv[])
......
#include "osm_frame_widget.h"
#include "osm_frame_widget.h"
#include "ui_osm_frame_widget.h"
#include <QDir>
#include <QtPlugin>
......@@ -88,15 +88,15 @@ void osm_frame_widget::EnumPlugins()
QStringList filters;
filters << "*.dll";
pluginsDir.setNameFilters(filters);
//查找文件
//查找文件
foreach (QString fileName, pluginsDir.entryList(QDir::Files)) {
QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
QObject *plugin = pluginLoader.instance();//尝试调入Plugin
QObject *plugin = pluginLoader.instance();//尝试调入Plugin
if (plugin) {
layer_interface * pPlugin= qobject_cast<layer_interface *>(plugin);//动态类型转换
if (pPlugin)//具有这个接口
layer_interface * pPlugin= qobject_cast<layer_interface *>(plugin);//动态类型转换
if (pPlugin)//具有这个接口
{
//加入图层
//加入图层
AppendLayer(pPlugin);
}
}
......
#ifndef OSM_FRAME_WIDGET_H
#ifndef OSM_FRAME_WIDGET_H
#define OSM_FRAME_WIDGET_H
#include <QWidget>
......
#include "cProjectionMercator.h"
#include "cProjectionMercator.h"
const double cProjectionMercator::R=6378137;
const double cProjectionMercator::pi=3.1415926535897932384626433832795;
\ No newline at end of file
#pragma once
#pragma once
#include <math.h>
class cProjectionMercator
......
#include <QThread>
#include <QThread>
#include <QCoreApplication>
#include <QPainter>
#include <QSettings>
......
#ifndef LAYER_BROSWER_H
#ifndef LAYER_BROSWER_H
#define LAYER_BROSWER_H
#include <QObject>
......
#ifndef LAYER_BASE_H
#ifndef LAYER_BASE_H
#define LAYER_BASE_H
#include <QObject>
#include <QWidget>
......
#include <QThread>
#include <QThread>
#include <QCoreApplication>
#include <QPainter>
#include <QSettings>
......
#ifndef LAYER_TILES_H
#ifndef LAYER_TILES_H
#define LAYER_TILES_H
#include <QObject>
......
#include "layer_tiles_page.h"
#include "layer_tiles_page.h"
#include "ui_layer_tiles_page.h"
#include "layer_tiles.h"
#include <QSettings>
......
#ifndef LAYER_TILES_PAGE_H
#ifndef LAYER_TILES_PAGE_H
#define LAYER_TILES_PAGE_H
#include <QWidget>
......
#include<QGraphicsView>
#include<QGraphicsView>
#include "tilesviewer.h"
#include <QPainter>
#include <QEvent>
......@@ -307,11 +307,11 @@ void tilesviewer::DragView(int nOffsetX,int nOffsetY)
//set center LLA
void tilesviewer::setCenterLLA(double lat, double lon)
{
//到墨卡托投影
//到墨卡托投影
double dMx = cProjectionMercator(lat,lon).ToMercator().m_x;
double dMy = cProjectionMercator(lat,lon).ToMercator().m_y;
//计算巨幅图片内的百分比
//计算巨幅图片内的百分比
double dCtX = dMx/(cProjectionMercator::pi*cProjectionMercator::R*2);
double dCtY = -dMy/(cProjectionMercator::pi*cProjectionMercator::R*2);
......@@ -342,11 +342,11 @@ void tilesviewer::setCenterLLA(double lat, double lon)
//set center LLA, not emit centerChanged
void tilesviewer::setBrCenterLLA(double lat, double lon)
{
//到墨卡托投影
//到墨卡托投影
double dMx = cProjectionMercator(lat,lon).ToMercator().m_x;
double dMy = cProjectionMercator(lat,lon).ToMercator().m_y;
//计算巨幅图片内的百分比
//计算巨幅图片内的百分比
double dCtX = dMx/(cProjectionMercator::pi*cProjectionMercator::R*2);
double dCtY = -dMy/(cProjectionMercator::pi*cProjectionMercator::R*2);
......@@ -378,26 +378,26 @@ bool tilesviewer::oTVP_LLA2DP(double lat,double lon,qint32 * pX,qint32 *pY)
if (!pX||!pY)
return false;
//到墨卡托投影
//到墨卡托投影
double dMx = cProjectionMercator(lat,lon).ToMercator().m_x;
double dMy = cProjectionMercator(lat,lon).ToMercator().m_y;
//计算巨幅图片内的百分比
//计算巨幅图片内的百分比
double dperx = dMx/(cProjectionMercator::pi*cProjectionMercator::R*2);
double dpery = -dMy/(cProjectionMercator::pi*cProjectionMercator::R*2);
double dCurrImgSize = pow(2.0,m_nLevel)*256;
//计算要转换的点的巨幅图像坐标
//计算要转换的点的巨幅图像坐标
double dTarX = dperx * dCurrImgSize + dCurrImgSize/2;
double dTarY = dpery * dCurrImgSize + dCurrImgSize/2;
//计算当前中心点的巨幅图像坐标
//计算当前中心点的巨幅图像坐标
double dCurrX = dCurrImgSize*m_dCenterX+dCurrImgSize/2;
double dCurrY = dCurrImgSize*m_dCenterY+dCurrImgSize/2;
//计算当前中心的全局坐标
//计算当前中心的全局坐标
double nOffsetLT_x = (dCurrX-width()/2.0);
double nOffsetLT_y = (dCurrY-height()/2.0);
//判断是否在视点内
//判断是否在视点内
*pX = dTarX - nOffsetLT_x+.5;
*pY = dTarY - nOffsetLT_y+.5;
......@@ -411,8 +411,8 @@ bool tilesviewer::oTVP_DP2LLA(qint32 X,qint32 Y,double * plat,double * plon)
{
if (!plat||!plon)
return false;
//显示经纬度
//当前缩放图幅的像素数
//显示经纬度
//当前缩放图幅的像素数
double dCurrImgSize = pow(2.0,m_nLevel)*256;
int dx = X-(width()/2+.5);
int dy = Y-(height()/2+.5);
......
#ifndef TILESVIEWER_H
#ifndef TILESVIEWER_H
#define TILESVIEWER_H
#include <QWidget>
......
#include "urlDownloader.h"
#include "urlDownloader.h"
#include <QNetworkRequest>
#include <QUrl>
#include <QDir>
......
#ifndef URLDOWNLOADER_H
#ifndef URLDOWNLOADER_H
#define URLDOWNLOADER_H
#include <QObject>
#include <QVector>
......
#ifndef VIEWER_INTERFACE_H
#ifndef VIEWER_INTERFACE_H
#define VIEWER_INTERFACE_H
#define OSMViewInterface_iid "org.goldenhawkingStudio.OSMViewer_iid.ViewerInterface"
class viewer_interface{
......
#include "qtvplugin_grid.h"
#include "qtvplugin_grid.h"
#include "ui_qtvplugin_grid.h"
#include <QPainter>
#include <QBrush>
......@@ -46,7 +46,7 @@ void qtvplugin_grid::cb_paintEvent( QPainter * pImage )
if (!m_pVi || m_bVisible==false)
return ;
QRect rect = m_pVi->windowRect();
//首先确定当前视点的LLA
//首先确定当前视点的LLA
double lat_top,lon_left;
double lat_bottom,lon_right;
m_pVi->oTVP_DP2LLA(
......@@ -92,7 +92,7 @@ void qtvplugin_grid::cb_paintEvent( QPainter * pImage )
if (false==m_pVi->oTVP_LLA2DP(lat_bottom,lon,&DP_right,&DP_bottom))
continue;
pImage->drawLine(DP_left,DP_top,DP_right,DP_bottom);
//回环
//回环
int nLon = lon;
while (nLon<-180)
nLon+=360;
......@@ -129,7 +129,7 @@ void qtvplugin_grid::cb_paintEvent( QPainter * pImage )
if (false==m_pVi->oTVP_LLA2DP(lat_bottom,lon,&DP_right,&DP_bottom))
continue;
pImage->drawLine(DP_left,DP_top,DP_right,DP_bottom);
//回环
//回环
float dLon = lon;
while (dLon<-180)
dLon+=360;
......
#ifndef QTVPLUGIN_GRID_H
#ifndef QTVPLUGIN_GRID_H
#define QTVPLUGIN_GRID_H
#include <QWidget>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册