Developer documentation | Axl-2.5.1

axlTorus.h
Go to the documentation of this file.
1 /* axlTorus.h ---
2  *
3  * Author: Valentin Michelet
4  * Copyright (C) 2008-2012 - Valentin Michelet, Inria.
5  * Created: Tue Nov 9 16:58:59 2012 (+0100)
6  * Version: $Id$
7  */
8 
9 /* Commentary:
10  *
11  */
12 
13 /* Change log:
14  *
15  */
16 
17 #ifndef AXLTORUS_H
18 #define AXLTORUS_H
19 
20 #include "axlCoreExport.h"
21 #include "axlAbstractData.h"
22 
23 #include <QtCore>
24 
25 class axlPoint;
26 class axlTorusPrivate;
27 
29  Q_OBJECT
30  Q_PROPERTY(axlPoint centerPoint READ centerPoint WRITE touchCenterPoint);
31  Q_PROPERTY(axlPoint direction READ direction WRITE touchDirection);
32  Q_PROPERTY(double ringRadius READ ringRadius WRITE touchRingRadius);
33  Q_PROPERTY(double crossSectionRadius READ crossSectionRadius WRITE touchCrossSectionRadius);
34 
35 public:
36  axlTorus(QObject* parent = 0);
37  axlTorus(axlPoint* center, axlPoint* direction, double ringRadius, double crossSectionRadius);
38  axlTorus(const axlPoint& center, const axlPoint& direction, double ringRadius, double crossSectionRadius);
39  axlTorus(const axlTorus& other);
40  virtual ~axlTorus(void);
41 
42  virtual QString description(void) const;
43  virtual QString identifier(void) const;
44 
45  axlPoint* centerPoint(void) const;
46  axlPoint* direction(void) const;
47  double ringRadius(void) const;
48  double crossSectionRadius(void) const;
49 
50  void setValues(axlPoint* center, axlPoint* direction, double ringRadius, double crossSectionRadius);
51 
52  void setCenter(axlPoint* center);
53  void setCenter(double* center);
54 
55  void setDirection(axlPoint* direction);
56  void setDirection(double* direction);
57 
58  void setRingRadius(double ringRadius);
59  void setCrossSectionRadius(double crossSectionRadius);
60 
61  void touchCenterPoint(axlPoint center);
62  void touchDirection(axlPoint direction);
63  void touchRingRadius(double ringRadius);
64  void touchCrossSectionRadius(double crossSectionRadius);
65 
66  axlTorus& operator=(const axlTorus& other);
67 
68  friend QDebug operator<<(QDebug dbg, axlTorus torus);
69  friend QDebug operator<<(QDebug dbg, axlTorus& torus);
70  friend QDebug operator<<(QDebug dbg, axlTorus* torus);
71 
72  //IPC
73  QVariantList convertDataToQVariant(void) const;
74  int convertQVariantToData(const QVariantList &data);
75 
76 public slots:
77  void onCenterChanged(axlPoint* center);
78  void onDirectionChanged(axlPoint* direction);
79  void onRingRadiusChanged(double ringRadius);
80  void onCrossSectionRadiusChanged(double crossSectionRadius);
81 
82 private:
83  axlTorusPrivate* d;
84 };
86 
87 //to be registered to the data factory.
88 dtkAbstractData *createaxlTorus(void);
89 
90 // /////////////////////////////////////////////////////////////////
91 // Debug operators
92 // /////////////////////////////////////////////////////////////////
93 
94 QDebug operator<<(QDebug dbg, axlTorus point);
95 QDebug operator<<(QDebug dbg, axlTorus& point);
96 QDebug operator<<(QDebug dbg, axlTorus* point);
97 
98 #endif // AXLTORUS_H
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
Q_DECLARE_METATYPE(axlAbstractData)
virtual int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
virtual QVariantList convertDataToQVariant(void) const
Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData...
QDebug operator<<(QDebug dbg, axlTorus point)
Definition: axlTorus.cpp:199
dtkAbstractData * createaxlTorus(void)
Definition: axlTorus.cpp:273
#define AXLCORE_EXPORT
Class axlAbstractData defines an API for all type of axel data.