2015-07-26 21:39:49 +00:00
|
|
|
#ifndef WVECTOREDITOR_H
|
|
|
|
#define WVECTOREDITOR_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include "WDraggableSpinBox.h"
|
|
|
|
#include <Common/CVector3f.h>
|
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QFormLayout>
|
|
|
|
|
|
|
|
class WVectorEditor : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
CVector3f mValue;
|
2015-08-25 01:17:15 +00:00
|
|
|
|
|
|
|
Qt::Orientation mOrientation;
|
|
|
|
QLayout *mpLayout;
|
|
|
|
QHBoxLayout *mpXLayout;
|
|
|
|
QHBoxLayout *mpYLayout;
|
|
|
|
QHBoxLayout *mpZLayout;
|
2015-07-26 21:39:49 +00:00
|
|
|
WDraggableSpinBox *mpSpinBoxX;
|
|
|
|
WDraggableSpinBox *mpSpinBoxY;
|
|
|
|
WDraggableSpinBox *mpSpinBoxZ;
|
|
|
|
QLabel *mpLabelX;
|
|
|
|
QLabel *mpLabelY;
|
|
|
|
QLabel *mpLabelZ;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit WVectorEditor(QWidget *pParent = 0);
|
2015-08-25 01:17:15 +00:00
|
|
|
WVectorEditor(const CVector3f& value, QWidget *pParent = 0);
|
2015-07-26 21:39:49 +00:00
|
|
|
~WVectorEditor();
|
|
|
|
CVector3f Value();
|
2015-08-25 01:17:15 +00:00
|
|
|
void SetOrientation(Qt::Orientation orientation);
|
|
|
|
void SetValue(const CVector3f& value);
|
|
|
|
void SetDefaultValue(double value);
|
|
|
|
void SetSingleStep(double step);
|
|
|
|
void SetLabelsHidden(bool hidden);
|
|
|
|
bool IsBeingDragged();
|
2015-07-26 21:39:49 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void SetX(double x);
|
|
|
|
void SetY(double y);
|
|
|
|
void SetZ(double z);
|
2015-08-25 01:17:15 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void ValueChanged(const CVector3f& value);
|
|
|
|
void EditingDone(const CVector3f& value);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void SetupUI();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void OnSpinBoxEditingDone();
|
2015-07-26 21:39:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WVECTOREDITOR_H
|