Main Page | Class Hierarchy | Compound List | File List | Compound Members

side.h

00001 /***************************************************************************
00002                            side.h
00003                            -------------------
00004     copyright            : (C) 2004 by Jos van den Oever
00005     email                : jos@vandenoever.info
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #ifndef SIDE_H
00017 #define SIDE_H
00018 
00019 #include "matrix3d.h"
00020 #include "rotenums.h"
00021 #include <qwmatrix.h>
00022 #include <qobject.h>
00023 
00024 class QPainter;
00025 class QPicture;
00026 
00038 class Side : public QObject {
00039 Q_OBJECT
00040 public:
00042         Side();
00044         Side(const double [9]);
00046         Side(const Side &);
00048         virtual ~Side();
00050         const Side &operator=(const Side &);
00055         int operator<(const Side &) const;
00056 
00058         void setPoints(const double [9]);
00060         void setPicture(const QPicture *);
00062         void setRotation(short);
00065         void setSymmetry(Symmetry);
00066         void paintSide(QPainter *p) const;
00067         void rotate(Rotation);
00068         void updateMatrix(const Matrix3D &m3d);
00069         bool processClick(const QPoint &p);
00070         Rotation getRotation() const;
00071         double getMaxDistance() const;
00073         const QPicture *picture() const;
00075         const QWMatrix *matrix() const;
00076         Symmetry symmetry() const;
00077 private:
00083         Rotation rot;
00087         Symmetry sym;
00090         const QPicture *pict;
00091         double *const p1, *const p2, *const p3, *const p4;
00092         double ipoints[12], opoints[12];
00093         QWMatrix wm;
00094         double getZcoord(double, double) const;
00095         bool intersect(const Side &s, double &L1x, double &L1y, double &L2x,
00096          double &L2y) const;
00097 signals:
00101         void clickedAt(QPoint p);
00105         void clicked();
00106 };
00107 
00108 #endif

Generated on Thu Jan 15 23:13:57 2004 for CubeTest by doxygen 1.3.2