Developer documentation | Axl-2.5.1

axlCylinder.h
Go to the documentation of this file.
1 /* axlCylinder.h ---
2  *
3  * Author: Meriadeg Perrinel
4  * Copyright (C) 2008 - Meriadeg Perrinel, Inria.
5  * Created: Tue Nov 9 16:58:59 2010 (+0100)
6  * Version: $Id$
7  * Last-Updated: Mon Dec 6 15:46:18 2010 (+0100)
8  * By: Meriadeg Perrinel
9  * Update #: 21
10  */
11 
12 /* Commentary:
13  * There is choice table for stock coordinate. But maybe that is nos the good solution if algorithm behin use a lot of point.
14  * In this case, we have to create three double directly instead of table
15  */
16 
17 /* Change log:
18  *
19  */
20 
21 #ifndef AXLCYLINDER_H
22 #define AXLCYLINDER_H
23 
24 #include "axlCoreExport.h"
25 #include "axlAbstractData.h"
26 
27 #include <QtCore>
28 
29 class axlPoint;
30 
31 class axlCylinderPrivate;
32 
34 {
35  Q_OBJECT
36  Q_PROPERTY(axlPoint point1 READ firstPoint WRITE touchFirstPoint);
37  Q_PROPERTY(axlPoint point2 READ secondPoint WRITE touchSecondPoint);
38  Q_PROPERTY(double radius READ radius WRITE touchRadius);
39 
40 public:
41  axlCylinder(QObject *parent = 0);
42  axlCylinder(axlPoint *p1, axlPoint *p2, double radius, QObject *parent = 0);
43  axlCylinder(const axlPoint& p1, const axlPoint& p2, double radius, QObject *parent = 0);
44  axlCylinder(const axlCylinder& other);
45  ~axlCylinder(void);
46 
47  virtual QString description(void) const;
48  virtual QString identifier(void) const;
49 
50  axlPoint *firstPoint(void) const;
51  axlPoint *secondPoint(void) const;
52  double radius(void) const;
53  double length(void) const;
54 
55  void setValues(axlPoint *p1, axlPoint *p2, double radius);
56  void setFirstPoint(axlPoint *p1);
57  void setSecondPoint(axlPoint *p2);
58  void setRadius(double radius);
59  void setLength(double length);
60  void setFirstPoint(double *p1);
61  void setSecondPoint(double *p2);
62 
63  void touchFirstPoint(axlPoint p1);
64  void touchSecondPoint(axlPoint p2);
65  void touchRadius(double radius);
66 
67  axlCylinder& operator =(const axlCylinder& other);
68 
69  friend QDebug operator<<(QDebug dbg, axlCylinder line);
70  friend QDebug operator<<(QDebug dbg, axlCylinder& line);
71  friend QDebug operator<<(QDebug dbg, axlCylinder *line);
72 
73  QVariantList convertDataToQVariant(void) const;
74  int convertQVariantToData(const QVariantList &data);
75 
76 public slots:
77  void onFirstPointChanged(axlPoint *p1);
78  void onSecondPointChanged(axlPoint *p2);
79  void onRadiusChanged(double radius);
80 
81 private:
82  axlCylinderPrivate *d;
83 };
85 
86 //to be registered to the data factory.
87 dtkAbstractData *createaxlCylinder(void);
88 
89 // /////////////////////////////////////////////////////////////////
90 // Debug operators
91 // /////////////////////////////////////////////////////////////////
92 
93 QDebug operator<<(QDebug dbg, axlCylinder point);
94 QDebug operator<<(QDebug dbg, axlCylinder& point);
95 QDebug operator<<(QDebug dbg, axlCylinder *point);
96 
97 
98 #endif // AXLCYLINDER_H
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
Q_DECLARE_METATYPE(axlAbstractData)
QDebug operator<<(QDebug dbg, axlCylinder point)
Class axlCylinder defines 3D cylinders.
Definition: axlCylinder.h:33
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...
dtkAbstractData * createaxlCylinder(void)
#define AXLCORE_EXPORT
Class axlAbstractData defines an API for all type of axel data.