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 <QList>
5#include <QPen>
6#include <dxf/Entities.h>
7#include <dxf/global.h>
8
9namespace sf::dxf
10{
11
15class _DXF_CLASS GraphicsScene final : public QGraphicsScene
16{
17 public:
22 explicit GraphicsScene(QObject* parent = nullptr);
23
27 ~GraphicsScene() override;
28
34 void load(const LayerEntities& entities_by_layer, const Layers& layer_info);
35
39 void clearScene();
40
41 private:
46 void drawLine(const Line& line);
47
52 void drawPolyline(const Polyline& polyline);
53
58 void drawCircle(const Circle& circle);
59
64 void drawArc(const Arc& arc);
65 void drawArcOld(const Arc& arc);
66
72 QPen getDrawingPen(const Entity& entity) const;
73};
74
75}// namespace sf::dxf
The GraphicsScene class is a custom QGraphicsScene for rendering DXF entities.
Definition GraphicsScene.h:16
void load(const LayerEntities &entities_by_layer, const Layers &layer_info)
Loads and draws DXF entities onto the scene.
GraphicsScene(QObject *parent=nullptr)
Constructs a GraphicsScene object.
~GraphicsScene() override
Destroys the GraphicsScene object.
void clearScene()
Clears all items from the scene.
#define _DXF_CLASS
Definition dxf/global.h:38
Definition Entities.h:10
QMap< QString, LayerInfo > Layers
Layers holds information for all layers in the DXF file.
Definition Entities.h:193
QMap< QString, EntityList > LayerEntities
Definition Entities.h:156
Represents a DXF ARC entity.
Definition Entities.h:125
Represents a DXF CIRCLE entity.
Definition Entities.h:103
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