Update id of line. Find point of tool triangle. Ignore full update for dialog of

tool single point.

--HG--
branch : develop
This commit is contained in:
dismine 2013-10-21 10:45:49 +03:00
parent 0263b60e3c
commit c6ae85b5ac
5 changed files with 21 additions and 11 deletions

View File

@ -796,18 +796,17 @@ void VContainer::CreateManTableIGroup (){
AddStandartTableCell("Vzy", VStandartTableCell(1328, 0, 49));
AddStandartTableCell("Vlop", VStandartTableCell(1320, 0, 49));
AddStandartTableCell("Vps", VStandartTableCell(811, -1, 36));
AddStandartTableCell("Osh", VStandartTableCell(404,8, 2));
AddStandartTableCell("OgI", VStandartTableCell(1034, 36, 4));
AddStandartTableCell("OgII", VStandartTableCell(1044, 38, 2));
AddStandartTableCell("OgIII", VStandartTableCell(1000, 40, 0));
AddStandartTableCell("Ot", VStandartTableCell(780, 40, 0));
AddStandartTableCell("Ob", VStandartTableCell(984, 30, 10));
AddStandartTableCell("ObI", VStandartTableCell(964, 24, 12));
AddStandartTableCell("Ssh", VStandartTableCell(202,4, 1));
AddStandartTableCell("SgI", VStandartTableCell(517, 18, 2));
AddStandartTableCell("SgII", VStandartTableCell(522, 19, 1));
AddStandartTableCell("SgIII", VStandartTableCell(500, 20, 0));
AddStandartTableCell("St", VStandartTableCell(390, 20, 0));
AddStandartTableCell("Sb", VStandartTableCell(492, 15, 5));
AddStandartTableCell("SbI", VStandartTableCell(482, 12, 6));
AddStandartTableCell("Obed", VStandartTableCell(566, 18, 6));
AddStandartTableCell("Ok", VStandartTableCell(386, 8, 8));
AddStandartTableCell("Oi", VStandartTableCell(380, 8, 6));
AddStandartTableCell("Osch", VStandartTableCell(234, 4, 4));
AddStandartTableCell("Os", VStandartTableCell(350, 2, 8));
AddStandartTableCell("Dsb", VStandartTableCell(1120, 0, 44));
AddStandartTableCell("Dsp", VStandartTableCell(1110, 0, 43));
AddStandartTableCell("Dn", VStandartTableCell(826, -3, 37));

View File

@ -63,6 +63,7 @@ void VToolLine::Create(const qint64 &_id, const qint64 &firstPoint, const qint64
id = data->getNextId();
data->AddLine(firstPoint, secondPoint);
} else {
data->UpdateId(id);
data->AddLine(firstPoint, secondPoint);
if(parse != Document::FullParse){
doc->UpdateToolData(id, data);

View File

@ -29,6 +29,7 @@
VToolSinglePoint::VToolSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, Tool::Sources typeCreation,
QGraphicsItem * parent ):VToolPoint(doc, data, id, parent),
dialogSinglePoint(QSharedPointer<DialogSinglePoint>()){
ignoreFullUpdate = true;
this->setFlag(QGraphicsItem::ItemIsMovable, true);
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
if(typeCreation == Tool::FromGui){

View File

@ -74,7 +74,11 @@ QPointF VToolTriangle::FindPoint(const QPointF axisP1, const QPointF axisP2, con
qreal a = QLineF(axisP2, firstPoint).length();
qreal b = QLineF(axisP2, secondPoint).length();
if(c*c == a*a + b*b){
return axisP2;
QLineF l1(axisP2, firstPoint);
QLineF l2(axisP2, secondPoint);
if(l1.angleTo(l2) == 90 || l2.angleTo(l1) == 90){
return axisP2;
}
}
QLineF line = QLineF(axisP1, axisP2);
@ -84,10 +88,14 @@ QPointF VToolTriangle::FindPoint(const QPointF axisP1, const QPointF axisP2, con
a = QLineF(line.p2(), firstPoint).length();
b = QLineF(line.p2(), secondPoint).length();
if(static_cast<qint32>(c*c) == static_cast<qint32>(a*a + b*b)){
return line.p2();
QLineF l1(axisP2, firstPoint);
QLineF l2(axisP2, secondPoint);
if(l1.angleTo(l2) == 90 || l2.angleTo(l1) == 90){
return line.p2();
}
}
if(c*c < a*a + b*b){
return axisP2;
return line.p2();
qWarning()<<tr("Can't find point.")<<Q_FUNC_INFO;
}
}

View File

@ -62,6 +62,7 @@ VModelingLine *VModelingLine::Create(const qint64 &_id, const qint64 &firstPoint
id = data->getNextId();
} else {
if(parse != Document::FullParse){
data->UpdateId(id);
doc->UpdateToolData(id, data);
}
}