Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

util_math.cpp File Reference

#include "util_math.h"
#include <QBitmap>
#include <QFile>
#include <QFileInfo>
#include <QDir>
#include <QCheckBox>
#include <QWidget>
#include <QPixmap>
#include <QList>
#include <QByteArray>
#include <QPolygon>
#include <QImageReader>
#include <algorithm>
#include "scconfig.h"
#include "commonstrings.h"
#include <QProcess>
#include "scmessagebox.h"
#include "scpixmapcache.h"
#include "scpaths.h"
#include <jpeglib.h>
#include <jerror.h>
#include "pageitem.h"
#include "scribus.h"
#include "scribusdoc.h"
#include "scribusview.h"
#include <zlib.h>

Include dependency graph for util_math.cpp:

Go to the source code of this file.

Defines

#define XMD_H

Functions

uint getDouble (QString in, bool raw)
QPolygon RegularPolygon (double w, double h, uint c, bool star, double factor, double rota)
FPointArray RegularPolygonF (double w, double h, uint c, bool star, double factor, double rota)
QList< QPainterPath > decomposePath (QPainterPath &path)
FPoint projectPointOnLine (FPoint p, QPointF lineStart, QPointF lineEnd)
QPolygon FlattenPath (const FPointArray &ina, QList< uint > &Segs)
FPoint getMaxClipF (FPointArray *Clip)
FPoint getMinClipF (FPointArray *Clip)
bool 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.
double 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 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.


Define Documentation

#define XMD_H

Definition at line 48 of file util_math.cpp.


Function Documentation

bool 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.

Referenced by SingleLine::operator==().

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

QList<QPainterPath> decomposePath ( QPainterPath &  path  ) 

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

uint getDouble ( QString  in,
bool  raw 
)

FPoint getMaxClipF ( FPointArray Clip  ) 

FPoint getMinClipF ( FPointArray Clip  ) 

double 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 projectPointOnLine ( FPoint  p,
QPointF  lineStart,
QPointF  lineEnd 
)

Definition at line 209 of file util_math.cpp.

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

QPolygon 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 RegularPolygonF ( double  w,
double  h,
uint  c,
bool  star,
double  factor,
double  rota 
)

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