[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Classes | Functions | Variables
qtcolortriangle.cpp File Reference
#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>
Include dependency graph for qtcolortriangle.cpp:

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
 

Function Documentation

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.

References PI, and TWOPI.

static bool pointAbovePoint ( double  x,
double  y,
double  px,
double  py,
double  ax,
double  ay,
double  bx,
double  by 
)
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 int pointInLine ( double  x,
double  y,
double  ax,
double  ay,
double  bx,
double  by 
)
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.

double qsqr ( double  a)
inline

Returns a * a.

Definition at line 907 of file qtcolortriangle.cpp.

Referenced by vlen().

static void swap ( Vertex **  a,
Vertex **  b 
)
static

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().

double vlen ( double  x,
double  y 
)
inline

Returns the length of the vector (x,y).

Definition at line 916 of file qtcolortriangle.cpp.

References qsqr().

double vprod ( double  x1,
double  y1,
double  x2,
double  y2 
)
inline

Returns the vector product of (x1,y1) and (x2,y2).

Definition at line 925 of file qtcolortriangle.cpp.

Variable Documentation

const double PI = 3.14159265358979323846264338327950288419717
const double TWOPI = 2.0*PI

Generated by doxygen 1.8.5