Add frozen TikZRefinery demo baseline and build pipeline
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include "model/EditorTypes.h"
|
||||
#include "geometry/tkrCoordinateMapper.h"
|
||||
#include "plugins/tkrShapePluginStore.h"
|
||||
|
||||
#include <QGraphicsScene>
|
||||
|
||||
namespace TikzRefinery {
|
||||
|
||||
class tkrCoordinateMapper;
|
||||
|
||||
// Owns graphics items. Source bytes, file access and parsing stay outside the scene.
|
||||
class tkrDiagramScene final : public QGraphicsScene
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit tkrDiagramScene(QObject *pParent = nullptr, const QString &strRectangleModule = {});
|
||||
OperationResult displayElements(const QVector<ElementRecord> &vecElements,
|
||||
const tkrCoordinateMapper &coordinateMapper,
|
||||
const ComparisonExtent &comparisonExtent = {});
|
||||
void resetDiagram();
|
||||
bool hasFixedBounds() const;
|
||||
OperationResult previewGeometry(quint64 uElementId, quint64 uDocumentRevision,
|
||||
const QPointF &ptFirstScene, const QPointF &ptSecondScene, bool bResize);
|
||||
void selectElement(quint64 uElementId);
|
||||
void cancelInteraction();
|
||||
const tkrShapeProvider *shapeProvider() const;
|
||||
QString pluginDescription() const;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *pEvent) override;
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *pEvent) override;
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *pEvent) override;
|
||||
void keyPressEvent(QKeyEvent *pEvent) override;
|
||||
void focusOutEvent(QFocusEvent *pEvent) override;
|
||||
void drawForeground(QPainter *pPainter, const QRectF &rectExposed) override;
|
||||
|
||||
signals:
|
||||
// Initial and current positions are scene coordinates, not viewport pixels.
|
||||
void dragPreviewRequested(const TikzRefinery::DragUpdate &dragUpdate);
|
||||
void dragCommitRequested(const TikzRefinery::DragUpdate &dragUpdate);
|
||||
void dragCancelled();
|
||||
|
||||
private:
|
||||
bool m_bFixedBounds = false;
|
||||
bool m_bDragActive = false;
|
||||
DragUpdate m_dragUpdate;
|
||||
tkrShapePluginStore m_shapePlugins;
|
||||
tkrCoordinateMapper m_mapper;
|
||||
};
|
||||
|
||||
} // namespace TikzRefinery
|
||||
Reference in New Issue
Block a user