Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
Reader.h
Go to the documentation of this file.
1#pragma once
2#include "Entities.h"
3#include <QObject>
4#include <dxf/global.h>
5
6namespace sf::dxf
7{
8
12class _DXF_CLASS Reader final : public QObject
13{
14 public:
19 explicit Reader(QObject* parent = nullptr);
20
24 ~Reader() override;
25
32 bool read(const QString& filepath, const QStringList& layers = {});
33
39
45 const Entities& getLayerEntities(const QString& layer) const;
46
51 const Layers& getLayerInfo() const;
52
53 private:
55 struct Private;
57 Private* _p{nullptr};
58};
59
60}// namespace sf::dxf
The Reader class parses DXF files using 'dxflib' and stores entities by layer.
Definition Reader.h:13
Reader(QObject *parent=nullptr)
Constructs a Reader object.
~Reader() override
Destroys the Reader object.
const Entities & getLayerEntities(const QString &layer) const
Gets the entity list reference from the given layer name.
const LayerEntities & getEntitiesByLayer() const
Gets the parsed entities organized by layer.
const Layers & getLayerInfo() const
Gets the parsed layer information.
bool read(const QString &filepath, const QStringList &layers={})
Reads and parses a DXF file.
#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
LayerEntities::mapped_type Entities
Entities type from the map for holding entities of a layer.
Definition Entities.h:196
QMap< QString, LayerInfo > Layers
Layers holds information for all layers in the DXF file.
Definition Entities.h:201