From d08bef1ccd33b9f2600e84dfe30545c2abc1b180 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Tue, 20 Oct 2015 12:37:03 +0200 Subject: Create createF function --- src/glitem.cpp | 10 +++++++++- src/glitem.h | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/glitem.cpp b/src/glitem.cpp index a307e38..47b2acc 100644 --- a/src/glitem.cpp +++ b/src/glitem.cpp @@ -362,7 +362,7 @@ void GLItem::createCube(const QVector3D &lbb, const QVector3D &rtf) // Create all the vectors for caching QVector3D lbf = QVector3D(lbb.x(), lbb.y(), rtf.z()); QVector3D rbb = QVector3D(rtf.x(), lbb.y(), lbb.z()); - QVector3D rbf = QVector3D(rtf.x(), lbb.y(), rtf.y()); + QVector3D rbf = QVector3D(rtf.x(), lbb.y(), rtf.z()); QVector3D ltb = QVector3D(lbb.x(), rtf.y(), lbb.z()); QVector3D ltf = QVector3D(lbb.x(), rtf.y(), rtf.z()); QVector3D rtb = QVector3D(rtf.x(), rtf.y(), lbb.z()); @@ -422,6 +422,14 @@ void GLItem::createCube(const QVector3D &lbb, const QVector3D &rtf) m_points.append(GLPoint(ltf, n0, t0, GLColorRgba::clGreen)); } +void GLItem::createF(double height) +{ + float stdLength = height/5.0; + createCube(QVector3D(0.0, 0.0, 0.0),QVector3D(stdLength, height, stdLength)); + createCube(QVector3D(stdLength, height, 0.0),QVector3D(3.0 * stdLength, height - 1.0 * stdLength, stdLength)); + createCube(QVector3D(stdLength, height - 2.0 * stdLength, 0.0),QVector3D(2.0 * stdLength, height - 3.0 * stdLength, stdLength)); +} + void GLItem::createAxis(double length, const QVector3D & origin, const QVector3D & axis, const QVector3D & normal, const QVector3D & texCoord, const GLColorRgba& color) diff --git a/src/glitem.h b/src/glitem.h index 5e60ee6..552120d 100644 --- a/src/glitem.h +++ b/src/glitem.h @@ -131,6 +131,12 @@ protected: */ virtual void createCube(const QVector3D &lbb, const QVector3D &rtf); + /** + * @brief createF Creates an 'F' with cubes. + * @param height The height of the 'F'. + */ + virtual void createF(double height); + /** * @brief createAxes Creates x, y and z axis with specified length starting for (0,0,0) * @param length Axes length. -- cgit v1.2.3-70-g09d2