mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-16 02:30:51 +00:00
Fix save images for bent edges. Add more statistic.
This commit is contained in:
@@ -10,6 +10,12 @@
|
||||
$g_lang["newsList"] = array();
|
||||
|
||||
$newsIndex = 0;
|
||||
$g_lang["newsList"][$newsIndex]["title"] = "Edges bend";
|
||||
$g_lang["newsList"][$newsIndex]["text"] = "We add ability to bend edges. Select edge and click to + or -.";
|
||||
$g_lang["newsList"][$newsIndex]["autor"] = "Admin";
|
||||
$g_lang["newsList"][$newsIndex]["date"] = "15.02.2019";
|
||||
$newsIndex ++;
|
||||
|
||||
$g_lang["newsList"][$newsIndex]["title"] = "Floyd–Warshall algorithm";
|
||||
$g_lang["newsList"][$newsIndex]["text"] = "We add Floyd–Warshall algorithm. Now you can get distance matrix.";
|
||||
$g_lang["newsList"][$newsIndex]["autor"] = "Admin";
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
|
||||
|
||||
$newsIndex = 0;
|
||||
$g_lang["newsList"][$newsIndex]["title"] = "Изгиб дуг";
|
||||
$g_lang["newsList"][$newsIndex]["text"] = "Добавили возможность изгибать дуги. Выделите дугу и нажимайте на кнопке + или -.";
|
||||
$g_lang["newsList"][$newsIndex]["autor"] = "Админ";
|
||||
$g_lang["newsList"][$newsIndex]["date"] = "15.02.2019";
|
||||
$newsIndex ++;
|
||||
|
||||
$g_lang["newsList"][$newsIndex]["title"] = "Завершение сбора стредств";
|
||||
$g_lang["newsList"][$newsIndex]["text"] = "Благодаря неравнодушным пользователям нашего сервиса мы завершили сбор средств для разработки новых алгоритмов для сайта. Мы уже добавили алгоритм поиска диаметра и радиуса графа, далее будет поиск максимального потока и раскраска графа.";
|
||||
$g_lang["newsList"][$newsIndex]["autor"] = "Админ";
|
||||
|
||||
@@ -336,11 +336,13 @@ DefaultHandler.prototype.MouseUp = function(pos)
|
||||
handler.selectedObject.model.ChangeCurvedValue(DefaultHandler.prototype.curvedValue);
|
||||
handler.needRedraw = true;
|
||||
handler.app.redrawGraph();
|
||||
userAction("Edge.Bend");
|
||||
});
|
||||
$('#message').on('click', '#decCurvel', function(){
|
||||
handler.selectedObject.model.ChangeCurvedValue(-DefaultHandler.prototype.curvedValue);
|
||||
handler.needRedraw = true;
|
||||
handler.app.redrawGraph();
|
||||
userAction("Edge.Bend");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -469,7 +471,6 @@ ConnectionGraphHandler.prototype.MouseDown = function(pos)
|
||||
var selectedObject = this.GetSelectedGraph(pos);
|
||||
if (selectedObject && (selectedObject instanceof BaseVertex))
|
||||
{
|
||||
userAction("ConnectionHandler.Mouse");
|
||||
this.SelectVertex(selectedObject);
|
||||
}
|
||||
else
|
||||
@@ -498,7 +499,6 @@ ConnectionGraphHandler.prototype.SelectSecond = function(selectedObject)
|
||||
|
||||
ConnectionGraphHandler.prototype.SelectFirstVertexMenu = function(vertex1Text, vertex)
|
||||
{
|
||||
userAction("ConnectionHandler.Menu");
|
||||
this.firstObject = null;
|
||||
this.SelectVertex(vertex);
|
||||
}
|
||||
@@ -513,7 +513,6 @@ ConnectionGraphHandler.prototype.UpdateFirstVertexMenu = function(vertex1Text)
|
||||
|
||||
ConnectionGraphHandler.prototype.SelectSecondVertexMenu = function(vertex2Text, vertex)
|
||||
{
|
||||
userAction("ConnectionHandler.Menu");
|
||||
this.SelectVertex(vertex);
|
||||
}
|
||||
|
||||
|
||||
@@ -862,5 +862,25 @@ Graph.prototype.getGraphBBox = function (viewportSize)
|
||||
pointMax = pointMax.max(vertex.position.add(deltaVector));
|
||||
}
|
||||
|
||||
var max_cruvled_length = 32;
|
||||
|
||||
for(i = 0; i < this.edges.length; i++)
|
||||
{
|
||||
var edge = this.edges[i];
|
||||
|
||||
if (edge.model.type == EdgeModels.cruvled)
|
||||
{
|
||||
var max_cruvled = edge.vertex2.position.subtract(edge.vertex1.position).length() / max_cruvled_length;
|
||||
|
||||
for (j = 0; j < max_cruvled; j++)
|
||||
{
|
||||
var point = edge.model.GetCurvedPoint(edge.vertex1.position, edge.vertex2.position, j / max_cruvled);
|
||||
var deltaVector = new Point(max_cruvled_length, max_cruvled_length);
|
||||
pointMin = pointMin.min(point.subtract(deltaVector));
|
||||
pointMax = pointMax.max(point.add(deltaVector));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Rect(pointMin, pointMax);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<script src="<?= Root('i/js/dev/jquery-ui.js')?>"></script>
|
||||
<script src="<?= Root('i/js/dev/jquery.feedback_me.js')?>"></script>
|
||||
<script src="<?= Root("script/example.js?v=14")?>" ></script>
|
||||
<script src="<?= Root("script/example.js?v=15")?>" ></script>
|
||||
</head>
|
||||
<!--
|
||||
<div class="pull-right">
|
||||
|
||||
Reference in New Issue
Block a user