Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
GraphicsScene.h
Go to the documentation of this file.
1#pragma once
2#include <QGraphicsRectItem>
3#include <QGraphicsScene>
4#include <QPen>
5#include <dxf/Entities.h>
6#include <dxf/global.h>
7
8namespace sf::dxf
9{
10
14class _DXF_CLASS GraphicsScene final : public QGraphicsScene
15{
16 public:
21 explicit GraphicsScene(QObject* parent = nullptr);
22
26 ~GraphicsScene() override;
27
34 void load(const LayerEntities& layer_entities, const Layers& layer_info, bool as_lines);
35
39 void clearScene();
40
41 private:
48 void drawLine(const QPointF& from, const QPointF& to, const QColor& color);
49
54 void drawLine(const Line& line);
55
60 void drawPolyline(const Polyline& polyline);
61
66 void drawCircle(const Circle& circle);
67
72 void drawArc(const Arc& arc);
73 void drawArcOld(const Arc& arc);
74
80 QPen getDrawingPen(const Entity& entity) const;
81};
82
83}// namespace sf::dxf
The GraphicsScene class is a custom QGraphicsScene for rendering DXF entities.
Definition GraphicsScene.h:15
GraphicsScene(QObject *parent=nullptr)
Constructs a GraphicsScene object.
~GraphicsScene() override
Destroys the GraphicsScene object.
void load(const LayerEntities &layer_entities, const Layers &layer_info, bool as_lines)
Loads and draws DXF entities onto the scene.
void clearScene()
Clears all items from the scene.
#define _DXF_CLASS
Definition dxf/global.h:38
Definition Entities.h:10
QMap< QString, QList< std::shared_ptr< Entity > > > LayerEntities
LayerEntities holds all parsed entities, organized by layer. Using std::shared_ptr for automatic memo...
Definition Entities.h:191
QMap< QString, LayerInfo > Layers
Layers holds information for all layers in the DXF file.
Definition Entities.h:201
Represents a DXF ARC entity.
Definition Entities.h:126
Represents a DXF CIRCLE entity.
Definition Entities.h:104
Base class for all DXF geometric entities.
Definition Entities.h:16
Represents a DXF LINE entity.
Definition Entities.h:55
Represents a DXF POLYLINE entity.
Definition Entities.h:81