본문으로 건너뛰기
로딩중...
검색중...
일치하는것 없음
FeatureInfoController.h
1#pragma once
2
3#include "features/attributes/FeaturePropertyModel.h"
4#include "gdkqt/GdkQtForward.h"
5#include "gdkqt/QtGdkExport.h"
6
7#include <QObject>
8#include <QPointF>
9#include <QRectF>
10#include <QString>
11#include <QVector>
12
13#include <functional>
14#include <optional>
15
16class QDockWidget;
17class QStatusBar;
18
19namespace GDK {
20class glsMapLayer;
21}
22
23namespace GdkQt {
24
25class AppSettingsManager;
28
35class QT_GDK_API FeatureInfoController final : public QObject
36{
37 Q_OBJECT
38
39public:
56 GdkMapWidget* mapWidget,
58 QDockWidget* dock,
59 SelectionProvider* selectionProvider,
60 AppSettingsManager* settings,
61 QStatusBar* statusBar,
62 QObject* parent = nullptr);
70 void setCanEditAttributesCallback(std::function<bool(const QString&)> callback);
77 void setHasOpenEditSessionCallback(std::function<bool(const QString&)> callback);
78
79public slots:
89 void handleMapClick(const QPointF& devicePos);
96 void handleMapDragSelect(const QRectF& deviceRect); // Info 드래그 다중 선택
104 bool clearInfoSelection(const QString& statusMessage = QString());
121 void showFeatureAt(int index);
128
129signals:
135 void selectionChanged(const QString& layerId, int selectedCount);
136
137private:
138 friend struct FeatureInfoControllerTestAccess;
139 struct InfoSelection {
140 QString layerId;
141 QVector<qint64> featureIds;
142 int currentIndex = 0;
143 // 드래그 다중 선택 시 한 번 빌드하고 이후 내비게이션에서 재사용.
144 // S7 R5: when set, entry i is cachedEntries[i] (its own layerId and
145 // featureId); layerId/featureIds only describe the first entry's layer
146 // and the list length. The multi-layer map selection is published once
147 // by showDragSelection and never rewritten by navigation.
148 QVector<FeatureListEntry> cachedEntries;
149 // S10 F5: the drag query's limit/diagnostic lines. Kept here so that
150 // previous/next/refresh, which rebuild the panel model, show it again.
151 QString noticeText;
152 std::function<bool()> referenceIsCurrent;
153 };
154
157 static QVector<QString> selectionLayerIds(const InfoSelection& selection);
158
160 struct PreparedFeature {
162 std::function<bool()> readGuard;
165 QString skipStatus;
166 };
167
168 bool showFeature(const QString& layerId,
169 qint64 fid,
170 int currentIndex,
171 int totalCount,
172 const QVector<qint64>& selectedFeatureIds,
173 QVector<FeatureListEntry>* ioEntries,
174 QString* outError,
175 bool publishSelection = true,
176 const QString& noticeText = QString());
178 bool prepareFeature(const QString& layerId,
179 qint64 fid,
180 int currentIndex,
181 int totalCount,
182 QVector<FeatureListEntry>* ioEntries,
183 PreparedFeature* out,
184 QString* outError);
186 bool commitFeature(const PreparedFeature& prepared,
187 const QVector<qint64>& selectedFeatureIds,
188 QString* outError,
189 bool publishSelection);
190 bool showVectorTileFeature(const QString& layerId,
191 GDK::glsMapLayer* mapLayer,
192 const GDK::glsHitTestResult& result,
193 QString* outError);
194 bool showSelection(InfoSelection selection, QString* outError);
196 bool showDragSelection(const QRectF& deviceRect, QString* outError);
199 bool presentDragEntries(QVector<FeatureListEntry> entries,
200 const QString& queryDiagnostic,
201 QString* outError);
203 bool prepareDragEntries(QVector<FeatureListEntry> entries,
204 const QString& queryDiagnostic,
205 InfoSelection* selection,
206 PreparedFeature* prepared,
207 QString* outError);
209 bool publishDragEntries(InfoSelection selection,
210 const PreparedFeature& prepared,
211 const QString& queryDiagnostic,
212 QString* outError);
213 QVector<qint64> queryHitFeatureIds(const QString& layerId,
214 const QPointF& devicePos, qint64 hitId,
215 QString* outError);
216 QVector<FeatureListEntry> queryFeaturesInRect(const QRectF& deviceRect,
217 int maxFeatures,
218 QString* outError);
219 bool showCurrentSelection(QString* outError);
220 bool clearLayerSelection(const QString& layerId, QString* outError);
221 void refreshMapSelection() const;
222 bool clearCurrentSelection(const QString& statusMessage = QString());
223 void retryPendingMapClick();
224 void cancelPendingMapClick();
225
226 GdkQtSession* m_session = nullptr;
227 GdkMapWidget* m_mapWidget = nullptr;
228 FeaturePropertyPanel* m_panel = nullptr;
229 QDockWidget* m_dock = nullptr;
230 SelectionProvider* m_selectionProvider = nullptr;
231 AppSettingsManager* m_settings = nullptr;
232 QStatusBar* m_statusBar = nullptr;
233 InfoSelection m_selection;
234 std::function<bool()> m_currentReadGuard;
235 std::function<bool()> m_identifyReadGuard;
236 std::optional<QPointF> m_pendingMapClick;
237 quint64 m_pendingMapClickId = 0;
238 quint64 m_pendingMapViewGeneration = 0;
239 bool m_pendingMapClickIsRetry = false;
240 bool m_pendingTransientInterest = false;
241 std::function<bool(const QString&)> m_canEditAttributes;
242 std::function<bool(const QString&)> m_hasOpenEditSession;
245 std::function<void(QVector<FeatureListEntry>&)> m_testDragEntriesHook;
246};
247
248} // namespace GdkQt
void showNextFeature()
정보 선택의 다음 피처를 보여 줍니다.
void selectionChanged(const QString &layerId, int selectedCount)
레이어의 정보 선택이 바뀌었을 때 UI 스레드에서 발생합니다.
FeatureInfoController(GdkQtSession *session, GdkMapWidget *mapWidget, FeaturePropertyPanel *panel, QDockWidget *dock, SelectionProvider *selectionProvider, AppSettingsManager *settings, QStatusBar *statusBar, QObject *parent=nullptr)
정보 조회 컨트롤러를 만들고 패널과 지도 위젯의 시그널에 연결합니다.
~FeatureInfoController() override
대기 중인 클릭 조회를 취소하고 컨트롤러를 파괴합니다.
void showFeatureAt(int index)
정보 선택의 지정한 위치의 피처를 보여 줍니다.
void setHasOpenEditSessionCallback(std::function< bool(const QString &)> callback)
레이어의 편집 세션이 이미 열려 있는지 알려 주는 콜백을 설치합니다.
void setCanEditAttributesCallback(std::function< bool(const QString &)> callback)
레이어의 속성을 편집할 수 있는지 알려 주는 콜백을 설치합니다.
void handleMapClick(const QPointF &devicePos)
기기 픽셀 클릭 위치 주변의 피처를 조회합니다.
void showPreviousFeature()
정보 선택의 이전 피처를 보여 줍니다.
void handleMapDragSelect(const QRectF &deviceRect)
기기 픽셀 사각형 안의 여러 피처를 조회합니다.
bool clearInfoSelection(const QString &statusMessage=QString())
현재 정보 선택을 지우고, 메시지가 있으면 상태 표시줄에 씁니다.
void refreshCurrentFeature()
현재 피처를 다시 읽어 패널을 새로 고칩니다.
정보 조회(Identify)와 선택 작업에서 쓰는 피처 상세 패널입니다.
정의 FeaturePropertyPanel.h:28
GdkQtSession의 지도를 보여 주는 재사용 가능한 Qt Widgets 지도 위젯입니다.
정의 GdkMapWidget.h:79
워크스페이스를 소유하고 지도와 데이터 작업을 Qt 형식으로 제공하는 세션입니다.
정의 GdkQtSession.h:39
GDK::glsSelectionService를 Qt 형식으로 감싼 선택 읽기와 쓰기 창구입니다.
정의 SelectionProvider.h:24
QString statusMessage(GDK::glsStatus status, const QString &context)
상태와 문맥 문자열로 오류 메시지를 만듭니다.
glsGdkQt의 공개 형식과 함수가 있는 네임스페이스입니다.
정의 AppSettings.h:15
FeaturePropertyPanel에 넘기는 피처 정보 스냅숏입니다.
정의 FeaturePropertyModel.h:50