1.第一个可以用自己新建对象访问?我用的是例子带的QMapControl;
2.输出不行啊,没有反应,返回值为零。
还是不行啊,这个窗口交互只要添加这两句语句就好了吗??
UGMapEditorWnd *wnd = new UGMapEditorWnd(); wnd->SetUserAction(UGC::UGDrawParamaters::uaPointModeSelect); wnd->GetEditToolPack()->SetAccessibilityActionPointMode(UGC::UGEditType::EAA_EditPoint);
还是没有节点编辑,只能整条线移动或缩放
可能我的表述有误,需要的节点改变就好比折线上的某一个折点改变后,其他折点不变,重新生成一条线。
顺便问一下,我的工作空间和数据源好像不能自动绑定在一起,就算我使用该工作空间打开数据源。
UGDsConnection *dsc = new UGDsConnection; dsc->m_bReadOnly = false; dsc->m_nType = UGC::UDB; dsc->m_strAlias = L"A"; dsc->m_strServer = Translator::QStr2UGStr(path1); UGDataSource* dd = workspace->OpenDataSource(*dsc);
在保存之前已设置
UGDsConnection *dsc = new UGDsConnection; dsc->m_bReadOnly = false; dsc->m_nType = UGC::UDB; dsc->m_strAlias = L"A"; dsc->m_strServer = Translator::QStr2UGStr(path1); UGDataSource* dd = workspace->OpenDataSource(*dsc); workspace->m_WorkspaceConnection.m_bFailIfExists = false; int ret = workspace->m_DataSources.GetCount(); workspace->Save();
QString path1 = path.replace(".smwu",".udb"); UGDataSource *ds = UGDataSourceManager::CreateDataSource(UGEngineType::UDB); ds->GetConnectionInfo().m_nType = UGC::UDB; ds->GetConnectionInfo().m_bReadOnly = false; //ds->GetConnectionInfo().m_bExclusive = true; ds->GetConnectionInfo().m_strServer = Translator::QStr2UGStr(path1); if(!ds->Create()) { QMessageBox::critical(this, "error", QStringLiteral("creat eror")); }
QString path1 = path.replace(".smwu",".udb"); UGDataSource *ds = UGDataSourceManager::CreateDataSource(UGEngineType::UDB); ds->GetConnectionInfo().m_nType = UGC::UDB; ds->GetConnectionInfo().m_bReadOnly = false; ds->GetConnectionInfo().m_strAlias = L"A"; ds->GetConnectionInfo().m_strServer = Translator::QStr2UGStr(path1); if(ds->Create()) { //默认点数据集创建 UGDatasetVectorInfo* info1 = new UGDatasetVectorInfo (); info1->m_nType = UGC ::UGDataset ::DatasetType ::Point; UGString name1 = ds->GetUnoccupiedDatasetName(_U ("myPoint")); info1->m_strName = name1 ; info1->m_strTableName =name1 ; UGDatasetVector* datasetresult1 = ds->CreateDatasetVector(*info1); //默认线数据集创建 UGDatasetVectorInfo* info2 = new UGDatasetVectorInfo (); info2->m_nType = UGC ::UGDataset ::DatasetType ::Line; UGString name2 = ds->GetUnoccupiedDatasetName(_U("myLine")); info2->m_strName = name2 ; info2->m_strTableName =name2 ; UGDatasetVector * datasetresult2 = ds->CreateDatasetVector(*info2); //默认面数据集创建 UGDatasetVectorInfo* info3 = new UGDatasetVectorInfo (); info3->m_nType = UGC ::UGDataset ::DatasetType ::Region; UGString name3 = ds->GetUnoccupiedDatasetName(_U ("myPlane")); info3->m_strName = name3 ; info3->m_strTableName =name3 ; UGDatasetVector * datasetresult3 = ds->CreateDatasetVector(*info3); } workspace->OpenDataSource(ds->GetConnectionInfo()); workspace->m_WorkspaceConnection.m_bFailIfExists = false;
我在后面有用workspace函数打开,但还是没绑定