#include "qtcolortriangle.h"
#include <QtCore/QEvent>
#include <QtCore/QMap>
#include <QtCore/QVarLengthArray>
#include <QtGui/QConicalGradient>
#include <QtGui/QFrame>
#include <QtGui/QImage>
#include <QtGui/QKeyEvent>
#include <QtGui/QLayout>
#include <QtGui/QMouseEvent>
#include <QtGui/QPainter>
#include <QtGui/QPainterPath>
#include <QtGui/QPixmap>
#include <QtGui/QResizeEvent>
#include <QtGui/QToolTip>
#include <QtGui/QVBoxLayout>
#include <math.h>
Go to the source code of this file.
Classes | |
struct | DoubleColor |
struct | Vertex |
Functions | |
static void | swap (Vertex **a, Vertex **b) |
double | qsqr (double a) |
double | vlen (double x, double y) |
double | vprod (double x1, double y1, double x2, double y2) |
bool | angleBetweenAngles (double p, double a1, double a2) |
static bool | pointAbovePoint (double x, double y, double px, double py, double ax, double ay, double bx, double by) |
static int | pointInLine (double x, double y, double ax, double ay, double bx, double by) |
Variables | |
const double | PI = 3.14159265358979323846264338327950288419717 |
const double | TWOPI = 2.0*PI |
bool angleBetweenAngles | ( | double | p, |
double | a1, | ||
double | a2 | ||
) |
Returns true if the point cos(p),sin(p) is on the arc between cos(a1),sin(a1) and cos(a2),sin(a2); otherwise returns false.
Definition at line 935 of file qtcolortriangle.cpp.
|
static |
A line from a to b is one of several lines in an equilateral polygon, and they are drawn counter clockwise. This line therefore has one side facing in and one facing out of the polygon. This function determines wether (x,y) is on the inside or outside of the given line, defined by the "from" coordinate (ax,ay) and the "to" coordinate (bx,by).
The point (px,py) is the intersection between the a-b line and the perpendicular projection of (x,y) onto that line.
Returns true if (x,y) is above the line; otherwise returns false.
If ax and bx are equal and ay and by are equal (line is a point), this function will return true if (x,y) is equal to this point.
Definition at line 962 of file qtcolortriangle.cpp.
|
static |
if (ax,ay) to (bx,by) describes a line, and (x,y) is a point on that line, returns -1 if (x,y) is outside the (ax,ay) bounds, 1 if it is outside the (bx,by) bounds and 0 if (x,y) is within (ax,ay) and (bx,by).
Definition at line 1016 of file qtcolortriangle.cpp.
|
inline |
Swaps the Vertex at *a with the one at *b.
Definition at line 130 of file qtcolortriangle.cpp.
Referenced by QtColorTriangle::drawTrigon(), QtColorTriangle::mouseMoveEvent(), and QtColorTriangle::mousePressEvent().
|
inline |
Returns the length of the vector (x,y).
Definition at line 916 of file qtcolortriangle.cpp.
References qsqr().
|
inline |
Returns the vector product of (x1,y1) and (x2,y2).
Definition at line 925 of file qtcolortriangle.cpp.
const double PI = 3.14159265358979323846264338327950288419717 |
Definition at line 98 of file qtcolortriangle.cpp.
Referenced by angleBetweenAngles(), QtColorTriangle::mouseMoveEvent(), QtColorTriangle::mousePressEvent(), and QtColorTriangle::setColor().
const double TWOPI = 2.0*PI |
Definition at line 99 of file qtcolortriangle.cpp.
Referenced by angleBetweenAngles(), QtColorTriangle::mouseMoveEvent(), QtColorTriangle::mousePressEvent(), and QtColorTriangle::setColor().