|
|
|
@ -315,13 +315,26 @@ void UGSTDCALL AfterPointInputCallback(UGlong pWnd, UGdouble &dx, UGdouble &dy,
|
|
|
|
|
void UGSTDCALL GeometrySelectedCallback(UGlong pWnd, UGint nSelectedGeometryCount)
|
|
|
|
|
{//左键点击选中触发
|
|
|
|
|
qDebug()<<"**************************GeometrySelectedCallback";
|
|
|
|
|
qDebug()<<"**************************nSelectedGeometryCount:"<<nSelectedGeometryCount;
|
|
|
|
|
QMapControl* pControl = (QMapControl*)pWnd;
|
|
|
|
|
// qDebug()<<"**************************nSelectedGeometryCount:"<<nSelectedGeometryCount;
|
|
|
|
|
QMapControl* pMapControl = (QMapControl*)pWnd;
|
|
|
|
|
if(pMapControl->getEditStatus())
|
|
|
|
|
{//编辑模式下设置当前选中图层可编辑
|
|
|
|
|
UGLayer* selectedLayer = pMapControl->getSelectionLayer();
|
|
|
|
|
if(!selectedLayer->IsEditable())
|
|
|
|
|
{
|
|
|
|
|
pMapControl->setEditable(pMapControl->getSelectionLayer(),true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
selectedLayer = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pMapControl = NULL;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
LayerOperator LO;
|
|
|
|
|
QMap<int,QStringList> featureInfo;
|
|
|
|
|
featureInfo = LO.getSelectedFeature(pControl->GetMap());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QStringList filterlist;
|
|
|
|
|
QList<int> types = featureInfo.keys();
|
|
|
|
|
for(int i = 0; i < types.size(); i++)
|
|
|
|
@ -330,6 +343,7 @@ void UGSTDCALL GeometrySelectedCallback(UGlong pWnd, UGint nSelectedGeometryCoun
|
|
|
|
|
}
|
|
|
|
|
QString filter = filterlist.join(" or ");
|
|
|
|
|
qDebug()<<"**************************GeometryID:"<< filter;
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2349,6 +2363,35 @@ void MainWindow::Edit()
|
|
|
|
|
|
|
|
|
|
if(mapType==MapType::Map2D)
|
|
|
|
|
{
|
|
|
|
|
if(!qMapControl->getEditStatus())
|
|
|
|
|
{
|
|
|
|
|
qMapControl->setEditStatus(true);
|
|
|
|
|
qMapControl->GetMap()->m_Layers.ClearLayersSelection();
|
|
|
|
|
qMapControl->GetMap()->m_DynamicLayers.RemoveAll();
|
|
|
|
|
actionStartEdit->setIcon(QIcon(":/Resources/Edit.png"));
|
|
|
|
|
actionEditNode->setEnabled(true);
|
|
|
|
|
qMapControl->Refresh();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
qMapControl->setEditStatus(false);
|
|
|
|
|
UGLayers* layers = &qMapControl->GetMap()->m_Layers;
|
|
|
|
|
UGLayer* editLayer = layers->GetEditableLayer().GetHead();
|
|
|
|
|
// layers->SetEditableLayer(editLayer,false);
|
|
|
|
|
qMapControl->setEditable(editLayer,false);
|
|
|
|
|
|
|
|
|
|
actionStartEdit->setIcon(QIcon(":/Resources/Edit1.png"));
|
|
|
|
|
actionEditNode->setIcon(QIcon(":/Resources/EditNode1.png"));
|
|
|
|
|
actionEditNode->setEnabled(false);
|
|
|
|
|
|
|
|
|
|
LayerOperator layerOpt;
|
|
|
|
|
layerOpt.addNodeLabel(qMapControl,editLayer->GetSelection()->ToRecordset(false));
|
|
|
|
|
editLayer->ClearSelection();
|
|
|
|
|
qMapControl->Refresh();
|
|
|
|
|
if(editLayer!=NULL)
|
|
|
|
|
qDebug()<<"****************editLayer:"<<Translator::UGStr2QStr(editLayer->GetName());
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
UGLayer* editLayer = qMapControl->getSelectionLayer();
|
|
|
|
|
if(editLayer!=NULL)
|
|
|
|
|
{
|
|
|
|
@ -2356,11 +2399,11 @@ void MainWindow::Edit()
|
|
|
|
|
{//开启编辑
|
|
|
|
|
qDebug()<<"***********************OpenEdit:";
|
|
|
|
|
qMapControl->setEditable(editLayer,true);
|
|
|
|
|
actionStartEdit->setIcon(QIcon(":/Resources/Edit.png"));
|
|
|
|
|
// actionEditNode->setIcon(QIcon(":/Resources/EditNode.png"));
|
|
|
|
|
qMapControl->GetMap()->m_DynamicLayers.RemoveAll();
|
|
|
|
|
qMapControl->Refresh();
|
|
|
|
|
|
|
|
|
|
actionStartEdit->setIcon(QIcon(":/Resources/Edit.png"));
|
|
|
|
|
//actionEditNode->setIcon(QIcon(":/Resources/EditNode.png"));
|
|
|
|
|
actionEditNode->setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -2378,21 +2421,52 @@ void MainWindow::Edit()
|
|
|
|
|
}
|
|
|
|
|
editLayer = NULL;
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//三维
|
|
|
|
|
UGLayer3DDatasetVector* pLayer3D = (UGLayer3DDatasetVector*)pSceneControl->GetUGLayer3Ds()->AddLayer(_U("FlightLines3D@Route")); //
|
|
|
|
|
UGQueryDef queryDef;
|
|
|
|
|
queryDef.m_nOptions = UGQueryDef::Both; //查询选项:几何对象(Geometry)和属性(Attribute)都查询
|
|
|
|
|
queryDef.m_nType = UGQueryDef::General; //查询类型:一般的数下条件查询
|
|
|
|
|
queryDef.m_nMode = UGQueryDef::GeneralQuery; //查询模式:一般查询(非模糊查询)
|
|
|
|
|
queryDef.m_nCursorType = UGQueryDef::OpenStatic; //OpenStatic,用于读取数据;OpenDynamic,用于数据增删改
|
|
|
|
|
queryDef.m_strFilter = _U("RouteNumber =2 and RouteType=1"); //查询条件
|
|
|
|
|
pLayer3D->SetDisplayFilter(queryDef);
|
|
|
|
|
|
|
|
|
|
LayerOperator layerOpt;
|
|
|
|
|
if(!pSceneControl->GetEditStatus())
|
|
|
|
|
{//开启编辑
|
|
|
|
|
pSceneControl->SetEditStatus(true);
|
|
|
|
|
pSceneControl->GetUGLayer3Ds()->ReleaseAllSelection();
|
|
|
|
|
pSceneControl->GetTrackingLayer3D()->RemoveAll();
|
|
|
|
|
|
|
|
|
|
actionStartEdit->setIcon(QIcon(":/Resources/Edit.png"));
|
|
|
|
|
// actionEditNode->setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//关闭编辑
|
|
|
|
|
pSceneControl->SetEditStatus(false);
|
|
|
|
|
pSceneControl->SetEditableLayer(pSceneControl->GetUGLayer3Ds()->GetCurrrentLayer(),false);
|
|
|
|
|
actionStartEdit->setIcon(QIcon(":/Resources/Edit1.png"));
|
|
|
|
|
actionEditNode->setIcon(QIcon(":/Resources/EditNode1.png"));
|
|
|
|
|
layerOpt.showNodeLabel3D(pSceneControl);
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
UGLayer3D* editLayer3D = pSceneControl->GetSelectionLayer();
|
|
|
|
|
if(editLayer3D!=NULL)
|
|
|
|
|
{
|
|
|
|
|
if(!editLayer3D->GetEditable())
|
|
|
|
|
{
|
|
|
|
|
pSceneControl->SetEditableLayer(editLayer3D,true);
|
|
|
|
|
pSceneControl->GetTrackingLayer3D()->RemoveAll();
|
|
|
|
|
|
|
|
|
|
actionStartEdit->setIcon(QIcon(":/Resources/Edit.png"));
|
|
|
|
|
actionEditNode->setEnabled(true);
|
|
|
|
|
qDebug()<<"*********************EditLayerName1:"<<Translator::UGStr2QStr(pSceneControl->GetUGLayer3Ds()->GetCurrrentLayer()->GetName());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pSceneControl->SetEditableLayer(editLayer3D,false);
|
|
|
|
|
actionStartEdit->setIcon(QIcon(":/Resources/Edit1.png"));
|
|
|
|
|
actionEditNode->setIcon(QIcon(":/Resources/EditNode1.png"));
|
|
|
|
|
actionEditNode->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
qDebug()<<"*********************1:"<<pSceneControl->GetUGLayer3Ds()->GetInnerCount();
|
|
|
|
|
// qDebug()<<"*********************1:"<<pSceneControl->GetUGLayer3Ds()->GetInnerCount();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|