1 Star 0 Fork 42

张洛宜/easygis

forked from qizr/easygis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
maparea.cpp 965 Bytes
一键复制 编辑 原始数据 按行查看 历史
张洛宜 提交于 2022-01-15 23:49 +08:00 . windows vs2017 Qt5.13.2编译
#include "maparea.h"
#include "include/maplayer.h"
#include <QPainter>
#include <QDateTime>
#pragma execution_character_set("utf-8")
void EasyGIS::Maparea::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter->setPen(this->pen());
painter->setBrush(this->brush());
double r=mLayer->resolution();
QPolygonF scene_points;
foreach(QPointF point,this->mkt_points){
scene_points.append(point/r);
}
painter->drawPolygon(scene_points);
}
QRectF EasyGIS::Maparea::boundingRect() const
{
if(this->mkt_points.size()==0){
return QRectF();
}
double r=mLayer->resolution();
QRectF rect= this->mkt_points.boundingRect();
return QRectF(rect.x()/r,rect.y()/r,rect.width()/r,rect.height()/r);
}
void EasyGIS::Maparea::append(QPointF mkt_point)
{
this->mkt_points.append(mkt_point);
}
QPointF &EasyGIS::Maparea::lastMktpoint()
{
return this->mkt_points.last();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/muye91/easygis.git
[email protected]:muye91/easygis.git
muye91
easygis
easygis
master

搜索帮助