Adds initial intermediate qt6 porting state
This commit is contained in:
11247 files changed
+1891537
No files matched your search
@@ -0,0 +1,354 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <GeometryModel/geometry_model.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
|
||||
#include <Map/map.h>
|
||||
#include <MapObjects/participant.h>
|
||||
#include <Common/simple_value.h>
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include "plan_editor_export.h"
|
||||
|
||||
class QListWidgetItem;
|
||||
class QTreeWidget;
|
||||
class QTransform;
|
||||
class QTextEdit;
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
class Map;
|
||||
class PBTB_ID;
|
||||
namespace RB
|
||||
{
|
||||
class RubberbandBase;
|
||||
class Rubberband;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace LtsWidgets
|
||||
{
|
||||
class LtsBaseLayoutWidget;
|
||||
class LtsFramelessDialog;
|
||||
class LtsDialog;
|
||||
}
|
||||
|
||||
|
||||
namespace LtsSession
|
||||
{
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
|
||||
namespace PlanEditor
|
||||
{
|
||||
|
||||
class PlanEditorSession;
|
||||
|
||||
|
||||
|
||||
class PLANEDITOR_EXPORT PlanEditor : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class LookupSymbolManager;
|
||||
friend class ModelTreeWidget;
|
||||
friend class FavouritesActionManager;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PlanEditor(SituationMap::Map *map, LtsWidgets::LtsBaseLayoutWidget *ltsbaseWidget);
|
||||
|
||||
|
||||
|
||||
PlanEditor(SituationMap::Map *map, LtsSession::LtsSession *ltsSession);
|
||||
|
||||
virtual ~PlanEditor();
|
||||
|
||||
|
||||
|
||||
bool event( QEvent *e) override;
|
||||
|
||||
|
||||
|
||||
bool readyForUse() const;
|
||||
|
||||
|
||||
|
||||
QWidget *topLevelWidget() const;
|
||||
|
||||
|
||||
|
||||
QString title() const;
|
||||
|
||||
|
||||
QString planDefaultDirectory() const;
|
||||
void setPlanDefaultDirectory(const QString &dir);
|
||||
|
||||
|
||||
|
||||
bool setPlan(const QByteArray &xmlContent);
|
||||
bool importPlan( const QByteArray &xmlContent);
|
||||
|
||||
|
||||
void setNameOfPlan(const QString & planName);
|
||||
|
||||
void saveToFile(const QString &filePath);
|
||||
void loadFromFile(const QString &filePath);
|
||||
|
||||
void setSelected(SituationMap::UniqueMapId, bool on = true, bool enableShowDialogTab = true);
|
||||
void setSelected(const SituationMap::GeometryModel::Node &, bool on = true, bool enableShowDialogTab = true);
|
||||
|
||||
bool isSelected(SituationMap::UniqueMapId);
|
||||
bool isSelected(const SituationMap::GeometryModel::Node &);
|
||||
|
||||
|
||||
|
||||
SituationMap::UniqueMapId getIdFromNode(const SituationMap::GeometryModel::Node &p) const;
|
||||
|
||||
SituationMap::GeometryModel::Node buildTextNode(const QPointF &loc);
|
||||
|
||||
void buildTextBoxPixelNode(const QPointF &locPixel);
|
||||
void writeTextBoxDataToModel();
|
||||
|
||||
void setParticipantsSidcsInUse(const QSet<QString> &sidcs);
|
||||
|
||||
|
||||
|
||||
void setAllSymbolFavourites(const QString &xmlContent);
|
||||
|
||||
|
||||
|
||||
QString allSymbolFavouritesToString() const;
|
||||
|
||||
|
||||
|
||||
void requestFileServiceReadDefaultSymbolFavourites() { emit fileServiceReadDefaultSymbolFavourites(); }
|
||||
void requestFileServiceReadSymbolFavourites(QString &xmlString) { emit fileServiceReadSymbolFavourites(xmlString); }
|
||||
void requestFileServiceStoreSymbolFavourites(const QString &xmlString) { emit fileServiceStoreSymbolFavourites(xmlString); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool isSymbolModelValid() const;
|
||||
|
||||
|
||||
|
||||
|
||||
void installSaveFunction(const std::function<void()> &saveFunction = nullptr);
|
||||
|
||||
void checkFromEmptyPlan();
|
||||
|
||||
class InternalData;
|
||||
|
||||
std::unique_ptr<InternalData> m_internal;
|
||||
|
||||
public slots:
|
||||
|
||||
void onEnablePlanEditor();
|
||||
void onDisablePlanEditor();
|
||||
|
||||
void onEnableSymbolWidgets();
|
||||
|
||||
void onRubberbandAction();
|
||||
|
||||
void onHideDialogTab();
|
||||
void onShowDialogTab(const SituationMap::GeometryModel::Node &node = SituationMap::GeometryModel::Node());
|
||||
|
||||
void onTextEditDialogRequested(const SituationMap::PBTB_ID &pbtbId);
|
||||
void onTextEditGeometryChanged(const SituationMap::PBTB_ID &pbtbId);
|
||||
void onTextEditRemoveRequested(const SituationMap::PBTB_ID &pbtbId);
|
||||
|
||||
void onMapObjectClicked(const SituationMap::Map::RefPointerMapObjectList &mapObjList);
|
||||
|
||||
void onContextMenuRequested(const SituationMap::Map::RefPointerMapObjectList &mapObjList, const QPointF &viewportPosition);
|
||||
|
||||
void onAskSaveChanges();
|
||||
void onAskRejectChanges(bool &reject);
|
||||
void onSignalClose();
|
||||
|
||||
void onQuit();
|
||||
void onViewHelp();
|
||||
void onShowHelp();
|
||||
void onViewAbout();
|
||||
|
||||
void onGeoModelModified(unsigned int modifyCount);
|
||||
|
||||
void onNoticeGeoModelTypeError(const QString &);
|
||||
void onNoticeGeoModelAttributeError(const QString &);
|
||||
void onNoticeGeoModelModelError(const QString &);
|
||||
void onNoticeGeoModelError(const QString &);
|
||||
|
||||
void onNoticeGeoModelUpdate(const SituationMap::GeometryModel::Node &node, SituationMap::GeometryModel::Attribute att, bool coordsChanged);
|
||||
|
||||
void onPlanReset();
|
||||
|
||||
void onPlanCreate();
|
||||
void onPlanLoad();
|
||||
|
||||
void onPlanSave();
|
||||
void onPlanSaveAs();
|
||||
void onPlanAutoSave();
|
||||
void onPlanImport();
|
||||
void onPlanSaveSelected();
|
||||
void onPlanPrint();
|
||||
void onMetaData();
|
||||
|
||||
void onUndo();
|
||||
void onRedo();
|
||||
void onUndoHistory();
|
||||
void onRedoHistory();
|
||||
|
||||
void onDelete();
|
||||
|
||||
void onCopy();
|
||||
void onCut();
|
||||
void onPaste();
|
||||
|
||||
void onGroup();
|
||||
void onUngroup();
|
||||
|
||||
void onEditAttributes();
|
||||
void onEditGraphicGeometry();
|
||||
void onMoveGraphicGeometry();
|
||||
void onRotateGraphicGeometry();
|
||||
void onScaleGraphicGeometry();
|
||||
|
||||
void onChooseSymbol();
|
||||
|
||||
void onRubberbandAbort(SituationMap::RB::RubberbandBase *rubberband);
|
||||
void onSymbolCreate(SituationMap::RB::RubberbandBase *rubberband, bool createParticipant = false);
|
||||
void onLineCreate(SituationMap::RB::RubberbandBase *rubberband);
|
||||
void onPolylineCreate(SituationMap::RB::RubberbandBase *rubberband);
|
||||
void onPolygonCreate(SituationMap::RB::RubberbandBase *rubberband);
|
||||
void onRectangleCreate(SituationMap::RB::RubberbandBase *rubberband);
|
||||
void onTextLineCreate(SituationMap::RB::RubberbandBase *rubberband);
|
||||
|
||||
void onTextBoxPixelCreate(SituationMap::RB::RubberbandBase *rubberband);
|
||||
void onTextBoxPixelTextChanged(const QString &htmlText);
|
||||
void onTextBoxPixelBackgroundColorChanged(const QColor &backgroundColor);
|
||||
void onTextBoxPixelTextApplied(const QString &htmlText);
|
||||
void onTextBoxPixelCanceled();
|
||||
void onTextBoxPixelClosed();
|
||||
|
||||
void onTransformMove(SituationMap::RB::RubberbandBase *rubberband);
|
||||
void onTransformRotate(SituationMap::RB::RubberbandBase *rubberband);
|
||||
void onTransformScale(SituationMap::RB::RubberbandBase *rubberband);
|
||||
|
||||
SituationMap::RB::Rubberband *onSymbolCreateRubberband(const QString ¤tSidc, bool createParticipant);
|
||||
|
||||
SituationMap::RB::Rubberband *onLineCreateRubberband();
|
||||
SituationMap::RB::Rubberband *onPolylineCreateRubberband();
|
||||
SituationMap::RB::Rubberband *onPolygonCreateRubberband();
|
||||
SituationMap::RB::Rubberband *onRectangleCreateRubberband();
|
||||
SituationMap::RB::Rubberband *onSmoothLineCreateRubberband();
|
||||
SituationMap::RB::Rubberband *onEllipseCreateRubberband();
|
||||
SituationMap::RB::Rubberband *onTextLineCreateRubberband();
|
||||
SituationMap::RB::Rubberband *onTextBoxPixelCreateRubberband();
|
||||
|
||||
|
||||
void onClearSelection();
|
||||
|
||||
void onCenterViewSelected();
|
||||
|
||||
void onSymbolModified( AdvancedSymbology::SymbologyType symbologyType
|
||||
, const QString &sidcPattern
|
||||
, const QString &symbolAttributes
|
||||
, const SituationMap::SimpleValue<AdvancedSymbology::Injury> &participantState
|
||||
, const SituationMap::SimpleValue<int> &participantPartyId
|
||||
, const SituationMap::SimpleValue<int> &participantDamageId
|
||||
, const QMap<SituationMap::Participant::TextModifier, SituationMap::SimpleValue<QString>> &participantTextModifier );
|
||||
|
||||
void onSymbolXmlAttrModified(const QString & undoToken, SituationMap::GeometryModel::Attribute attribute, const QVariant &value);
|
||||
|
||||
void onUpdateView();
|
||||
|
||||
void onTransformRubberband();
|
||||
|
||||
void updateSelectedFeature(const QString &undoToken);
|
||||
|
||||
void addStyleAttributes(const SituationMap::GeometryModel::Node &, bool prepareUndo = true, bool changedAttrOnly = true);
|
||||
|
||||
protected:
|
||||
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
void initializePlan();
|
||||
void initializePlanTextBoxPixel();
|
||||
|
||||
void buildSelectionModeBox(const PlanEditorSession &, bool retranslate = false);
|
||||
void buildFileBox(const PlanEditorSession &, bool retranslate = false);
|
||||
void buildEditBox(const PlanEditorSession &, bool retranslate = false);
|
||||
void buildCreateBox(const PlanEditorSession &, bool retranslate = false);
|
||||
void buildHelpBox(const PlanEditorSession &, bool retranslate = false);
|
||||
|
||||
LtsWidgets::LtsDialog *buildDebugBox(QWidget *parent);
|
||||
|
||||
void importFromFile(const QString &filePath);
|
||||
void saveSelectedToFile(const QString &filePath);
|
||||
|
||||
void doPicking(const SituationMap::Map::RefPointerMapObjectList &mapObjList);
|
||||
|
||||
|
||||
void getSymbolAttributes(const SituationMap::GeometryModel::Node &);
|
||||
|
||||
void removeFeature(SituationMap::UniqueMapId itemId, bool prepareUndo = true);
|
||||
|
||||
SituationMap::GeometryModel::Node addGeoModelPrimitive(SituationMap::GeometryModel::PrimitiveType type
|
||||
, const QList<QPointF> &points
|
||||
, const QList<QPair<SituationMap::GeometryModel::Attribute, QVariant>> &attributes
|
||||
, int userData = SituationMap::IdHandler::BadId
|
||||
, const QString &textData = QString()
|
||||
, SituationMap::GeometryModel::HorizontalAlign textAlign = SituationMap::GeometryModel::HorizontalAlign::Left);
|
||||
|
||||
template<class RubberbandTransformClass> void createTransformRubberband();
|
||||
|
||||
void showHistory(QPointer<LtsWidgets::LtsFramelessDialog> &dlgHistory
|
||||
, QTreeWidget *&lwHistory
|
||||
, const QString &title
|
||||
, const QStringList &history);
|
||||
|
||||
qulonglong createSymbolDropEvent(const QString &sidc);
|
||||
|
||||
private:
|
||||
|
||||
void init();
|
||||
|
||||
void abortCurrentBboxRubberband();
|
||||
|
||||
void setSelected(const SituationMap::GeometryModel::Node &, bool on, bool checkParents, bool enableShowDialogTab);
|
||||
|
||||
void getChildNodes(const SituationMap::GeometryModel::Node &node, SituationMap::GeometryModel::NodeList &childNodes);
|
||||
|
||||
signals:
|
||||
|
||||
void modifyFeatureStyle(const QString &undoToken);
|
||||
|
||||
|
||||
|
||||
void quitPlanEditor();
|
||||
void fileServiceReadDefaultSymbolFavourites();
|
||||
void fileServiceReadSymbolFavourites(QString &xmlString);
|
||||
void fileServiceStoreSymbolFavourites(const QString &);
|
||||
|
||||
|
||||
void symbolModelLoaded();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user