20#ifndef LIBREPCB_EDITOR_OPENGLSCENEBUILDER_H
21#define LIBREPCB_EDITOR_OPENGLSCENEBUILDER_H
27#include <polyclipping/clipper.hpp>
40class OpenGlTriangleObject;
54 typedef std::tuple<qreal, qreal, qreal>
Color;
75 bool isBusy() const noexcept;
100 const QStringList layers) const;
101 QVector<QVector3D>
extrude(const ClipperLib::Paths& paths, qreal z,
102 qreal height, qreal scaleFactor,
bool faces = true,
103 bool edges = true,
bool closed = true) const;
104 static QVector<QVector3D>
tesselate(const ClipperLib::
Path& path, qreal z,
107 const QVector<QVector3D>& triangles);
109 const QByteArray& stepContent, qreal z, qreal scaleFactor,
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition: path.h:58
3D scene data representing a board with package models
Definition: scenedata3d.h:53
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
Represents one 3D object in an OpenGL 3D model.
Definition: openglobject.h:43
Asynchronously generates a 3D board scene for OpenGL rendering.
Definition: openglscenebuilder.h:49
void objectAdded(std::shared_ptr< librepcb::editor::OpenGlObject > obj)
QHash< QByteArray, StepModel > mStepModels
Cache.
Definition: openglscenebuilder.h:120
void cancel() noexcept
Cancel the build.
Definition: openglscenebuilder.cpp:97
bool isBusy() const noexcept
Check if there is currently a build in progress.
Definition: openglscenebuilder.cpp:88
bool mAbort
Definition: openglscenebuilder.h:115
QHash< QString, std::shared_ptr< OpenGlTriangleObject > > mBoardObjects
Definition: openglscenebuilder.h:118
QMap< Color, QVector< QVector3D > > StepModel
Definition: openglscenebuilder.h:55
void finished(QString errorMsg)
void start(std::shared_ptr< SceneData3D > data) noexcept
Start building scene asynchronously.
Definition: openglscenebuilder.cpp:79
OpenGlSceneBuilder(QObject *parent=nullptr) noexcept
Definition: openglscenebuilder.cpp:66
static QVector< QVector3D > tesselate(const ClipperLib::Path &path, qreal z, qreal scaleFactor)
Definition: openglscenebuilder.cpp:375
void objectRemoved(std::shared_ptr< librepcb::editor::OpenGlObject > obj)
QVector< QVector3D > extrude(const ClipperLib::Paths &paths, qreal z, qreal height, qreal scaleFactor, bool faces=true, bool edges=true, bool closed=true) const
Definition: openglscenebuilder.cpp:316
QFuture< void > mFuture
Definition: openglscenebuilder.h:114
void waitForFinished() noexcept
Wait (block) until the build is finished.
Definition: openglscenebuilder.cpp:93
QHash< Uuid, QMap< Color, std::shared_ptr< OpenGlTriangleObject > > > mDevices
Definition: openglscenebuilder.h:119
std::tuple< qreal, qreal, qreal > Color
Definition: openglscenebuilder.h:54
const PositiveLength mMaxArcTolerance
Definition: openglscenebuilder.h:113
void objectUpdated(std::shared_ptr< librepcb::editor::OpenGlObject > obj)
void publishDevice(const SceneData3D::DeviceData &obj, const QByteArray &stepContent, qreal z, qreal scaleFactor, qreal alpha)
Definition: openglscenebuilder.cpp:424
void publishTriangleData(const QString &id, const QColor &color, const QVector< QVector3D > &triangles)
Definition: openglscenebuilder.cpp:409
void run(std::shared_ptr< SceneData3D > data) noexcept
Definition: openglscenebuilder.cpp:107
ClipperLib::Paths getPaths(const std::shared_ptr< SceneData3D > &data, const QStringList layers) const
Definition: openglscenebuilder.cpp:305
Asynchronously generates a 3D board scene for OpenGL rendering.
Definition: opengltriangleobject.h:46
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812