スケッチャーにおいて、無効なデータムを指定するととても遅くなる。

ファイルSketchObjectPylmp.cppのファクションsetDatum()において、そのエラー判定は遅いようだ。
そしてオブジェクト数が増えるほどに、その処理はさらに重くなる。

問題が起きた環境。

私は、System X3105で走るEdubuntu 12.04.2環境上にて、git colen コマンドで取得したFreeCAD 0.13をビルドした。

問題の確認方法。

スケッチャー上で多角形を描いてから、全ての辺においてデータムを拘束する。
単辺を選択する。それが無効な値となるために、選択された単辺のデータムが「選択されていない辺を合計した長さよりも大きい値」となるように変更する。

問題の挙動。

エラーダイアログが表示されるまでの時間が長い。故に、ユーザは固まったように遅くなったウインドウとの対話を強いられる。
オブジェクトのデータムが増えるほどに深刻な問題となるであろう。

望ましい挙動。

無効な値が含まれているデータムの発見からエラーメッセージの提示までの処理時間が短く対話的であることが望ましい。

In Engrish

It will be very slowlly in Sketcher, if you specify an invalid datum.

Faction of setDatum() in file SketchObjectPylmp.cpp, the error determination that is slowlly.
To increase as the number of objects, the process will be heavier and more.

PyObject* SketchObjectPy::setDatum(PyObject *args)
{
    double Datum;
    int    Index;
    if (!PyArg_ParseTuple(args, "id", &Index, &Datum))
        return 0;

    int err=this->getSketchObjectPtr()->setDatum(Index, Datum);
    if (err) {
        std::stringstream str;
        if (err == -1)
            str << "Invalid constraint index: " << Index;
        else if (err == -3)
            str << "Cannot set the datum because the sketch contains conflicting constraints";
        else if (err == -2)
            str << "Datum " << Datum << " for the constraint with index " << Index << " is invalid";
        else if (err == -4)
            str << "Negative datum values are not valid for the constraint with index " << Index;
        else if (err == -5)
            str << "Zero is not a valid datum for the constraint with index " << Index;
        else
            str << "Unexpected problem at setting datum " << Datum << " for the constraint with index " << Index;
        PyErr_SetString(PyExc_ValueError, str.str().c_str());
        return 0;
    }

    Py_Return;
}

The environment in which the problem occurred.

On the environment in Edubuntu 12.04.2 running on IBM System X3105, I have to build FreeCAD 0.13 obtained by the command git colen. (see also in Japanese doc at http://d.hatena.ne.jp/maimi09/20130211 ).

OS: Ubuntu 12.04.2 LTS
Platform: 64-bit
Version: 0.13.1904 (Git)
Branch: master
Hash: 89fae529ffcf9810e30e562e51ef79bcc69ac332
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.1

How to check the problem.

From drawing a polygon on the Sketcher, constraining the datum in all edges.
Select a single edge. Changed to be "value greater than the total length of edges that are not selected" for it is an invalid value, a single datum of the selected edge.

Behavior of the problem.

Time taken to display an error dialog is long. Thus, the user is forced to interact with the window that was slowlly as frozen.
Will become a serious problem as the datum of the object increases.

Desirable behavior.

It is desirable that the processing time up to the presentation of an interactive error message is short from the discovery of datum that contains an invalid value.

THANKS for Your rearding.