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>

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 | ) |
Definition at line 169 of file util_math.cpp.
Referenced by ScPageOutput::DrawItem_PathText(), and PageItem_PathText::DrawObj_Item().
| QPolygon FlattenPath | ( | const FPointArray & | ina, | |
| QList< uint > & | Segs | |||
| ) |
Definition at line 225 of file util_math.cpp.
References FPointArray::point(), FPointArray::size(), FPoint::x(), and FPoint::y().
Referenced by ScribusDoc::AdjustItemSize(), PageItem::convertClip(), ScribusDoc::convertItemTo(), ScPreview::createPreview(), OODPlug::finishNodeParsing(), Serializer::importCollection(), itemShape(), ScribusDoc::MirrorPolyH(), ScribusDoc::MirrorPolyV(), LegacyMode::mousePressEvent(), CreateMode::mousePressEvent(), NodeEditContext::moveClipPoint(), SVGPlug::parseGroup(), OODPlug::parseGroup(), SVGPlug::parseImage(), OODPlug::parseLine(), EPSPlug::parseOutput(), OODPlug::parsePath(), OODPlug::parsePolygon(), OODPlug::parsePolyline(), AIPlug::processData(), AIPlug::processRaster(), and PageItem::SetFrameShape().
| uint getDouble | ( | QString | in, | |
| bool | raw | |||
| ) |
Definition at line 76 of file util_math.cpp.
Referenced by ScImgDataLoader_PS::parseData(), PSLib::PS_image(), and PSLib::PS_ImageData().
| FPoint getMaxClipF | ( | FPointArray * | Clip | ) |
Definition at line 258 of file util_math.cpp.
References FPointArray::point(), FPoint::setXY(), FPointArray::size(), FPoint::x(), and FPoint::y().
Referenced by ScribusDoc::AdjustItemSize(), StencilReader::createObjects(), WMFImport::finishCmdParsing(), SVGPlug::finishNode(), OODPlug::finishNodeParsing(), FontSample(), ScribusDoc::MirrorPolyH(), ScribusDoc::MirrorPolyV(), LegacyMode::mouseReleaseEvent(), FreehandMode::mouseReleaseEvent(), CreateMode::mouseReleaseEvent(), SVGPlug::parseCircle(), SVGPlug::parseEllipse(), StencilReader::parseGroup(), StencilReader::parseGroupProperties(), OODPlug::parseLine(), EPSPlug::parseOutput(), OODPlug::parsePath(), OODPlug::parsePolygon(), OODPlug::parsePolyline(), SVGPlug::parseRect(), PDFLibCore::PDF_Begin_Doc(), AIPlug::processData(), and ScribusView::TransformPoly().
| FPoint getMinClipF | ( | FPointArray * | Clip | ) |
Definition at line 278 of file util_math.cpp.
References FPointArray::point(), FPoint::setXY(), FPointArray::size(), FPoint::x(), and FPoint::y().
Referenced by ScribusDoc::AdjustItemSize(), StencilReader::createObjects(), ExtImageProps::ExtImageProps(), ScribusDoc::MirrorPolyH(), ScribusDoc::MirrorPolyV(), LegacyMode::mousePressEvent(), BezierMode::mousePressEvent(), LegacyMode::mouseReleaseEvent(), FreehandMode::mouseReleaseEvent(), BezierMode::mouseReleaseEvent(), CreateMode::mouseReleaseEvent(), StencilReader::parseGroup(), StencilReader::parseGroupProperties(), PDFLibCore::PDF_Begin_Doc(), ArrowChooser::rebuildList(), scribus_bezierline(), scribus_polygon(), scribus_polyline(), and ScribusView::TransformPoly().
| 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().
| 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 | |||
| ) |
Definition at line 140 of file util_math.cpp.
References M_PI, and FPointArray::setPoint().
Referenced by LegacyMode::mousePressEvent(), CreateMode::mousePressEvent(), LegacyMode::mouseReleaseEvent(), and CreateMode::mouseReleaseEvent().
