/
Team8
/
kittycad
Обзор
Документация
Войти
/
Team8
/
kittycad
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/gui/document_view.h
116 строк
3 KB
levovix
fix: mistmatch of class/struct in forward declarations
10 дек 2025, 13:58
10 дек 2025, 13:58
2c6bcaf
Код
Авторство
О чём код?
#pragma once #include <QWidget> #include <qevent.h> #include "data/typedefs.h" #include "gui/edits/snapping.h" #include <QTimer> namespace VSN { namespace QtVision { class QtOpenGLSceneWidget; } } namespace data { struct Document; } namespace data { struct GripPoint; } namespace data { struct Sketch; } class Tool; class DocumentOverlay; class ModelTree; class ViewCube; class SceneTracer; class DocumentView : public QWidget { Q_OBJECT public: DocumentView(ref<data::Document> document, QString filePath, QObject* parent = nullptr); ~DocumentView(); public: VSN::QtVision::QtOpenGLSceneWidget* m_scene{}; ref<data::Document> m_document{}; QString m_filePath{}; Tool* m_activeTool{}; Tool* m_toolForSelectedObject{}; QWidget* m_activeInteractiveEntry{}; DocumentOverlay* m_overlay{}; ViewCube* m_cube{}; SceneTracer* m_sceneTracer{}; std::vector<ref<data::GripPoint>> m_pressedGripPoints; std::vector<Point3SnapRule> m_snapRules; double m_scale_factor{1}; public: void initUi(); Point3 screenToActivePlane(Point3 screenPoint) const; Point3 screenToSketchPlane(Point3 screenPoint, data::Sketch const& sketch) const; Point3 screenPointToWorldPoint(Point3 screenPoint) const; Point3 worldPointToScreenPoint(Point3 worldPoint) const; Point3 qPointToScreenPoint(QPoint screenPoint) const; private: bool b_firstMouse = true; QPoint m_lastMousePos{}; QPoint m_pos{}; float scale_sensitivity = 0.001f; float rotate_sensitivity = 3.0f; float move_sensitivity = 0.001f; float f_mouseMoveX = -90.0f; float f_mouseMoveY = 0.0f; QPointF start_position{}; public slots: void documentUpdated(); signals: void mouseMoved(QMouseEvent* event); void mousePressed(QMouseEvent* event); void mouseReleased(QMouseEvent* event); void activeInteractiveEntryChanged(QWidget* v); public: void mouseMoveEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; void wheelEvent(QWheelEvent * event) override; public: ref<data::Document> document() const { return m_document; } void setDocument(ref<data::Document> document) { m_document = document; } QString filePath() const { return m_filePath; } void setFilePath(const QString &filePath) { m_filePath = filePath; } Tool* activeTool() const { return m_activeTool; } void setActiveTool(Tool* v); Tool* toolForSelectedObject() const { return m_toolForSelectedObject; } void setToolForSelectedObject(Tool* v); QWidget* activeInteractiveEntry() const { return m_activeInteractiveEntry; } void setActiveInteractiveEntry(QWidget* v); }; class DocumentOverlay : public QWidget { public: DocumentOverlay(DocumentView* parent = nullptr); ~DocumentOverlay(); DocumentView* docView{}; QString notify_text{}; QTimer* notify_timer{}; void paintEvent(QPaintEvent *event) override; };