Merge with release.
This commit is contained in:
commit
03a7c5667e
|
@ -1,3 +1,8 @@
|
||||||
|
# Version 0.3.2 Released May 15, 2015
|
||||||
|
- [#298] Segmented Curve isn't selected in Seam Allowance tool.
|
||||||
|
- [#299] Error when opening .val file.
|
||||||
|
- [#302] Error when creating layout.
|
||||||
|
|
||||||
# Version 0.3.1 Released April 24, 2015
|
# Version 0.3.1 Released April 24, 2015
|
||||||
- [#263] Regression. Union tool doesn't work.
|
- [#263] Regression. Union tool doesn't work.
|
||||||
- For tool Curve intersect axis fixed wrong calculation point in case with too small scene rect size.
|
- For tool Curve intersect axis fixed wrong calculation point in case with too small scene rect size.
|
||||||
|
|
2
dist/debian/changelog
vendored
2
dist/debian/changelog
vendored
|
@ -1,4 +1,4 @@
|
||||||
valentina (0.3.1) trusty; urgency=low
|
valentina (0.3.2) trusty; urgency=low
|
||||||
|
|
||||||
* Auto build.
|
* Auto build.
|
||||||
|
|
||||||
|
|
2
dist/rpm/_service
vendored
2
dist/rpm/_service
vendored
|
@ -1,7 +1,7 @@
|
||||||
<services>
|
<services>
|
||||||
<service name="tar_scm">
|
<service name="tar_scm">
|
||||||
<param name="url">https://github.com/dismine/Valentina.git</param>
|
<param name="url">https://github.com/dismine/Valentina.git</param>
|
||||||
<param name="versionprefix">0.3.1</param>
|
<param name="versionprefix">0.3.2</param>
|
||||||
<param name="filename">valentina</param>
|
<param name="filename">valentina</param>
|
||||||
<param name="scm">git</param>
|
<param name="scm">git</param>
|
||||||
<param name="versionformat">%at</param>
|
<param name="versionformat">%at</param>
|
||||||
|
|
2
dist/rpm/valentina.spec
vendored
2
dist/rpm/valentina.spec
vendored
|
@ -33,7 +33,7 @@ BuildRequires: update-desktop-files
|
||||||
|
|
||||||
Requires: poppler-utils
|
Requires: poppler-utils
|
||||||
|
|
||||||
Version: 0.3.1
|
Version: 0.3.2
|
||||||
Release: 0
|
Release: 0
|
||||||
URL: https://bitbucket.org/dismine/valentina
|
URL: https://bitbucket.org/dismine/valentina
|
||||||
License: GPL-3.0+
|
License: GPL-3.0+
|
||||||
|
|
|
@ -712,11 +712,9 @@ void DialogTool::NamePointChanged()
|
||||||
if (edit)
|
if (edit)
|
||||||
{
|
{
|
||||||
QString name = edit->text();
|
QString name = edit->text();
|
||||||
name.replace(" ", "");
|
QRegularExpression rx(nameRegExp);
|
||||||
QRegExpValidator v(QRegExp(nameRegExp), this);
|
|
||||||
int pos = 0;
|
|
||||||
if (name.isEmpty() || (pointName != name && data->IsUnique(name) == false) ||
|
if (name.isEmpty() || (pointName != name && data->IsUnique(name) == false) ||
|
||||||
v.validate(name, pos) == QValidator::Invalid)
|
rx.match(name).hasMatch() == false)
|
||||||
{
|
{
|
||||||
flagName = false;
|
flagName = false;
|
||||||
ChangeColor(labelEditNamePoint, Qt::red);
|
ChangeColor(labelEditNamePoint, Qt::red);
|
||||||
|
|
|
@ -76,7 +76,7 @@ QVector<QPointF> VAbstractCurve::FromBegin(const QVector<QPointF> &points, const
|
||||||
{
|
{
|
||||||
if (theBegin == false)
|
if (theBegin == false)
|
||||||
{
|
{
|
||||||
if (PointInSegment(begin, points.at(i), points.at(i+1)))
|
if (IsPointOnLineSegment(begin, points.at(i), points.at(i+1)))
|
||||||
{
|
{
|
||||||
theBegin = true;
|
theBegin = true;
|
||||||
segment.append(begin);
|
segment.append(begin);
|
||||||
|
|
|
@ -352,30 +352,67 @@ void VGObject::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool VGObject::PointInSegment(const QPointF &t, const QPointF &p1, const QPointF &p2)
|
/**
|
||||||
|
* @brief IsPointOnLineSegment Check if the point is on the line segment.
|
||||||
|
*
|
||||||
|
* Original idea http://www.sunshine2k.de/coding/java/PointOnLine/PointOnLine.html
|
||||||
|
*/
|
||||||
|
bool VGObject::IsPointOnLineSegment(const QPointF &t, const QPointF &p1, const QPointF &p2)
|
||||||
{
|
{
|
||||||
const qreal eps = 1e-8;
|
// The test point must lie inside the bounding box spanned by the two line points.
|
||||||
|
if (not ( (p1.x() <= t.x() && t.x() <= p2.x()) || (p2.x() <= t.x() && t.x() <= p1.x()) ))
|
||||||
qreal a = p2.y() - p1.y();
|
|
||||||
qreal b = p1.x() - p2.x();
|
|
||||||
qreal c = - a * p1.x() - b * p1.y();
|
|
||||||
if (qAbs(a * t.x() + b * t.y() + c) > eps)
|
|
||||||
{
|
{
|
||||||
|
// test point not in x-range
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PointInBox (t, p1, p2);
|
if (not ( (p1.y() <= t.y() && t.y() <= p2.y()) || (p2.y() <= t.y() && t.y() <= p1.y()) ))
|
||||||
|
{
|
||||||
|
// test point not in y-range
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test via the perp dot product (PDP)
|
||||||
|
return IsPointOnLineviaPDP(t, p1, p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool VGObject::PointInBox(const QPointF &t, const QPointF &p1, const QPointF &p2)
|
/**
|
||||||
|
* @brief IsPointOnLineviaPDP use the perp dot product (PDP) way.
|
||||||
|
*
|
||||||
|
* The pdp is zero only if the t lies on the line e1 = vector from p1 to p2.
|
||||||
|
*/
|
||||||
|
bool VGObject::IsPointOnLineviaPDP(const QPointF &t, const QPointF &p1, const QPointF &p2)
|
||||||
{
|
{
|
||||||
const qreal eps = 1e-8;
|
return ( qAbs(PerpDotProduct(p1, p2, t) < GetEpsilon(p1, p2)) );
|
||||||
|
}
|
||||||
|
|
||||||
return (qAbs (t.x() - qMin(p1.x(), p2.x())) <= eps || qMin(p1.x(), p2.x()) <= t.x()) &&
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
(qAbs (qMax(p1.x(), p2.x()) - t.x()) <= eps || qMax(p1.x(), p2.x()) >= t.x()) &&
|
/**
|
||||||
(qAbs (t.y() - qMin(p1.y(), p2.y())) <= eps || qMin(p1.y(), p2.y()) <= t.y()) &&
|
* @brief PerpDotProduct Calculates the area of the parallelogram of the three points.
|
||||||
(qAbs (qMax(p1.y(), p2.y()) - t.y()) <= eps || qMax(p1.y(), p2.y()) >= t.y());
|
* This is actually the same as the area of the triangle defined by the three points, multiplied by 2.
|
||||||
|
* @return 2 * triangleArea(a,b,c)
|
||||||
|
*/
|
||||||
|
double VGObject::PerpDotProduct(const QPointF &t, const QPointF &p1, const QPointF &p2)
|
||||||
|
{
|
||||||
|
return (p1.x() - t.x()) * (p2.y() - t.y()) - (p1.y() - t.y()) * (p2.x() - t.x());
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetEpsilon solve the floating-point accuraccy problem.
|
||||||
|
*
|
||||||
|
* There is the floating-point accuraccy problem, so instead of checking against zero, some epsilon value has to be
|
||||||
|
* used. Because the size of the pdp value depends on the length of the vectors, no static value can be used. One
|
||||||
|
* approach is to compare the pdp/area value to the fraction of another area which also depends on the length of the
|
||||||
|
* line e1=(p1, p2), e.g. the area of the square with side e1 which is computed below
|
||||||
|
*/
|
||||||
|
double VGObject::GetEpsilon(const QPointF &p1, const QPointF &p2)
|
||||||
|
{
|
||||||
|
const int dx1 = p2.toPoint().x() - p1.toPoint().x();
|
||||||
|
const int dy1 = p2.toPoint().y() - p1.toPoint().y();
|
||||||
|
const double epsilon = 0.003 * (dx1 * dx1 + dy1 * dy1);
|
||||||
|
return epsilon;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,13 +78,16 @@ public:
|
||||||
static QPointF ClosestPoint(const QLineF &line, const QPointF &point);
|
static QPointF ClosestPoint(const QLineF &line, const QPointF &point);
|
||||||
static QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k);
|
static QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k);
|
||||||
static void LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c);
|
static void LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c);
|
||||||
static bool PointInSegment (const QPointF &t, const QPointF &p1, const QPointF &p2);
|
static bool IsPointOnLineSegment (const QPointF &t, const QPointF &p1, const QPointF &p2);
|
||||||
static bool PointInBox (const QPointF &t, const QPointF &p1, const QPointF &p2);
|
|
||||||
|
|
||||||
static QVector<QPointF> GetReversePoints(const QVector<QPointF> &points);
|
static QVector<QPointF> GetReversePoints(const QVector<QPointF> &points);
|
||||||
static int GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints);
|
static int GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints);
|
||||||
private:
|
private:
|
||||||
QSharedDataPointer<VGObjectData> d;
|
QSharedDataPointer<VGObjectData> d;
|
||||||
|
|
||||||
|
static bool IsPointOnLineviaPDP(const QPointF &t, const QPointF &p1, const QPointF &p2);
|
||||||
|
static double PerpDotProduct(const QPointF &t, const QPointF &p1, const QPointF &p2);
|
||||||
|
static double GetEpsilon(const QPointF &p1, const QPointF &p2);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VGOBJECT_H
|
#endif // VGOBJECT_H
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
//Same regexp in pattern.xsd shema file. Don't forget synchronize.
|
//Same regexp in pattern.xsd shema file. Don't forget synchronize.
|
||||||
const QString nameRegExp = QStringLiteral("^([^0-9-*/^+=\\s\\(\\)%:;!.,`'\"]){1,1}([^-*/^+=\\s\\(\\)%:;!.,`'\"]){0,}$");
|
const QString nameRegExp = QStringLiteral("^([^0-9*/^+\\-=\\s()?%:;!.,`'\"]){1,1}([^*/^+\\-=\\s()?%:;!.,`'\"]){0,}$");
|
||||||
|
|
||||||
// From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This
|
// From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This
|
||||||
// furthermore blows up the binary sizes.
|
// furthermore blows up the binary sizes.
|
||||||
|
|
|
@ -107,8 +107,8 @@ QPointF VToolPointOfContact::FindPoint(const qreal &radius, const QPointF ¢e
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
const bool flagP1 = VGObject::PointInSegment (p1, firstPoint, secondPoint);
|
const bool flagP1 = VGObject::IsPointOnLineSegment (p1, firstPoint, secondPoint);
|
||||||
const bool flagP2 = VGObject::PointInSegment (p2, firstPoint, secondPoint);
|
const bool flagP2 = VGObject::IsPointOnLineSegment (p2, firstPoint, secondPoint);
|
||||||
if ((flagP1 == true && flagP2 == true) ||
|
if ((flagP1 == true && flagP2 == true) ||
|
||||||
(flagP1 == false && flagP2 == false)/*In case we have something wrong*/)
|
(flagP1 == false && flagP2 == false)/*In case we have something wrong*/)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
extern const int MAJOR_VERSION = 0;
|
extern const int MAJOR_VERSION = 0;
|
||||||
extern const int MINOR_VERSION = 3;
|
extern const int MINOR_VERSION = 3;
|
||||||
extern const int DEBUG_VERSION = 1;
|
extern const int DEBUG_VERSION = 2;
|
||||||
|
|
||||||
extern const QString APP_VERSION(QStringLiteral("%1.%2.%3.%4").arg(MAJOR_VERSION).arg(MINOR_VERSION)
|
extern const QString APP_VERSION(QStringLiteral("%1.%2.%3.%4").arg(MAJOR_VERSION).arg(MINOR_VERSION)
|
||||||
.arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE));
|
.arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE));
|
||||||
|
|
|
@ -39,8 +39,8 @@ extern const QString APP_VERSION;
|
||||||
|
|
||||||
// Change version number in version.cpp too.
|
// Change version number in version.cpp too.
|
||||||
|
|
||||||
#define VER_FILEVERSION 0,3,1,0
|
#define VER_FILEVERSION 0,3,2,0
|
||||||
#define VER_FILEVERSION_STR "0.3.1.0\0"
|
#define VER_FILEVERSION_STR "0.3.2.0\0"
|
||||||
|
|
||||||
#define VER_PRODUCTVERSION VER_FILEVERSION
|
#define VER_PRODUCTVERSION VER_FILEVERSION
|
||||||
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR
|
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR
|
||||||
|
|
|
@ -60,7 +60,7 @@ QWidget *TextDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem
|
||||||
QLineEdit *editor = new QLineEdit(parent);
|
QLineEdit *editor = new QLineEdit(parent);
|
||||||
editor->setLocale(parent->locale());
|
editor->setLocale(parent->locale());
|
||||||
//Same regex pattern in xsd file
|
//Same regex pattern in xsd file
|
||||||
editor->setValidator( new QRegExpValidator(QRegExp(regex)) );
|
editor->setValidator( new QRegularExpressionValidator(QRegularExpression(regex)) );
|
||||||
connect(editor, &QLineEdit::editingFinished, this, &TextDelegate::commitAndCloseEditor);
|
connect(editor, &QLineEdit::editingFinished, this, &TextDelegate::commitAndCloseEditor);
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,8 +431,8 @@ void VToolOptionsPropertyBrowser::SetPointName(const QString &name)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRegExp rx(nameRegExp);
|
QRegularExpression rx(nameRegExp);
|
||||||
if (name.isEmpty() || VContainer::IsUnique(name) == false || rx.exactMatch(name) == false)
|
if (name.isEmpty() || VContainer::IsUnique(name) == false || rx.match(name).hasMatch() == false)
|
||||||
{
|
{
|
||||||
idToProperty[VAbstractTool::AttrName]->setValue(i->name());
|
idToProperty[VAbstractTool::AttrName]->setValue(i->name());
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,7 +274,7 @@
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:simpleType name="shortName">
|
<xs:simpleType name="shortName">
|
||||||
<xs:restriction base="xs:string">
|
<xs:restriction base="xs:string">
|
||||||
<xs:pattern value="^([^0-9-*/^+=\s\(\)%:;!.,`'\"]){1,1}([^-*/^+=\s\(\)%:;!.,`'\"]){0,}$"/>
|
<xs:pattern value="^([^0-9*/^+\-=\s()?%:;!.,`'\"]){1,1}([^*/^+\-=\s()?%:;!.,`'\"]){0,}$"/>
|
||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
<xs:simpleType name="units">
|
<xs:simpleType name="units">
|
||||||
|
|
|
@ -203,8 +203,7 @@ int VContour::EdgesCount() const
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QLineF axis = QLineF(0, 0, d->paperWidth, 0);
|
const int n = qFloor(EmptySheetEdge().length()/d->shift);
|
||||||
const int n = qFloor(axis.length()/d->shift);
|
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -226,7 +225,7 @@ QLineF VContour::GlobalEdge(int i) const
|
||||||
if (d->globalContour.isEmpty())
|
if (d->globalContour.isEmpty())
|
||||||
{
|
{
|
||||||
// Because sheet is blank we have one global edge for all cases - Ox axis.
|
// Because sheet is blank we have one global edge for all cases - Ox axis.
|
||||||
const QLineF axis = QLineF(0, 0, d->paperWidth - 5, 0);
|
const QLineF axis = EmptySheetEdge();
|
||||||
if (d->shift == 0)
|
if (d->shift == 0)
|
||||||
{
|
{
|
||||||
return axis;
|
return axis;
|
||||||
|
@ -318,3 +317,9 @@ void VContour::AppendWhole(QVector<QPointF> &contour, const VLayoutDetail &detai
|
||||||
++j;
|
++j;
|
||||||
}while (processedEdges < nD);
|
}while (processedEdges < nD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QLineF VContour::EmptySheetEdge() const
|
||||||
|
{
|
||||||
|
return QLineF(0, 0, d->paperWidth - 5, 0);
|
||||||
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
|
|
||||||
QVector<QPointF> UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const;
|
QVector<QPointF> UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const;
|
||||||
|
|
||||||
|
QLineF EmptySheetEdge() const;
|
||||||
int EdgesCount() const;
|
int EdgesCount() const;
|
||||||
QLineF GlobalEdge(int i) const;
|
QLineF GlobalEdge(int i) const;
|
||||||
QVector<QPointF> CutEdge(const QLineF &edge) const;
|
QVector<QPointF> CutEdge(const QLineF &edge) const;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user