00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef POINT_H
00026 #define POINT_H
00027
00028 #include <avogadro/primitive.h>
00029 #include <avogadro/color.h>
00030
00031 #include <QList>
00032 #include <QMouseEvent>
00033
00034 namespace Avogadro {
00035
00044 class PointPrivate;
00045 class A_EXPORT Point : public Primitive
00046 {
00047 Q_OBJECT
00048
00049 public:
00055 Point(QObject *parent=0);
00056
00057 ~Point();
00058
00063 inline const Eigen::Vector3d &pos () const
00064 {
00065 return m_pos;
00066 }
00067
00072 inline void setPos(const Eigen::Vector3d &vec)
00073 {
00074 m_pos = vec;
00075 }
00076
00080 double radius() const
00081 {
00082 return m_radius;
00083 }
00087 void setRadius(double value)
00088 {
00089 m_radius = value;
00090 }
00091
00095 const Color* color()
00096 {
00097 return &m_color;
00098 }
00102 void setColor(const Color &color)
00103 {
00104 float red = color.red();
00105 float green = color.green();
00106 float blue = color.blue();
00107 float alpha = color.alpha();
00108 m_color.set(red, green, blue, alpha);
00109 }
00110
00111 void mousePressed(QMouseEvent *event) { emit mousePressEvent(this, event); }
00112 void mouseMoved(QMouseEvent *event) { emit mouseMoveEvent(this, event); }
00113 void mouseReleased(QMouseEvent *event) { emit mouseReleaseEvent(this, event); }
00114 signals:
00115 void mousePressEvent(Point *point, QMouseEvent * event);
00116 void mouseMoveEvent(Point *point, QMouseEvent * event);
00117 void mouseReleaseEvent(Point *point, QMouseEvent * event);
00118
00119 private:
00120 Eigen::Vector3d m_pos;
00121 double m_radius;
00122 Color m_color;
00123 Q_DECLARE_PRIVATE(Point)
00124 };
00125
00126 }
00127
00128 #endif