22#ifndef KIG_MISC_COMMON_H
23#define KIG_MISC_COMMON_H
25#include "coordinate.h"
29#include <tdeversion.h>
35#if KDE_IS_VERSION( 3, 1, 0 )
36#define KIG_USE_KDOUBLEVALIDATOR
38#undef KIG_USE_KDOUBLEVALIDATOR
41#undef KIG_USE_KDOUBLEVALIDATOR
47extern const double double_inf;
54double getDoubleFromUser(
const TQString& caption,
const TQString& label,
double value,
55 TQWidget* parent,
bool* ok,
double min,
double max,
int decimals );
87 double length()
const {
return (
b -
a ).length(); }
165 const double sa,
const double angle,
178double calcDistancePointLine(
const Coordinate& p,
189void calcBorderPoints(
double& xa,
double& xb,
double& ya,
double& yb,
const Rect& r);
210void calcRayBorderPoints(
const double xa,
const double xb,
double& ya,
211 double& yb,
const Rect& r );
229bool isSingular(
const double& a,
const double& b,
230 const double& c,
const double& d );
251 const double sa,
const double a,
const double fault );
255 double sqra,
double sqrb );
263 const int width,
const ObjectImp* imp,
const KigWidget& w );
266T kigMin(
const T& a,
const T& b )
268 return a < b ? a : b;
272T kigMax(
const T& a,
const T& b )
274 return a > b ? a : b;
278T kigAbs(
const T& a )
280 return a >= 0 ? a : -a;
284int kigSgn(
const T& a )
286 return a == 0 ? 0 : a > 0 ? +1 : -1;
289extern const double test_threshold;
The Coordinate class is the basic class representing a 2D location by its x and y components.
Definition: coordinate.h:34
Simple class representing a line.
Definition: common.h:60
Coordinate b
Another point on the line.
Definition: common.h:79
const Coordinate dir() const
The direction of the line.
Definition: common.h:83
LineData(const Coordinate &na, const Coordinate &nb)
Constructor.
Definition: common.h:71
bool isOrthogonalTo(const LineData &l) const
Return true if this line is orthogonal to l.
Coordinate a
One point on the line.
Definition: common.h:75
double length() const
The length from a to b.
Definition: common.h:87
bool isParallelTo(const LineData &l) const
Return true if this line is parallel to l.
LineData()
Definition: common.h:67
The Object class represents the behaviour of an object after it is calculated.
Definition: object_imp.h:219