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)
{
//TODO please translate text down here into english
QString e[]=
{
"Синтаксическая ошибка",
"Непарные круглые скобки",
"Это не выражение",
"Предполагается символ равенства",
"Не переменная"
"Syntax error",
"Parentheses do not match",
"This is not the expression",
"Assumed the equality symbol",
"Do not a variable"
};
errorMsg->clear();
*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 )
{
//TODO please translate comments into english
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]),
width);
continue;
}
else if (i == 0 && eqv == Detail::OpenEquidistant)
{//перша точка, ламана не замкнена
{//first point, polyline doesn't closed
ekvPoints.append(SingleParallelPoint(QLineF(points[0], points[1]), 90, width));
continue;
}
if (i == points.size()-1 && eqv == Detail::CloseEquidistant)
{//остання точка, ламана замкнена
{//last point, polyline closed
ekvPoints.append(ekvPoints.at(0));
continue;
}
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,
width));
continue;
}
//точка яка не лежить ні на початку ні в кінці
//points in the middle of polyline
ekvPoints<<EkvPoint(QLineF(points[i-1], points[i]), QLineF(points[i+1], points[i]), width);
}
ekvPoints = CheckLoops(ekvPoints);

View file

@ -203,8 +203,7 @@ QLineF::IntersectType VSpline::CrossingSplLine ( const QLineF &line, QPointF *in
return type;
}
}
//TODO please translate into english
throw "Не можу знайти точку перетину сплайну з лінією.";
throw "Can't found point of intersection spline and line.";
}
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 "ui_tablewindow.h"
#include "widgets/vtablegraphicsview.h"
@ -41,8 +39,8 @@ TableWindow::TableWindow(QWidget *parent)
indexDetail(0), sceneRect(QRectF())
{
ui->setupUi(this);
numberDetal = new QLabel("Залишилось 0 деталей.", this);
colission = new QLabel("Колізій не знайдено.", this);
numberDetal = new QLabel(tr("Left 0 details."), this);
colission = new QLabel(tr("Collisions not found."), this);
ui->statusBar->addWidget(numberDetal);
ui->statusBar->addWidget(colission);
outItems = collidingItems = false;
@ -112,11 +110,11 @@ void TableWindow::AddDetail()
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)
{
@ -169,7 +167,7 @@ void TableWindow::saveScene()
QBrush *brush = new QBrush();
brush->setColor( QColor( Qt::white ) );
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);
QFileInfo fi(name);
if (fi.suffix() == "svg")
@ -202,7 +200,7 @@ void TableWindow::checkNext()
{
if (outItems == true && collidingItems == true)
{
colission->setText("Колізій не знайдено.");
colission->setText(tr("Collisions not found."));
if (indexDetail==listDetails.count())
{
ui->actionSave->setEnabled(true);
@ -216,7 +214,7 @@ void TableWindow::checkNext()
}
else
{
colission->setText("Знайдено колізії.");
colission->setText(tr("Collisions found."));
ui->actionNext->setDisabled(true);
ui->actionSave->setEnabled(false);
}
@ -257,14 +255,8 @@ void TableWindow::itemColliding(QList<QGraphicsItem *> list, int number)
if (lis.size()-2 <= 0)
{
VItem * bitem = qgraphicsitem_cast<VItem *> ( listCollidingItems.at(i) );
if (bitem == 0)
{
qDebug()<<"Не можу привести тип об'єкту";
}
else
{
bitem->setPen(QPen(Qt::black, widthMainLine));
}
Q_ASSERT(bitem != 0);
bitem->setPen(QPen(Qt::black, widthMainLine));
listCollidingItems.removeAt(i);
}
}
@ -272,14 +264,8 @@ void TableWindow::itemColliding(QList<QGraphicsItem *> list, int number)
else if (listCollidingItems.size()==1)
{
VItem * bitem = qgraphicsitem_cast<VItem *> ( listCollidingItems.at(0) );
if (bitem == 0)
{
qDebug()<<"Не можу привести тип об'єкту";
}
else
{
bitem->setPen(QPen(Qt::black, widthMainLine));
}
Q_ASSERT(bitem != 0);
bitem->setPen(QPen(Qt::black, widthMainLine));
listCollidingItems.clear();
collidingItems = true;
}
@ -369,7 +355,7 @@ void TableWindow::keyPressEvent ( QKeyEvent * event )
if (ui->actionNext->isEnabled() == true )
{
AddDetail();
qDebug()<<"Додали деталь.";
qDebug()<<"Added detail.";
}
}
QMainWindow::keyPressEvent ( event );

View file

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

View file

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

View file

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

View file

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

View file

@ -25,7 +25,6 @@
** 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"
@ -48,7 +47,6 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePoint:
this->setAcceptHoverEvents(true);
this->setPos(controlPoint);
//Лінія, що з'єднує дві точки
QPointF p1, p2;
LineIntersectCircle(QPointF(), radius, QLineF( QPointF(), splinePoint-controlPoint), p1, p2);
controlLine = new QGraphicsLineItem(QLineF(splinePoint-controlPoint, p1), this);
@ -83,14 +81,14 @@ qint32 VControlPointSpline::LineIntersectCircle(const QPointF &center, qreal rad
QPointF &p2) const
{
const qreal eps = 1e-8;
//коефіцієнти для рівняння відрізку
//coefficient for equation of segment
qreal a = line.p2().y() - line.p1().y();
qreal b = line.p1().x() - line.p2().x();
// В даному випадку не використовується.
// In this case does not used.
//qreal c = - a * line.p1().x() - b * line.p1().y();
// проекция центра окружности на прямую
// projection center of circle on to line
QPointF p = ClosestPoint (line, center);
// сколько всего решений?
// how many solutions?
qint32 flag = 0;
qreal d = QLineF (center, p).length();
if (qAbs (d - radius) <= eps)
@ -108,10 +106,10 @@ qint32 VControlPointSpline::LineIntersectCircle(const QPointF &center, qreal rad
return 0;
}
}
// находим расстояние от проекции до точек пересечения
// find distance from projection to points of intersection
qreal k = sqrt (radius * radius - d * d);
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);
p2 = addVector (p, QPointF (0, 0), QPointF (b, - a), k / t);
return flag;

View file

@ -25,7 +25,6 @@
** 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 "../options.h"
@ -52,13 +51,11 @@ void VItem::checkItemChange()
QRectF myrect = sceneBoundingRect();
if ( rect.contains( myrect )==true )
{
qDebug()<<"Не виходить за рамки листа";
setPen(QPen(Qt::black, widthMainLine));
emit itemOut( numInOutList, false );
}
else
{
qDebug()<<"Виходить за рамки листа";
setPen(QPen(Qt::red, widthMainLine));
emit itemOut( numInOutList, true );
}
@ -67,15 +64,13 @@ void VItem::checkItemChange()
{
list.append( this );
setPen(QPen(Qt::red, widthMainLine));
qDebug()<<"Деталь перетинається з іншими деталями "<<numInOutList;
emit itemColliding( list, 1 );//Деталь перетинається з іншими деталями.
emit itemColliding( list, 1 );//Detail intersect with other details.
}
else
{
QList<QGraphicsItem *> itemList;
itemList.append( this );
qDebug()<<"Деталь більше не перетинається з іншими деталями "<<numInOutList;
emit itemColliding( itemList, 0 );//Деталь більше не перетинається з іншими деталями.
emit itemColliding( itemList, 0 );//Detail doesn't intersect more with other details.
}
//qDebug()<<"list="<<list.size();
}

View file

@ -25,7 +25,6 @@
** 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"
@ -99,7 +98,7 @@ void VTableGraphicsView::wheelEvent(QWheelEvent *event)
{
if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier)
{
// Если нажата клавиша CTRL этот код выполнится
// If was pressed button CTRL this code will execute
if ((event->delta())>0)
{
ZoomIn();