TODO translation into English.

--HG--
branch : develop
This commit is contained in:
dismine 2013-12-21 16:21:40 +02:00
parent eb17639bb7
commit 759d3d8d86
11 changed files with 42 additions and 72 deletions

View File

@ -217,14 +217,13 @@ qreal Calculator::find_var(QString s)
void Calculator::serror(qint32 error) void Calculator::serror(qint32 error)
{ {
//TODO please translate text down here into english
QString e[]= QString e[]=
{ {
"Синтаксическая ошибка", "Syntax error",
"Непарные круглые скобки", "Parentheses do not match",
"Это не выражение", "This is not the expression",
"Предполагается символ равенства", "Assumed the equality symbol",
"Не переменная" "Do not a variable"
}; };
errorMsg->clear(); errorMsg->clear();
*errorMsg = e[error]; *errorMsg = e[error];

View File

@ -346,30 +346,29 @@ QPainterPath VContainer::Equidistant(QVector<QPointF> points, const Detail::Equi
} }
for (qint32 i = 0; i < points.size(); ++i ) for (qint32 i = 0; i < points.size(); ++i )
{ {
//TODO please translate comments into english
if ( i == 0 && eqv == Detail::CloseEquidistant) if ( i == 0 && eqv == Detail::CloseEquidistant)
{//перша точка, ламана замкнена {//first point, polyline closed
ekvPoints<<EkvPoint(QLineF(points[points.size()-2], points[points.size()-1]), QLineF(points[1], points[0]), ekvPoints<<EkvPoint(QLineF(points[points.size()-2], points[points.size()-1]), QLineF(points[1], points[0]),
width); width);
continue; continue;
} }
else if (i == 0 && eqv == Detail::OpenEquidistant) else if (i == 0 && eqv == Detail::OpenEquidistant)
{//перша точка, ламана не замкнена {//first point, polyline doesn't closed
ekvPoints.append(SingleParallelPoint(QLineF(points[0], points[1]), 90, width)); ekvPoints.append(SingleParallelPoint(QLineF(points[0], points[1]), 90, width));
continue; continue;
} }
if (i == points.size()-1 && eqv == Detail::CloseEquidistant) if (i == points.size()-1 && eqv == Detail::CloseEquidistant)
{//остання точка, ламана замкнена {//last point, polyline closed
ekvPoints.append(ekvPoints.at(0)); ekvPoints.append(ekvPoints.at(0));
continue; continue;
} }
else if (i == points.size()-1 && eqv == Detail::OpenEquidistant) else if (i == points.size()-1 && eqv == Detail::OpenEquidistant)
{//остання точка, ламана не замкнена {//остання точка, polyline doesn't closed
ekvPoints.append(SingleParallelPoint(QLineF(points[points.size()-1], points[points.size()-2]), -90, ekvPoints.append(SingleParallelPoint(QLineF(points[points.size()-1], points[points.size()-2]), -90,
width)); width));
continue; continue;
} }
//точка яка не лежить ні на початку ні в кінці //points in the middle of polyline
ekvPoints<<EkvPoint(QLineF(points[i-1], points[i]), QLineF(points[i+1], points[i]), width); ekvPoints<<EkvPoint(QLineF(points[i-1], points[i]), QLineF(points[i+1], points[i]), width);
} }
ekvPoints = CheckLoops(ekvPoints); ekvPoints = CheckLoops(ekvPoints);

View File

@ -203,8 +203,7 @@ QLineF::IntersectType VSpline::CrossingSplLine ( const QLineF &line, QPointF *in
return type; return type;
} }
} }
//TODO please translate into english throw "Can't found point of intersection spline and line.";
throw "Не можу знайти точку перетину сплайну з лінією.";
} }
qreal VSpline::LengthT(qreal t) const qreal VSpline::LengthT(qreal t) const

View File

@ -26,8 +26,6 @@
** **
*************************************************************************/ *************************************************************************/
//TODO: If this class is still relevant, please translate all russian/ukrain text into english
#include "tablewindow.h" #include "tablewindow.h"
#include "ui_tablewindow.h" #include "ui_tablewindow.h"
#include "widgets/vtablegraphicsview.h" #include "widgets/vtablegraphicsview.h"
@ -41,8 +39,8 @@ TableWindow::TableWindow(QWidget *parent)
indexDetail(0), sceneRect(QRectF()) indexDetail(0), sceneRect(QRectF())
{ {
ui->setupUi(this); ui->setupUi(this);
numberDetal = new QLabel("Залишилось 0 деталей.", this); numberDetal = new QLabel(tr("Left 0 details."), this);
colission = new QLabel("Колізій не знайдено.", this); colission = new QLabel(tr("Collisions not found."), this);
ui->statusBar->addWidget(numberDetal); ui->statusBar->addWidget(numberDetal);
ui->statusBar->addWidget(colission); ui->statusBar->addWidget(colission);
outItems = collidingItems = false; outItems = collidingItems = false;
@ -112,11 +110,11 @@ void TableWindow::AddDetail()
ui->actionSave->setEnabled(true); ui->actionSave->setEnabled(true);
} }
} }
numberDetal->setText(QString("Залишилось %1 деталей.").arg(listDetails.count()-indexDetail)); numberDetal->setText(QString(tr("Left %1 details.")).arg(listDetails.count()-indexDetail));
} }
/* /*
* Отримуємо деталі розрахованої моделі для подальшого укладання. * Get details for creation layout.
*/ */
void TableWindow::ModelChosen(QVector<VItem*> listDetails) void TableWindow::ModelChosen(QVector<VItem*> listDetails)
{ {
@ -169,7 +167,7 @@ void TableWindow::saveScene()
QBrush *brush = new QBrush(); QBrush *brush = new QBrush();
brush->setColor( QColor( Qt::white ) ); brush->setColor( QColor( Qt::white ) );
currentScene->setBackgroundBrush( *brush ); currentScene->setBackgroundBrush( *brush );
currentScene->clearSelection(); // Selections would also render to the file currentScene->clearSelection(); // Selections would also render to the file, so need delete them
shadowPaper->setVisible(false); shadowPaper->setVisible(false);
QFileInfo fi(name); QFileInfo fi(name);
if (fi.suffix() == "svg") if (fi.suffix() == "svg")
@ -202,7 +200,7 @@ void TableWindow::checkNext()
{ {
if (outItems == true && collidingItems == true) if (outItems == true && collidingItems == true)
{ {
colission->setText("Колізій не знайдено."); colission->setText(tr("Collisions not found."));
if (indexDetail==listDetails.count()) if (indexDetail==listDetails.count())
{ {
ui->actionSave->setEnabled(true); ui->actionSave->setEnabled(true);
@ -216,7 +214,7 @@ void TableWindow::checkNext()
} }
else else
{ {
colission->setText("Знайдено колізії."); colission->setText(tr("Collisions found."));
ui->actionNext->setDisabled(true); ui->actionNext->setDisabled(true);
ui->actionSave->setEnabled(false); ui->actionSave->setEnabled(false);
} }
@ -257,14 +255,8 @@ void TableWindow::itemColliding(QList<QGraphicsItem *> list, int number)
if (lis.size()-2 <= 0) if (lis.size()-2 <= 0)
{ {
VItem * bitem = qgraphicsitem_cast<VItem *> ( listCollidingItems.at(i) ); VItem * bitem = qgraphicsitem_cast<VItem *> ( listCollidingItems.at(i) );
if (bitem == 0) Q_ASSERT(bitem != 0);
{
qDebug()<<"Не можу привести тип об'єкту";
}
else
{
bitem->setPen(QPen(Qt::black, widthMainLine)); bitem->setPen(QPen(Qt::black, widthMainLine));
}
listCollidingItems.removeAt(i); listCollidingItems.removeAt(i);
} }
} }
@ -272,14 +264,8 @@ void TableWindow::itemColliding(QList<QGraphicsItem *> list, int number)
else if (listCollidingItems.size()==1) else if (listCollidingItems.size()==1)
{ {
VItem * bitem = qgraphicsitem_cast<VItem *> ( listCollidingItems.at(0) ); VItem * bitem = qgraphicsitem_cast<VItem *> ( listCollidingItems.at(0) );
if (bitem == 0) Q_ASSERT(bitem != 0);
{
qDebug()<<"Не можу привести тип об'єкту";
}
else
{
bitem->setPen(QPen(Qt::black, widthMainLine)); bitem->setPen(QPen(Qt::black, widthMainLine));
}
listCollidingItems.clear(); listCollidingItems.clear();
collidingItems = true; collidingItems = true;
} }
@ -369,7 +355,7 @@ void TableWindow::keyPressEvent ( QKeyEvent * event )
if (ui->actionNext->isEnabled() == true ) if (ui->actionNext->isEnabled() == true )
{ {
AddDetail(); AddDetail();
qDebug()<<"Додали деталь."; qDebug()<<"Added detail.";
} }
} }
QMainWindow::keyPressEvent ( event ); QMainWindow::keyPressEvent ( event );

View File

@ -35,8 +35,6 @@ VToolLinePoint::VToolLinePoint(VDomDocument *doc, VContainer *data, const qint64
mainLine(0) mainLine(0)
{ {
Q_ASSERT_X(basePointId > 0, Q_FUNC_INFO, "basePointId <= 0"); Q_ASSERT_X(basePointId > 0, Q_FUNC_INFO, "basePointId <= 0");
//TODO please translate comment
//Лінія, що з'єднує дві точки
QPointF point1 = data->GetPoint(basePointId).toQPointF(); QPointF point1 = data->GetPoint(basePointId).toQPointF();
QPointF point2 = data->GetPoint(id).toQPointF(); QPointF point2 = data->GetPoint(id).toQPointF();
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this); mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this);

View File

@ -66,17 +66,16 @@ void VToolSinglePoint::AddToFile()
AddToCalculation(domElement); AddToCalculation(domElement);
} }
//TODO please translate comments into english
QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{ {
if (change == ItemPositionChange && scene()) if (change == ItemPositionChange && scene())
{ {
// value - это новое положение. // value - this is new position.
QPointF newPos = value.toPointF(); QPointF newPos = value.toPointF();
QRectF rect = scene()->sceneRect(); QRectF rect = scene()->sceneRect();
if (rect.contains(newPos) == false) if (rect.contains(newPos) == false)
{ {
// Сохраняем элемент внутри прямоугольника сцены. // Save element into rect of scene.
newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left()))); newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left())));
newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top()))); newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top())));
return newPos; return newPos;
@ -84,7 +83,7 @@ QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change,
} }
if (change == ItemPositionHasChanged && scene()) if (change == ItemPositionHasChanged && scene())
{ {
// value - это новое положение. // value - this is new position.
QPointF newPos = value.toPointF(); QPointF newPos = value.toPointF();
QDomElement domElement = doc->elementById(QString().setNum(id)); QDomElement domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement()) if (domElement.isElement())

View File

@ -26,7 +26,6 @@
** **
*************************************************************************/ *************************************************************************/
//TODO please translate comments into english
#include "vabstracttool.h" #include "vabstracttool.h"
const QString VAbstractTool::AttrId = QStringLiteral("id"); const QString VAbstractTool::AttrId = QStringLiteral("id");
@ -107,12 +106,12 @@ qint32 VAbstractTool::LineIntersectCircle(const QPointF &center, qreal radius, c
QPointF &p2) QPointF &p2)
{ {
const qreal eps = 1e-8; const qreal eps = 1e-8;
//коефіцієнти для рівняння відрізку //coefficient for equation of segment
qreal a = 0, b = 0, c = 0; qreal a = 0, b = 0, c = 0;
LineCoefficients(line, &a, &b, &c); LineCoefficients(line, &a, &b, &c);
// проекция центра окружности на прямую // projection center of circle on to line
QPointF p = ClosestPoint (line, center); QPointF p = ClosestPoint (line, center);
// сколько всего решений? // how many solutions?
qint32 flag = 0; qint32 flag = 0;
qreal d = QLineF (center, p).length(); qreal d = QLineF (center, p).length();
if (qAbs (d - radius) <= eps) if (qAbs (d - radius) <= eps)
@ -130,10 +129,10 @@ qint32 VAbstractTool::LineIntersectCircle(const QPointF &center, qreal radius, c
return 0; return 0;
} }
} }
// находим расстояние от проекции до точек пересечения // find distance from projection to points of intersection
qreal k = sqrt (radius * radius - d * d); qreal k = sqrt (radius * radius - d * d);
qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length(); qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length();
// добавляем к проекции векторы направленные к точкам пеерсечения // add to projection a vectors aimed to points of intersection
p1 = addVector (p, QPointF (0, 0), QPointF (- b, a), k / t); p1 = addVector (p, QPointF (0, 0), QPointF (- b, a), k / t);
p2 = addVector (p, QPointF (0, 0), QPointF (b, - a), k / t); p2 = addVector (p, QPointF (0, 0), QPointF (b, - a), k / t);
return flag; return flag;
@ -180,7 +179,7 @@ void VAbstractTool::RemoveAllChild(QDomElement &domElement)
void VAbstractTool::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c) void VAbstractTool::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c)
{ {
//коефіцієнти для рівняння відрізку //coefficient for equation of segment
QPointF p1 = line.p1(); QPointF p1 = line.p1();
*a = line.p2().y() - p1.y(); *a = line.p2().y() - p1.y();
*b = p1.x() - line.p2().x(); *b = p1.x() - line.p2().x();

View File

@ -219,8 +219,7 @@ QVariant VToolDetail::itemChange(QGraphicsItem::GraphicsItemChange change, const
{ {
if (change == ItemPositionHasChanged && scene()) if (change == ItemPositionHasChanged && scene())
{ {
//TODO please translate into english // value - this is new position.
// value - это новое положение.
QPointF newPos = value.toPointF(); QPointF newPos = value.toPointF();
//qDebug()<<newPos; //qDebug()<<newPos;
QDomElement domElement = doc->elementById(QString().setNum(id)); QDomElement domElement = doc->elementById(QString().setNum(id));

View File

@ -25,7 +25,6 @@
** along with Valentina. If not, see <http://www.gnu.org/licenses/>. ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
** **
*************************************************************************/ *************************************************************************/
//TODO if this class is still in use: please translate all ukrainian text into english
#include "vcontrolpointspline.h" #include "vcontrolpointspline.h"
@ -48,7 +47,6 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePoint:
this->setAcceptHoverEvents(true); this->setAcceptHoverEvents(true);
this->setPos(controlPoint); this->setPos(controlPoint);
//Лінія, що з'єднує дві точки
QPointF p1, p2; QPointF p1, p2;
LineIntersectCircle(QPointF(), radius, QLineF( QPointF(), splinePoint-controlPoint), p1, p2); LineIntersectCircle(QPointF(), radius, QLineF( QPointF(), splinePoint-controlPoint), p1, p2);
controlLine = new QGraphicsLineItem(QLineF(splinePoint-controlPoint, p1), this); controlLine = new QGraphicsLineItem(QLineF(splinePoint-controlPoint, p1), this);
@ -83,14 +81,14 @@ qint32 VControlPointSpline::LineIntersectCircle(const QPointF &center, qreal rad
QPointF &p2) const QPointF &p2) const
{ {
const qreal eps = 1e-8; const qreal eps = 1e-8;
//коефіцієнти для рівняння відрізку //coefficient for equation of segment
qreal a = line.p2().y() - line.p1().y(); qreal a = line.p2().y() - line.p1().y();
qreal b = line.p1().x() - line.p2().x(); qreal b = line.p1().x() - line.p2().x();
// В даному випадку не використовується. // In this case does not used.
//qreal c = - a * line.p1().x() - b * line.p1().y(); //qreal c = - a * line.p1().x() - b * line.p1().y();
// проекция центра окружности на прямую // projection center of circle on to line
QPointF p = ClosestPoint (line, center); QPointF p = ClosestPoint (line, center);
// сколько всего решений? // how many solutions?
qint32 flag = 0; qint32 flag = 0;
qreal d = QLineF (center, p).length(); qreal d = QLineF (center, p).length();
if (qAbs (d - radius) <= eps) if (qAbs (d - radius) <= eps)
@ -108,10 +106,10 @@ qint32 VControlPointSpline::LineIntersectCircle(const QPointF &center, qreal rad
return 0; return 0;
} }
} }
// находим расстояние от проекции до точек пересечения // find distance from projection to points of intersection
qreal k = sqrt (radius * radius - d * d); qreal k = sqrt (radius * radius - d * d);
qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length(); qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length();
// добавляем к проекции векторы направленные к точкам пеерсечения // add to projection a vectors aimed to points of intersection
p1 = addVector (p, QPointF (0, 0), QPointF (- b, a), k / t); p1 = addVector (p, QPointF (0, 0), QPointF (- b, a), k / t);
p2 = addVector (p, QPointF (0, 0), QPointF (b, - a), k / t); p2 = addVector (p, QPointF (0, 0), QPointF (b, - a), k / t);
return flag; return flag;

View File

@ -25,7 +25,6 @@
** along with Valentina. If not, see <http://www.gnu.org/licenses/>. ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
** **
*************************************************************************/ *************************************************************************/
//TODO if this class is still in use: please translate all ukrainian text into english
#include "vitem.h" #include "vitem.h"
#include "../options.h" #include "../options.h"
@ -52,13 +51,11 @@ void VItem::checkItemChange()
QRectF myrect = sceneBoundingRect(); QRectF myrect = sceneBoundingRect();
if ( rect.contains( myrect )==true ) if ( rect.contains( myrect )==true )
{ {
qDebug()<<"Не виходить за рамки листа";
setPen(QPen(Qt::black, widthMainLine)); setPen(QPen(Qt::black, widthMainLine));
emit itemOut( numInOutList, false ); emit itemOut( numInOutList, false );
} }
else else
{ {
qDebug()<<"Виходить за рамки листа";
setPen(QPen(Qt::red, widthMainLine)); setPen(QPen(Qt::red, widthMainLine));
emit itemOut( numInOutList, true ); emit itemOut( numInOutList, true );
} }
@ -67,15 +64,13 @@ void VItem::checkItemChange()
{ {
list.append( this ); list.append( this );
setPen(QPen(Qt::red, widthMainLine)); setPen(QPen(Qt::red, widthMainLine));
qDebug()<<"Деталь перетинається з іншими деталями "<<numInOutList; emit itemColliding( list, 1 );//Detail intersect with other details.
emit itemColliding( list, 1 );//Деталь перетинається з іншими деталями.
} }
else else
{ {
QList<QGraphicsItem *> itemList; QList<QGraphicsItem *> itemList;
itemList.append( this ); itemList.append( this );
qDebug()<<"Деталь більше не перетинається з іншими деталями "<<numInOutList; emit itemColliding( itemList, 0 );//Detail doesn't intersect more with other details.
emit itemColliding( itemList, 0 );//Деталь більше не перетинається з іншими деталями.
} }
//qDebug()<<"list="<<list.size(); //qDebug()<<"list="<<list.size();
} }

View File

@ -25,7 +25,6 @@
** along with Valentina. If not, see <http://www.gnu.org/licenses/>. ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
** **
*************************************************************************/ *************************************************************************/
//TODO if this class is still in use: please translate ukrainian text into english
#include "vtablegraphicsview.h" #include "vtablegraphicsview.h"
@ -99,7 +98,7 @@ void VTableGraphicsView::wheelEvent(QWheelEvent *event)
{ {
if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier) if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier)
{ {
// Если нажата клавиша CTRL этот код выполнится // If was pressed button CTRL this code will execute
if ((event->delta())>0) if ((event->delta())>0)
{ {
ZoomIn(); ZoomIn();