Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+65
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Helper class since QVector3D does not provide rX() functions and only has float as data type
|
||||
* It's a simple copy of QPointF with the z extension + removed (currently) unneeded functionality
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-05-03
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "qpoint3d.h"
|
||||
|
||||
#include <LtsUtilsCore/ltsutilscore_export.h>
|
||||
|
||||
#include <QVector>
|
||||
#include <QPointF>
|
||||
|
||||
|
||||
namespace LtsUtils
|
||||
{
|
||||
|
||||
class LTSUTILSCORE_EXPORT QPlane3D
|
||||
{
|
||||
|
||||
public:
|
||||
QPlane3D(const QPoint3D &pos, const QPoint3D &vec1, const QPoint3D &vec2);
|
||||
|
||||
QPoint3D intersection(const QPoint3D &point, const QPoint3D &direction) const;
|
||||
bool intersects(const QPoint3D &direction) const;
|
||||
bool isParallel(const QPoint3D &direction) const;
|
||||
bool inPlane(const QPoint3D &point) const;
|
||||
double distanceTo(const QPoint3D &point) const;
|
||||
|
||||
const QPoint3D &pos() const { return m_pos; }
|
||||
const QPoint3D &vec1() const { return m_vec1; }
|
||||
const QPoint3D &vec2() const { return m_vec2; }
|
||||
const QPoint3D &normal() const { return m_normal; }
|
||||
double planeC() const { return m_planeC; }
|
||||
|
||||
protected:
|
||||
QPoint3D m_pos;
|
||||
QPoint3D m_vec1;
|
||||
QPoint3D m_vec2;
|
||||
QPoint3D m_normal;
|
||||
double m_planeC;
|
||||
|
||||
};
|
||||
|
||||
|
||||
class LTSUTILSCORE_EXPORT QPolygon3D : public QPlane3D
|
||||
{
|
||||
|
||||
public:
|
||||
QPolygon3D(const QVector<QPoint3D> &vertices);
|
||||
|
||||
bool contains(const QPoint3D &point) const { return m_vertices.contains(point); }
|
||||
bool containsPoint(const QPoint3D &point) const;
|
||||
|
||||
private:
|
||||
QVector<QPoint3D> m_vertices;
|
||||
|
||||
};
|
||||
|
||||
} // namespace LtsUtils
|
||||
Reference in new issue
Block a user