Developer documentation | Axl-2.5.1

axlCone.h
Go to the documentation of this file.
1 /* axlCone.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 AXLCONE_H
22 #define AXLCONE_H
23 
24 #include "axlCoreExport.h"
25 
26 #include "axlAbstractData.h"
27 
28 #include <QtCore>
29 
30 class axlPoint;
31 
32 class axlConePrivate;
33 
35 {
36  Q_OBJECT
37  Q_PROPERTY(axlPoint apex READ apex WRITE touchApex);
38  Q_PROPERTY(axlPoint basePoint READ basePoint WRITE touchBasePoint);
39  Q_PROPERTY(double radius READ radius WRITE touchRadius);
40 
41 public:
42  axlCone(QObject *parent = 0);
43  axlCone(axlPoint *apex, axlPoint *basePoint, double radius, QObject *parent = 0);
44  axlCone(const axlPoint& apex, const axlPoint& basePoint, double radius, QObject *parent = 0);
45  axlCone(const axlCone& other);
46  ~axlCone(void);
47 
48  virtual QString description(void) const;
49  virtual QString identifier(void) const;
50 
51  axlPoint *apex(void) const;
52  axlPoint *basePoint(void) const;
53  double radius(void) const;
54  double length(void) const;
55 
56  void setValues(axlPoint *apex, axlPoint *basePoint, double radius);
57  void setApex(axlPoint *apex);
58  void setApex(double *apex);
59  void setBasePoint(axlPoint *basePoint);
60  void setBasePoint(double *basePoint);
61 
62  void setRadius(double radius);
63  void setLength(double length);
64 
65  void touchApex(axlPoint apex);
66  void touchBasePoint(axlPoint basePoint);
67  void touchRadius(double radius);
68 
69 // void modifyApex(double *apex);
70 // void modifyBasePoint(double *basePoint);
71 
72  axlCone& operator =(const axlCone& other);
73 
74  friend QDebug operator<<(QDebug dbg, axlCone line);
75  friend QDebug operator<<(QDebug dbg, axlCone& line);
76  friend QDebug operator<<(QDebug dbg, axlCone *line);
77 
78  //IPC
79  QVariantList convertDataToQVariant(void) const;
80  int convertQVariantToData(const QVariantList &data);
81 
82 signals:
83  void dataChanged(void);
84 
85 public slots:
86  void onApexChanged(axlPoint *apex);
87  void onBasePointChanged(axlPoint *basePoint);
88  void onRadiusChanged(double radius);
89 
90  private:
91  axlConePrivate *d;
92 };
94 
95 //to be registered to the data factory.
96 dtkAbstractData *createaxlCone(void);
97 
98 // /////////////////////////////////////////////////////////////////
99 // Debug operators
100 // /////////////////////////////////////////////////////////////////
101 
102 QDebug operator<<(QDebug dbg, axlCone point);
103 QDebug operator<<(QDebug dbg, axlCone& point);
104 QDebug operator<<(QDebug dbg, axlCone *point);
105 
106 #endif // AXLCONE_H
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
Q_DECLARE_METATYPE(axlCone)
QDebug operator<<(QDebug dbg, axlCone point)
Definition: axlCone.cpp:267
dtkAbstractData * createaxlCone(void)
Definition: axlCone.cpp:363
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...
#define AXLCORE_EXPORT
Class axlCone defines 3D cones.
Definition: axlCone.h:34
Class axlAbstractData defines an API for all type of axel data.