master
cbwu 1 year ago
parent ae22b3e422
commit 0a4542e145

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 11.0.3, 2023-11-15T10:01:42. -->
<!-- Written by QtCreator 12.0.1, 2024-01-29T18:39:49. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -37,6 +37,7 @@
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
@ -168,7 +169,9 @@
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges">
<value type="QString">Path=D:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64;D:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\VC\VCPackages;D:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow;D:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;D:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\bin\Roslyn;D:\Program Files\Microsoft Visual Studio\2022\Professional\Team Tools\Performance Tools\x64;D:\Program Files\Microsoft Visual Studio\2022\Professional\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;D:\Program Files\Microsoft Visual Studio\2022\Professional\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;D:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\;D:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;D:\Java\jdk1.8.0_361\bin;D:\Java\jdk1.8.0_361\jre\bin;D:\Qt\5.15.2\msvc2019_64\bin;D:\Qt\5.15.2\mingw81_64\bin;D:\Qt\Tools\mingw810_64\bin;D:\Qt\Tools\QtCreator\bin;D:\supermap-iobjectscpp\bin\bind_x64;D:\supermap-iobjectscpp\bin\bin_x64;D:\Anaconda3;D:\Anaconda3\Scripts;D:\Anaconda3\Library\lib;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\Program Files\nodejs\node_global;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\libnvvp;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\libnvvp;D:\Program Files\nodejs\;D:\Program Files\Microsoft VS Code\bin;D:\Program Files\CMake\bin;C:\Program Files\Git\cmd;D:\vcpkg;E:\OSG3.4\OSG3rdparty\bin;E:\OSG3.4\OSG365\bin;E:\OSG3.4\OSG3rdparty\include;E:\OSG3.4\OSG365\include;C:\Users\wuche\AppData\Local\Microsoft\WindowsApps;D:\Program Files\nodejs\node_global\node_modules;C:\Users\wuche\AppData\Roaming\npm;D:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;D:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;D:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\VC\Linux\bin\ConnectionManagerExe</value>
</valuelist>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
@ -238,8 +241,10 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/supermap-iobjectscpp/MyProject/MapDisplay/MapDisplay.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">D:/supermap-iobjectscpp/MyProject/MapDisplay/MapDisplay.pro</value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>

@ -358,6 +358,8 @@ void GeoFeatureOperator::drawLine(QMapControl *qMapControl, UGDataSource *pDataS
UGMapEditorWnd* pEditorWnd = qMapControl->GetUGMapWnd();
pEditorWnd->SetUserAction(UGDrawParamaters::uaEdit,UGEditType::ET_PolyLine);
// pEditorWnd->SetTrackingStyle(stytest); //设置交互式绘制几何对象时的风格。
// int id = pEditorWnd->GetUserAction();
// int i=0;
}
pMap = NULL;

@ -1,6 +1,8 @@
#include "global.h"
QVector<QString> g_DEMCollection;
QVector<QString> g_DEMCollection; //地形数据集
float g_MaxVoyage = 2000; //最大航程
Global::Global()
{

@ -4,8 +4,8 @@
#include <QVector>
#include <QString>
extern QVector<QString> g_DEMCollection;
extern QVector<QString> g_DEMCollection; //地形数据集
extern float g_MaxVoyage; //最大航程(m)
class Global
{

@ -146,22 +146,35 @@ void UGSTDCALL AfterGeometryAddedCallback(UGlong pWnd, UGbool &bCancel, UGint nG
pControl->resetWayPointLabel();
UGRecordsetPtr editRes = pLayer->GetEditRecordset(); //只包含当前编辑线段的一条记录
// editRes->Edit();
UGGeometry* pGeometry = NULL;
UGGeoLine l;
editRes->GetGeometry(pGeometry);
UGDatasetVector* dv = (UGDatasetVector*)(pLayer->GetDataset().get());
//对地图操作一下防止弹出Dialog后地图消失
QPoint p = pControl->getLMousePressPoint();
pControl->GetUGMapWnd()->OnMouseMove(pControl->getGraphics(),0,Translator::QPoint2UGPoint(p));
//超过最大航程进行告警提示
GeoComputation geoComputation;
double totalLength = geoComputation.getGeometryLength(pGeometry);
if(totalLength>g_MaxVoyage)
{
QMessageBox::warning(NULL,"警告","超过最大航程,请重新设计!");
bCancel = true;
pControl->GetMap()->m_Layers.ClearLayersSelection();
pControl->GetMap()->m_Layers.Remove(pLayer);
pControl->drawMode = 0;
return;
}
//调出航线设置对话框
saveRouteDialog dlg;
dlg.setMaxValue(1);
dlg.setDrawMode(1);
int ret = dlg.exec();
UGGeometry* pGeometry = NULL;
UGGeoLine l;
editRes->GetGeometry(pGeometry);
QMap<QString,QString> fieldsValue;
GeoFeatureOperator geoFtOperator;
RouteGlobalVariant routeGVar;
@ -176,81 +189,25 @@ void UGSTDCALL AfterGeometryAddedCallback(UGlong pWnd, UGbool &bCancel, UGint nG
if(s==1)
{
bCancel = true;
pControl->drawMode = 0;
}
}
if(dlg.isClickedCloseBtn)
{
bCancel = true;
pControl->drawMode = 0;
}
/*
if(ret==QDialog::Accepted)
{
qint16 routeID_dlg = dv->GetObjectCount(); //数量为属性集已有记录数+1
double routeHeight_dlg = dlg.getRouteHeight()[1];
int routeType_dlg = dlg.getRouteType()[1];
int routeNumber_dlg = dlg.getRouteNumber()[1];
UGString routeName_dlg = Translator::QStr2UGStr(dlg.getRouteText()+QString::number(routeNumber_dlg));
QString queryFilter = "RouteType=" + QString::number(routeType_dlg) + " and " +
("RouteNumber=") + QString::number(routeNumber_dlg);
UGRecordsetPtr saveRes = pControl->queryFeature(dv,Translator::QStr2UGStr(queryFilter));
UGGeometry* pTem = NULL;
UGGeoLine l;
if(dlg.isCloseRoute())
{//自动闭合线段
editRes->GetGeometry(pTem,0);
pTem->ConvertToLine(l,0);
UGPoint2D addPoint = l.GetStartNode();
l.InsertPoint(0,l.GetPointCount(),addPoint); //添加首节点
editRes->SetGeometry(l); //替换原线段
editRes->ModifyFieldValue(_U("IsClosedRoute"),1);
}
else
{
editRes->ModifyFieldValue(_U("IsClosedRoute"),0);
}
if(!saveRes->IsEmpty())
{//记录已存在,覆盖
QMessageBox::StandardButton saveBtn;
saveBtn = QMessageBox::question(pControl, u8"提示", u8"航线已存在,是否覆盖?", QMessageBox::Yes|QMessageBox::No);
if (saveBtn == QMessageBox::Yes)
{
saveRes->Edit();
saveRes->SetGeometry(l);
saveRes->ModifyFieldValue(_U("RouteHeight"),UGVariant(routeHeight_dlg));
saveRes->Update();
bCancel = true;
}
else
{
}
}
else
{//航线不存在,新增航线
editRes->ModifyFieldValue(_U("RouteID"),UGVariant(routeID_dlg));
editRes->ModifyFieldValue(_U("RouteNumber"),UGVariant(routeNumber_dlg));
editRes->ModifyFieldValue(_U("RouteType"),UGVariant(routeType_dlg));
editRes->ModifyFieldValue(_U("RouteHeight"),UGVariant(routeHeight_dlg));
editRes->ModifyFieldValue(_U("RouteName"),UGVariant(routeName_dlg));
//提交记录修改
editRes->Update();
}
}
*/
if(ret==QDialog::Rejected)
{
bCancel = true;
pControl->drawMode = 0;
}
// pControl->GetMap()->m_Layers.ClearLayersSelection();
// pControl->GetMap()->m_Layers.Remove(pLayer);
pControl->GetMap()->m_Layers.ClearLayersSelection();
pControl->GetMap()->m_Layers.Remove(pLayer);
dv = NULL;
}
@ -2857,7 +2814,6 @@ void MainWindow::drawPoint()
pointLayer->SetSelectable(true); //设置图层可选择
pUGMap->m_Layers.SetEditableLayer(pointLayer,true);//设置图层可编辑
qMapControl->GetUGMapWnd()->SetUserAction(UGDrawParamaters::uaEdit,UGEditType::ET_Point);
}
else
{

Loading…
Cancel
Save