Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

util_math.h File Reference

#include <cmath>
#include <vector>
#include <QString>
#include <QPolygon>
#include <QList>
#include <QPainterPath>
#include "scribusapi.h"

Include dependency graph for util_math.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool SCRIBUS_API compareDouble (double a, double b)
 Compare double values by pre-multiplying by 10000 and converting to long if possible. If premultiplication does not allow to store result in a long value, perform a standard comparison.
FPoint SCRIBUS_API getMaxClipF (FPointArray *Clip)
FPoint SCRIBUS_API getMinClipF (FPointArray *Clip)
double SCRIBUS_API xy2Deg (double x, double y)
FPoint SCRIBUS_API projectPointOnLine (FPoint p, QPointF lineStart, QPointF lineEnd)
QPolygon SCRIBUS_API FlattenPath (const FPointArray &ina, QList< uint > &Segs)
QList< QPainterPath > SCRIBUS_API decomposePath (QPainterPath &path)
QPolygon SCRIBUS_API RegularPolygon (double w, double h, uint c, bool star, double factor, double rota)
FPointArray SCRIBUS_API RegularPolygonF (double w, double h, uint c, bool star, double factor, double rota)
uint SCRIBUS_API getDouble (QString in, bool raw)
double SCRIBUS_API sind (double)
double SCRIBUS_API cosd (double)
double SCRIBUS_API square (double)
double SCRIBUS_API distance (double, double)
double SCRIBUS_API constrainAngle (double angle, double constrain)
 Constrains an angle of rotation to 45 degree intervals Will make code simpler and reduce interval or provide as a parameter.
double SCRIBUS_API getRotationFromMatrix (QMatrix &matrix, double def)
 Get the rotation angle (in radian) from a transformation matrix Will make code simpler and reduce interval or provide as a parameter.


Function Documentation

bool SCRIBUS_API compareDouble ( double  a,
double  b 
)

Compare double values by pre-multiplying by 10000 and converting to long if possible. If premultiplication does not allow to store result in a long value, perform a standard comparison.

Definition at line 299 of file util_math.cpp.

double SCRIBUS_API constrainAngle ( double  angle,
double  constrain 
)

Constrains an angle of rotation to 45 degree intervals Will make code simpler and reduce interval or provide as a parameter.

Parameters:
double angle Angle in degrees
double contrain value in degrees
Return values:
double Constrained angle

Definition at line 311 of file util_math.cpp.

Referenced by LineMove::adjustBounds(), LegacyMode::mouseMoveEvent(), and LegacyMode::mouseReleaseEvent().

double cosd ( double  alpha  )  [inline]

Definition at line 82 of file util_math.h.

References M_PI.

Referenced by LineMove::setRotation(), and PrefsManager::WritePref().

QList<QPainterPath> SCRIBUS_API decomposePath ( QPainterPath &  path  ) 

double distance ( double  x,
double  y 
) [inline]

Definition at line 67 of file util_math.h.

QPolygon SCRIBUS_API FlattenPath ( const FPointArray ina,
QList< uint > &  Segs 
)

uint SCRIBUS_API getDouble ( QString  in,
bool  raw 
)

FPoint SCRIBUS_API getMaxClipF ( FPointArray Clip  ) 

FPoint SCRIBUS_API getMinClipF ( FPointArray Clip  ) 

double SCRIBUS_API getRotationFromMatrix ( QMatrix &  matrix,
double  def 
)

Get the rotation angle (in radian) from a transformation matrix Will make code simpler and reduce interval or provide as a parameter.

Parameters:
matrix the transformation matrix
def the value that should be return if matrix is not a rotation matrix
Return values:
double the rotation angle

Definition at line 323 of file util_math.cpp.

References value.

Referenced by AIPlug::processData(), and AIPlug::processRaster().

FPoint SCRIBUS_API projectPointOnLine ( FPoint  p,
QPointF  lineStart,
QPointF  lineEnd 
)

Definition at line 209 of file util_math.cpp.

References FPoint::x(), and FPoint::y().

QPolygon SCRIBUS_API RegularPolygon ( double  w,
double  h,
uint  c,
bool  star,
double  factor,
double  rota 
)

Definition at line 111 of file util_math.cpp.

References M_PI.

Referenced by PolygonWidget::UpdatePreView().

FPointArray SCRIBUS_API RegularPolygonF ( double  w,
double  h,
uint  c,
bool  star,
double  factor,
double  rota 
)

double sind ( double  alpha  )  [inline]

Definition at line 77 of file util_math.h.

References M_PI.

Referenced by LineMove::setRotation().

double square ( double  x  )  [inline]

Definition at line 62 of file util_math.h.

double xy2Deg ( double  x,
double  y 
) [inline]

Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.