1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the QtDataVisualization API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13
14#ifndef ABSTRACTRENDERITEM_P_H
15#define ABSTRACTRENDERITEM_P_H
16
17#include <private/datavisualizationglobal_p.h>
18#include <private/labelitem_p.h>
19
20#include <QtGui/QVector3D>
21#include <QtGui/QQuaternion>
22
23QT_BEGIN_NAMESPACE
24
25class AbstractRenderItem
26{
27public:
28 AbstractRenderItem();
29 AbstractRenderItem(const AbstractRenderItem &other);
30 AbstractRenderItem &operator=(const AbstractRenderItem &other) = default;
31 virtual ~AbstractRenderItem();
32
33 // Position in 3D scene
34 inline void setTranslation(const QVector3D &translation) { m_translation = translation; }
35 inline const QVector3D &translation() const {return m_translation; }
36
37 inline const QQuaternion &rotation() const { return m_rotation; }
38 inline void setRotation(const QQuaternion &rotation)
39 {
40 if (rotation.isNull())
41 m_rotation = identityQuaternion;
42 else
43 m_rotation = rotation;
44 }
45
46protected:
47 QVector3D m_translation;
48 QQuaternion m_rotation;
49
50 friend class QAbstractDataItem;
51};
52
53QT_END_NAMESPACE
54
55#endif
56

source code of qtdatavis3d/src/datavisualization/data/abstractrenderitem_p.h