QXRD  0.11.16
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
QcepVector3DProperty Class Reference

#include <qcepvector3dproperty.h>

Inheritance diagram for QcepVector3DProperty:
Inheritance graph
[legend]
Collaboration diagram for QcepVector3DProperty:
Collaboration graph
[legend]

Public Slots

void setValue (QcepVector3D val, int index)
 
void setValue (QcepVector3D val)
 
void incValue (QcepVector3D step)
 
void setDefaultValue (QcepVector3D val)
 
void resetValue ()
 

Signals

void valueChanged (QcepVector3D val, int index)
 

Public Member Functions

 QcepVector3DProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepVector3D value, QString toolTip)
 
 QcepVector3DProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, double x, double y, double z, QString toolTip)
 
QcepVector3D value () const
 
QcepVector3D defaultValue () const
 
QString toString (const QcepVector3D &mat)
 
- Public Member Functions inherited from QcepProperty
 QcepProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
 
virtual void printMessage (QString msg, QDateTime dt=QDateTime::currentDateTime())
 
QString name () const
 
void setName (QString name)
 
QString parentName () const
 
QString toolTip () const
 
void setToolTip (QString tip)
 
QString expandedToolTip () const
 
void setWidgetToolTip (QWidget *widget)
 
int index ()
 
int incIndex (int step)
 
int debug () const
 
void setDebug (int dbg)
 
void setSaver (QcepSettingsSaverWPtr saver)
 

Static Public Member Functions

static void registerMetaTypes ()
 
- Static Public Member Functions inherited from QcepProperty
static void registerMetaTypes ()
 
static void setSettingsValue (QSettings *settings, QString name, QVariant value)
 
static void writeSettings (QObject *object, QSettings *settings, QString section)
 
static void readSettings (QObject *object, QSettings *settings, QString section)
 
static void writeSettings (QObject *object, const QMetaObject *meta, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void readSettings (QObject *object, const QMetaObject *meta, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void writeSettings (QObject *object, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void readSettings (QObject *object, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void registerCustomSaver (QString typeName, CustomSettingsSaver *saver)
 

Private Attributes

QcepVector3D m_Default
 
QcepVector3D m_Value
 

Additional Inherited Members

- Protected Attributes inherited from QcepProperty
QMutex m_Mutex
 
QcepSettingsSaverWPtr m_Saver
 

Detailed Description

Definition at line 7 of file qcepvector3dproperty.h.

Constructor & Destructor Documentation

QcepVector3DProperty::QcepVector3DProperty ( QcepSettingsSaverWPtr  saver,
QObject *  parent,
const char *  name,
QcepVector3D  value,
QString  toolTip 
)
explicit

Definition at line 6 of file qcepvector3dproperty.cpp.

6  :
7  QcepProperty(saver, parent, name, toolTip),
8  m_Default(value),
9  m_Value(value)
10 {
11 }
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QString toolTip() const
QcepVector3DProperty::QcepVector3DProperty ( QcepSettingsSaverWPtr  saver,
QObject *  parent,
const char *  name,
double  x,
double  y,
double  z,
QString  toolTip 
)
explicit

Definition at line 13 of file qcepvector3dproperty.cpp.

13  :
14  QcepProperty(saver, parent, name, toolTip),
15  m_Default(x,y,z),
16  m_Value(x,y,z)
17 {
18 }
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QString toolTip() const

Member Function Documentation

QcepVector3D QcepVector3DProperty::defaultValue ( ) const

Definition at line 34 of file qcepvector3dproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

Referenced by resetValue().

35 {
36  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
37 
38  return m_Default;
39 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepVector3DProperty::incValue ( QcepVector3D  step)
slot

Definition at line 53 of file qcepvector3dproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, QcepProperty::incIndex(), QcepProperty::m_Mutex, QcepProperty::m_Saver, m_Value, QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), toString(), and valueChanged().

54 {
55  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
56 
57  if (qcepDebug(DEBUG_PROPERTIES) || debug()) {
58  printMessage(tr("%1: QcepVector3DProperty::incValue(QcepVector3D %2...)")
59  .arg(name()).arg(toString(step)));
60  }
61 
62  m_Value += step;
63 
65 
66  if (saver) {
67  saver->changed(this);
68  }
69 
70  emit valueChanged(m_Value, incIndex(1));
71 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QMutex m_Mutex
Definition: qcepproperty.h:69
int incIndex(int step)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
int debug() const
QString toString(const QcepVector3D &mat)
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70
void valueChanged(QcepVector3D val, int index)

Here is the call graph for this function:

void QcepVector3DProperty::registerMetaTypes ( )
static

Definition at line 20 of file qcepvector3dproperty.cpp.

21 {
22  qRegisterMetaType< QcepVector3D >("QcepVector3D");
23 
24  qRegisterMetaTypeStreamOperators< QcepVector3D >("QcepVector3D");
25 }
void QcepVector3DProperty::resetValue ( )
slot

Definition at line 116 of file qcepvector3dproperty.cpp.

References DEBUG_PROPERTIES, defaultValue(), QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), and setValue().

117 {
119  printMessage(tr("%1: QcepVector3DProperty::resetValue").arg(name()));
120  }
121 
123 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QcepVector3D defaultValue() const
void setValue(QcepVector3D val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const

Here is the call graph for this function:

void QcepVector3DProperty::setDefaultValue ( QcepVector3D  val)
slot

Definition at line 109 of file qcepvector3dproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

110 {
111  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
112 
113  m_Default = val;
114 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void QcepVector3DProperty::setValue ( QcepVector3D  val,
int  index 
)
slot

Definition at line 41 of file qcepvector3dproperty.cpp.

References QcepProperty::debug(), QcepProperty::index(), QcepProperty::name(), QcepProperty::printMessage(), and toString().

Referenced by resetValue().

42 {
43  if (debug()) {
44  printMessage(tr("%1 QcepVector3DProperty::setValue(QcepVector3D %2, int %3) [%4]")
45  .arg(name()).arg(toString(val)).arg(index).arg(this->index()));
46  }
47 
48  if (index == this->index()) {
49  setValue(val);
50  }
51 }
void setValue(QcepVector3D val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
int debug() const
QString toString(const QcepVector3D &mat)

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepVector3DProperty::setValue ( QcepVector3D  val)
slot

Definition at line 82 of file qcepvector3dproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, QcepProperty::incIndex(), QcepProperty::index(), QcepProperty::m_Mutex, QcepProperty::m_Saver, m_Value, QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), toString(), and valueChanged().

83 {
84  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
85 
87  printMessage(tr("%1 QcepVector3DProperty::setValue(QcepVector3D %2)")
88  .arg(name()).arg(toString(val)));
89  }
90 
91  if (val != m_Value) {
92  if (debug()) {
93  printMessage(tr("%1: QcepVector3DProperty::setValue(QcepVector3D %2) [%3]")
94  .arg(name()).arg(toString(val)).arg(index()));
95  }
96 
97  m_Value = val;
98 
100 
101  if (saver) {
102  saver->changed(this);
103  }
104 
105  emit valueChanged(m_Value, incIndex(1));
106  }
107 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QMutex m_Mutex
Definition: qcepproperty.h:69
int incIndex(int step)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
int debug() const
QString toString(const QcepVector3D &mat)
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70
void valueChanged(QcepVector3D val, int index)

Here is the call graph for this function:

QString QcepVector3DProperty::toString ( const QcepVector3D mat)

Definition at line 73 of file qcepvector3dproperty.cpp.

References QcepProperty::m_Mutex.

Referenced by incValue(), and setValue().

74 {
75  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
76 
77  QString res = tr("[ %1 %2 %3 ]").arg(val.x()).arg(val.y()).arg(val.z());
78 
79  return res;
80 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

QcepVector3D QcepVector3DProperty::value ( ) const

Definition at line 27 of file qcepvector3dproperty.cpp.

References QcepProperty::m_Mutex, and m_Value.

28 {
29  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
30 
31  return m_Value;
32 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void QcepVector3DProperty::valueChanged ( QcepVector3D  val,
int  index 
)
signal

Referenced by incValue(), and setValue().

Here is the caller graph for this function:

Member Data Documentation

QcepVector3D QcepVector3DProperty::m_Default
private

Definition at line 31 of file qcepvector3dproperty.h.

Referenced by defaultValue(), and setDefaultValue().

QcepVector3D QcepVector3DProperty::m_Value
private

Definition at line 32 of file qcepvector3dproperty.h.

Referenced by incValue(), setValue(), and value().


The documentation for this class was generated from the following files: