Developer documentation | Axl-2.5.1

axlLine.h
Go to the documentation of this file.
1 /* axlLine.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 AXLLINE_H
22 #define AXLLINE_H
23 
24 #include "axlCoreExport.h"
25 
27 //#include "axlPoint.h"
28 
29 #include <QtCore>
30 
31 class axlPoint;
32 
33 class axlLinePrivate;
34 
36 {
37  Q_OBJECT
38 
39  Q_PROPERTY(axlPoint point1 READ firstPoint WRITE touchFirstPoint);
40  Q_PROPERTY(axlPoint point2 READ secondPoint WRITE touchSecondPoint);
41 
42 public:
43  axlLine(QObject *parent = 0);
44  axlLine(axlPoint *p1, axlPoint *p2, QObject *parent = 0);
45  axlLine(const axlPoint& p1, const axlPoint& p2, QObject* parent = 0);
46  axlLine(const axlLine& other);
47  ~axlLine(void);
48 
49  virtual QString description(void) const;
50  virtual QString identifier(void) const;
51 
52  axlPoint *firstPoint(void) const;
53  axlPoint *secondPoint(void) const;
54  axlPoint *getBarycenterPoint(double coeff);
55  axlPoint *getMiddlePoint(void);
56 
57  void setFirstPoint(axlPoint *p1);
58  void setFirstPoint(double *p1);
59  void touchFirstPoint(const axlPoint &point);
60  void touchSecondPoint(const axlPoint &point);
61  void setSecondPoint(axlPoint *p2);
62  void setSecondPoint(double *p2);
63 
64  void setValues(axlPoint *p1, axlPoint *p2);
65 
66  void applyMatrix(double* matrix);
67 
68  double planeDirection(void);
69  double planeOrigineOrdinate(void);
70 
71  axlLine& operator =(const axlLine& other);
72 
73 
74  friend QDebug operator<<(QDebug dbg, axlLine line);
75  friend QDebug operator<<(QDebug dbg, axlLine& line);
76  friend QDebug operator<<(QDebug dbg, axlLine *line);
77 
78  //IPC
79  QVariantList convertDataToQVariant(void) const;
80  int convertQVariantToData(const QVariantList &data);
81 
82 //public slots:
83  void onFirstPointChanged(axlPoint *p1);
84  void onSecondPointChanged(axlPoint *p2);
85 
86 
87 private:
88  axlLinePrivate *d;
89 };
91 
92 //to be registered to the data factory.
93 dtkAbstractData *createaxlLine(void);
94 
95 // /////////////////////////////////////////////////////////////////
96 // Debug operators
97 // /////////////////////////////////////////////////////////////////
98 
99 QDebug operator<<(QDebug dbg, axlLine point);
100 QDebug operator<<(QDebug dbg, axlLine& point);
101 QDebug operator<<(QDebug dbg, axlLine *point);
102 
103 #endif // AXLLINE_H
QDebug operator<<(QDebug dbg, axlLine point)
Definition: axlLine.cpp:272
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
Q_DECLARE_METATYPE(axlAbstractData)
Class axlLine defines 3D lines.
Definition: axlLine.h:35
virtual int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
dtkAbstractData * createaxlLine(void)
Definition: axlLine.cpp:353
Generic interface for parametric curve.
virtual QVariantList convertDataToQVariant(void) const
Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData...
#define AXLCORE_EXPORT