LibreCAD

Changes On Branch jf_fixes
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch jf_fixes Excluding Merge-Ins

This is equivalent to a diff from bbe76b18e5 to 113e356859

2026-04-14
14:35
Added scripts for install/uninstall/update in /usr/local/ directories. Leaf check-in: 113e356859 user: johnfound tags: jf_fixes
2025-11-17
06:50
Another, more general way to fix the "zero" problem. RS_Vector now can't have values lower than RS_TOLERANCE. The previous fix was rolled back. I am not sure how this fix will affect the performance, but at first glance seems everything is OK. check-in: adcf5798e7 user: johnfound tags: jf_fixes
2025-09-10
17:13
Sync with the main repository, but there are so many changes, that I am not very sure how will merge with my changes. Leaf check-in: 3defcaed62 user: johnfound tags: trunk, origin/weblate, master
2024-12-20
08:55
Merge the changes from the official repository. check-in: cd11d14313 user: johnfound tags: jf_fixes
08:42
Sync with the github repository. check-in: bbe76b18e5 user: johnfound tags: trunk, origin/weblate, master
2024-11-27
23:06
Arcs and splines (#1967) * source files layout (WIP) * initial support for Named Views (dxf support, widget, toolbar and menu changes). * displaying drawing variables in drawing options * localization update for drawing variables * better support of shortcuts for 1..5 views * option to show current action's icon options widget * PR readme * PR readme * remove spline point action * restoring fit points on spline points from dxf, restored getNearestPoint on Spline, SplineAppendPoint actions * Spline Add Point action * spline modification actions refactoring, localization strings * explode spline action * option for showing ID entities in dialog/entity info - #1951 * fix for check version on startup if disabled - #1920 * spline from polyline action * spline delete between two points action, menu/toolbars adjustments, localization * arc3points - alternative points mode added * arc 2 points commands * draw arc center radius alternative mode, localization * fix for #1950 * intersections with construction lines which are not in construction layer (as a fix for angle snap with entity snap) * fix for polyline append command (support of arcs), changes in draw polyline UI options (buttons), commands for polyline daw mode * ArcTangental - alternative arc mode support by CTRL * selection entities by type in SelectWindow, alternative mode for selection/deselection * deselecting entities with SHIFT pressed * translations update * draw points lattice command, select points command * out RS_Vector to debug * paste to points command * cleanup * commands for arc2p commands * source code layout * changes readme --------- Co-authored-by: sand1024 <sand1024@gmail.com> check-in: 49b93c42a5 user: noreply@github.com tags: trunk, origin/weblate, master

Changes to CMakeLists.txt.

1
2
3
4
5

6
7
8
9
10
11
12
cmake_minimum_required(VERSION 3.22)
project(LibreCAD VERSION 2.2.2)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


#set(MIN_GW_PATH_PREFIX "c:\\DevTools\\QT\\6.7.2\\mingw_64")
set(MIN_GW_PATH_PREFIX "d:\\Qt\\QT6\\6.7.0\\mingw_64")
#set(MIN_GW_PATH_PREFIX "c:\\DevTools\\QT\\6.7.2\\mingw_64")
set(BOOST_DIR "c:\\Local\\boost_1_84_0")
set(Boost_INCLUDE_DIR "c:\\Local\\boost_1_84_0")






>







1
2
3
4
5
6
7
8
9
10
11
12
13
cmake_minimum_required(VERSION 3.22)
project(LibreCAD VERSION 2.2.2)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

#set(MIN_GW_PATH_PREFIX "c:\\DevTools\\QT\\6.7.2\\mingw_64")
set(MIN_GW_PATH_PREFIX "d:\\Qt\\QT6\\6.7.0\\mingw_64")
#set(MIN_GW_PATH_PREFIX "c:\\DevTools\\QT\\6.7.2\\mingw_64")
set(BOOST_DIR "c:\\Local\\boost_1_84_0")
set(Boost_INCLUDE_DIR "c:\\Local\\boost_1_84_0")

200
201
202
203
204
205
206


207
208
209
210
211
212
213
include_directories(librecad/src/ui/dock_widgets/entity_info)
include_directories(librecad/src/ui/dock_widgets/pen_palette)
include_directories(librecad/src/ui/dock_widgets/block_widget)
include_directories(librecad/src/ui/dock_widgets/library_widget)
include_directories(librecad/src/ui/dock_widgets/layer_widget)
include_directories(librecad/src/ui/dock_widgets/views_list)
#Temporary disabled for build


#include_directories(plugins/align)
#include_directories(plugins/asciifile)
#include_directories(plugins/divide)
#include_directories(plugins/gear)
#include_directories(plugins/list)
#include_directories(plugins/picfile)
#include_directories(plugins/plotequation)







>
>







201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
include_directories(librecad/src/ui/dock_widgets/entity_info)
include_directories(librecad/src/ui/dock_widgets/pen_palette)
include_directories(librecad/src/ui/dock_widgets/block_widget)
include_directories(librecad/src/ui/dock_widgets/library_widget)
include_directories(librecad/src/ui/dock_widgets/layer_widget)
include_directories(librecad/src/ui/dock_widgets/views_list)
#Temporary disabled for build
include_directories(plugins/iso_fittings)
include_directories(generated/plugin/iso_fittings/ui)
#include_directories(plugins/align)
#include_directories(plugins/asciifile)
#include_directories(plugins/divide)
#include_directories(plugins/gear)
#include_directories(plugins/list)
#include_directories(plugins/picfile)
#include_directories(plugins/plotequation)

Added install.









































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

rsync unix/librecad /usr/local/bin/
rsync unix/ttf2lff /usr/local/bin/

strip -s /usr/local/bin/librecad
strip -s /usr/local/bin/ttf2lff

rm -rf /usr/local/lib/librecad/plugins/*
rsync --mkpath -r unix/resources/plugins/* /usr/local/lib/librecad/plugins/

strip -s /usr/share/librecad/plugins/*

rsync --mkpath -r unix/appdata/librecad.desktop /usr/local/share/applications/

rsync --mkpath -r unix/resources/fonts/* /usr/local/share/librecad/fonts/
rsync --mkpath -r unix/resources/library/* /usr/local/share/librecad/library/
rsync --mkpath -r unix/resources/patterns/* /usr/local/share/librecad/patterns/

rsync --mkpath CI/librecad.svg /usr/local/share/icons/hicolor/scalable/apps/

Changes to librecad/src/actions/drawing/draw/curve/lc_actiondrawarc2pointsbase.cpp.

34
35
36
37
38
39
40

41
42
43
44
45
46
47
48
49
50
51

void LC_ActionDrawArc2PointsBase::trigger() {
    RS_PreviewActionInterface::trigger();
    RS_Entity* createdEntity = createArc(getStatus(), endPoint, alternated, true);
    if (createdEntity != nullptr){
        if (document) {
            document->startUndoCycle();

            createdEntity->setSelected(true);
            createdEntity->setLayerToActive();
            createdEntity->setPenToActive();
            createdEntity->setParent(container);
            container->addEntity(createdEntity);
            document->addUndoable(createdEntity);
            document->endUndoCycle();
        }
        setStatus(SetPoint1);
        alternated = false;
        deleteHighlights();







>



<







34
35
36
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51

void LC_ActionDrawArc2PointsBase::trigger() {
    RS_PreviewActionInterface::trigger();
    RS_Entity* createdEntity = createArc(getStatus(), endPoint, alternated, true);
    if (createdEntity != nullptr){
        if (document) {
            document->startUndoCycle();
            createdEntity->setParent(container);
            createdEntity->setSelected(true);
            createdEntity->setLayerToActive();
            createdEntity->setPenToActive();

            container->addEntity(createdEntity);
            document->addUndoable(createdEntity);
            document->endUndoCycle();
        }
        setStatus(SetPoint1);
        alternated = false;
        deleteHighlights();

Changes to librecad/src/actions/drawing/draw/dimensions/lc_actioncircledimbase.cpp.

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

void LC_ActionCircleDimBase::trigger() {
    RS_ActionDimension::trigger();

    if (entity != nullptr) {
        preparePreview(entity, *pos, alternateAngle);
        auto *newEntity = createDim(container);
        newEntity->setLayerToActive();
        newEntity->setPenToActive();
        newEntity->update();
        container->addEntity(newEntity);

        addToDocumentUndoable(newEntity);

        graphicView->redraw(RS2::RedrawDrawing);







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

void LC_ActionCircleDimBase::trigger() {
    RS_ActionDimension::trigger();

    if (entity != nullptr) {
        preparePreview(entity, *pos, alternateAngle);
        auto *newEntity = createDim(container);
        newEntity->setLayerToActive(true);
        newEntity->setPenToActive();
        newEntity->update();
        container->addEntity(newEntity);

        addToDocumentUndoable(newEntity);

        graphicView->redraw(RS2::RedrawDrawing);

Changes to librecad/src/actions/drawing/draw/dimensions/lc_actiondimarc.cpp.

72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
    if (!dimArcData.centre.valid){
        RS_DEBUG->print(RS_Debug::D_ERROR, "LC_ActionDimArc::trigger: dimArcData.centre is not valid.\n");
        return;
    }

    auto newEntity= new LC_DimArc(container, *data, dimArcData);

    newEntity->setLayerToActive();
    newEntity->setPenToActive();
    newEntity->update();
    container->addEntity(newEntity);

    addToDocumentUndoable(newEntity);

    setStatus(SetEntity);







|







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
    if (!dimArcData.centre.valid){
        RS_DEBUG->print(RS_Debug::D_ERROR, "LC_ActionDimArc::trigger: dimArcData.centre is not valid.\n");
        return;
    }

    auto newEntity= new LC_DimArc(container, *data, dimArcData);

    newEntity->setLayerToActive(true);
    newEntity->setPenToActive();
    newEntity->update();
    container->addEntity(newEntity);

    addToDocumentUndoable(newEntity);

    setStatus(SetEntity);

Changes to librecad/src/actions/drawing/draw/dimensions/lc_actiondimlinearbase.cpp.

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
}

void LC_ActionDimLinearBase::trigger(){
    RS_ActionDimension::trigger();

    preparePreview();
    auto *dim = createDim(container);
    dim->setLayerToActive();
    dim->setPenToActive();
    dim->update();
    container->addEntity(dim);

    addToDocumentUndoable(dim);

    graphicView->redraw(RS2::RedrawDrawing);







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
}

void LC_ActionDimLinearBase::trigger(){
    RS_ActionDimension::trigger();

    preparePreview();
    auto *dim = createDim(container);
    dim->setLayerToActive(true);
    dim->setPenToActive();
    dim->update();
    container->addEntity(dim);

    addToDocumentUndoable(dim);

    graphicView->redraw(RS2::RedrawDrawing);

Changes to librecad/src/actions/drawing/draw/dimensions/lc_actiondrawdimbaseline.cpp.

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
}

void LC_ActionDrawDimBaseline::trigger() {
    RS_ActionDimension::trigger();

    preparePreview();
    auto *dim = createDim(container);
    dim->setLayerToActive();
    dim->setPenToActive();
    dim->update();
    container->addEntity(dim);

    addToDocumentUndoable(dim);

    graphicView->redraw(RS2::RedrawDrawing);







|







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
}

void LC_ActionDrawDimBaseline::trigger() {
    RS_ActionDimension::trigger();

    preparePreview();
    auto *dim = createDim(container);
    dim->setLayerToActive(true);
    dim->setPenToActive();
    dim->update();
    container->addEntity(dim);

    addToDocumentUndoable(dim);

    graphicView->redraw(RS2::RedrawDrawing);

Changes to librecad/src/actions/drawing/draw/dimensions/rs_actiondimangular.cpp.

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

void RS_ActionDimAngular::trigger(){
    RS_PreviewActionInterface::trigger();

    if (line1->getStartpoint().valid && line2->getStartpoint().valid) {
        auto* newEntity = new RS_DimAngular( container,*data,*edata);

        newEntity->setLayerToActive();
        newEntity->setPenToActive();
        newEntity->update();
        container->addEntity(newEntity);

        addToDocumentUndoable(newEntity);

        RS_Vector rz {graphicView->getRelativeZero()};







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

void RS_ActionDimAngular::trigger(){
    RS_PreviewActionInterface::trigger();

    if (line1->getStartpoint().valid && line2->getStartpoint().valid) {
        auto* newEntity = new RS_DimAngular( container,*data,*edata);

        newEntity->setLayerToActive(true);
        newEntity->setPenToActive();
        newEntity->update();
        container->addEntity(newEntity);

        addToDocumentUndoable(newEntity);

        RS_Vector rz {graphicView->getRelativeZero()};

Changes to librecad/src/actions/drawing/draw/dimensions/rs_actiondimleader.cpp.

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

void RS_ActionDimLeader::trigger(){
    RS_PreviewActionInterface::trigger();

    if (!pPoints->points.empty()){

        auto *leaderEntity = new RS_Leader(container, RS_LeaderData(true));
        leaderEntity->setLayerToActive();
        leaderEntity->setPenToActive();

        for (const auto &vp: pPoints->points) {
            leaderEntity->addVertex(vp);
        }

        container->addEntity(leaderEntity);







|







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

void RS_ActionDimLeader::trigger(){
    RS_PreviewActionInterface::trigger();

    if (!pPoints->points.empty()){

        auto *leaderEntity = new RS_Leader(container, RS_LeaderData(true));
        leaderEntity->setLayerToActive(true);
        leaderEntity->setPenToActive();

        for (const auto &vp: pPoints->points) {
            leaderEntity->addVertex(vp);
        }

        container->addEntity(leaderEntity);

Changes to librecad/src/actions/drawing/rs_actiondefault.cpp.

515
516
517
518
519
520
521

522
523
524
525
526
527
528
                data.useCurrentAttributes = false;
                data.keepOriginals = isControl(e);
                data.offset = pPoints->v2 - pPoints->v1;
                m.move(data);
                goToNeutralStatus();
                updateSelectionWidget();
                deleteSnapper();

                break;
            }
            case MovingRef: {             
                RS_Vector mouse = snapPoint(e);

                deletePreview();








>







515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
                data.useCurrentAttributes = false;
                data.keepOriginals = isControl(e);
                data.offset = pPoints->v2 - pPoints->v1;
                m.move(data);
                goToNeutralStatus();
                updateSelectionWidget();
                deleteSnapper();
                clearSelection = true;
                break;
            }
            case MovingRef: {             
                RS_Vector mouse = snapPoint(e);

                deletePreview();

666
667
668
669
670
671
672

673
674
675
676
677
678
679

                    document->endUndoCycle();
                }
                graphicView->redraw();

                goToNeutralStatus();
                updateSelectionWidget();

                break;
            }
            default:
                break;
        }
    } else if (e->button() == Qt::RightButton){
        //cleanup







>







667
668
669
670
671
672
673
674
675
676
677
678
679
680
681

                    document->endUndoCycle();
                }
                graphicView->redraw();

                goToNeutralStatus();
                updateSelectionWidget();
                clearSelection = true;
                break;
            }
            default:
                break;
        }
    } else if (e->button() == Qt::RightButton){
        //cleanup
690
691
692
693
694
695
696


697
698
699
700
701
702
703
704
705
706





707
708
709
710
711
712
713
714
715
716
717
718
719



720
721
722
723
724
725
726
            // select single entity:
            RS_Entity *en = catchEntity(e);

            if (en != nullptr){
                deletePreview();

                RS_Selection s(*container, graphicView);



                s.selectSingle(en);

                updateSelectionWidget();

                e->accept();

                goToNeutralStatus();
            } else {
                setStatus(SetCorner2);





            }
            break;
        }
        case SetCorner2: {
            //v2 = snapPoint(e);
            pPoints->v2 = toGraph(e);

            // select window:
            //if (graphicView->toGuiDX(v1.distanceTo(v2))>20) {
            deletePreview();

            bool cross = (pPoints->v1.x > pPoints->v2.x);
            RS_Selection s(*container, graphicView);



            bool select = (e->modifiers() & Qt::ShiftModifier) == 0;
            s.selectWindow(typeToSelect, pPoints->v1, pPoints->v2, select, cross);

            updateSelectionWidget();

            goToNeutralStatus();
            e->accept();







>
>










>
>
>
>
>













>
>
>







692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
            // select single entity:
            RS_Entity *en = catchEntity(e);

            if (en != nullptr){
                deletePreview();

                RS_Selection s(*container, graphicView);
                if (clearSelection) s.selectAll(false);
                clearSelection = false;

                s.selectSingle(en);

                updateSelectionWidget();

                e->accept();

                goToNeutralStatus();
            } else {
                setStatus(SetCorner2);
                if (clearSelection) {
                    RS_Selection s(*container, graphicView);
                    s.selectAll(false);
                    clearSelection = false;
                }
            }
            break;
        }
        case SetCorner2: {
            //v2 = snapPoint(e);
            pPoints->v2 = toGraph(e);

            // select window:
            //if (graphicView->toGuiDX(v1.distanceTo(v2))>20) {
            deletePreview();

            bool cross = (pPoints->v1.x > pPoints->v2.x);
            RS_Selection s(*container, graphicView);
            if (clearSelection) s.selectAll(false);
            clearSelection = false;

            bool select = (e->modifiers() & Qt::ShiftModifier) == 0;
            s.selectWindow(typeToSelect, pPoints->v1, pPoints->v2, select, cross);

            updateSelectionWidget();

            goToNeutralStatus();
            e->accept();

Changes to librecad/src/actions/drawing/rs_actiondefault.h.

82
83
84
85
86
87
88



89
90
91
92
93
94
95
    struct Points;
    std::unique_ptr<Points> pPoints;
    RS2::SnapRestriction snapRestriction;
    RS2::EntityType typeToSelect = RS2::EntityType::EntityUnknown;

    bool allowEntityQuickInfoForCTRL = false;
    bool allowEntityQuickInfoAuto = false;



    void checkSupportOfQuickEntityInfo();
    void clearQuickInfoWidget();
    void updateQuickInfoWidget(RS_Entity *pEntity);
    void goToNeutralStatus();
    RS2::CursorType doGetMouseCursor(int status) override;
    void onMouseLeftButtonRelease(int status, QMouseEvent *e) override;
    void onMouseRightButtonRelease(int status, QMouseEvent *e) override;







>
>
>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    struct Points;
    std::unique_ptr<Points> pPoints;
    RS2::SnapRestriction snapRestriction;
    RS2::EntityType typeToSelect = RS2::EntityType::EntityUnknown;

    bool allowEntityQuickInfoForCTRL = false;
    bool allowEntityQuickInfoAuto = false;

    bool clearSelection = false;

    void checkSupportOfQuickEntityInfo();
    void clearQuickInfoWidget();
    void updateQuickInfoWidget(RS_Entity *pEntity);
    void goToNeutralStatus();
    RS2::CursorType doGetMouseCursor(int status) override;
    void onMouseLeftButtonRelease(int status, QMouseEvent *e) override;
    void onMouseRightButtonRelease(int status, QMouseEvent *e) override;

Changes to librecad/src/lib/actions/rs_snapper.cpp.

371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
        double ds2=mouseCoord.squaredTo(t);
        if (ds2 < ds2Min){
            ds2Min=ds2;
            pImpData->snapSpot = t;
        }
    }

    if (snapMode.snapGrid) {
        t = snapGrid(mouseCoord);
        double ds2=mouseCoord.squaredTo(t);
        if (ds2 < ds2Min){
//            ds2Min=ds2;
            pImpData->snapSpot = t;
        }
    }







|







371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
        double ds2=mouseCoord.squaredTo(t);
        if (ds2 < ds2Min){
            ds2Min=ds2;
            pImpData->snapSpot = t;
        }
    }

    if (snapMode.snapGrid && (graphicView == nullptr || graphicView->isGridOn())) {
        t = snapGrid(mouseCoord);
        double ds2=mouseCoord.squaredTo(t);
        if (ds2 < ds2Min){
//            ds2Min=ds2;
            pImpData->snapSpot = t;
        }
    }
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
    }
    return coord;
}

double RS_Snapper::getSnapRange() const{
    // issue #1631: redefine this method to the minimum graph distance to allow "Snap Free"
    // When the closest of any other snapping point is beyond this distance, free snapping is used.
    constexpr double Min_Snap_Factor = 0.25;
    std::vector<double> distances(3, RS_MAXDOUBLE);
    double& minGui=distances[0];
    double& minGrid=distances[1];
    double& minSize=distances[2];
    if (graphicView != nullptr) {
        minGui = graphicView->toGraphDX(32);
        // if grid is on, less than one quarter of the cell vector
        if (graphicView->isGridOn()) {
            RS_Grid *grid = graphicView->getGrid();
            const RS_Vector &cellVector = grid->getCellVector();
            minGrid = cellVector.magnitude() * Min_Snap_Factor;
        }
    }
    if (container != nullptr && isSizeValid(container->getSize())) {
        // The size bounding box







|







|







439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
    }
    return coord;
}

double RS_Snapper::getSnapRange() const{
    // issue #1631: redefine this method to the minimum graph distance to allow "Snap Free"
    // When the closest of any other snapping point is beyond this distance, free snapping is used.
    constexpr double Min_Snap_Factor = 0.4; //0.25;
    std::vector<double> distances(3, RS_MAXDOUBLE);
    double& minGui=distances[0];
    double& minGrid=distances[1];
    double& minSize=distances[2];
    if (graphicView != nullptr) {
        minGui = graphicView->toGraphDX(32);
        // if grid is on, less than one quarter of the cell vector
        if (graphicView->isGridOn() && snapMode.snapGrid) {
            RS_Grid *grid = graphicView->getGrid();
            const RS_Vector &cellVector = grid->getCellVector();
            minGrid = cellVector.magnitude() * Min_Snap_Factor;
        }
    }
    if (container != nullptr && isSizeValid(container->getSize())) {
        // The size bounding box

Changes to librecad/src/lib/actions/rs_snapper.h.

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    bool snapEndpoint       {false}; //< Whether to snap to endpoints or not.
    bool snapGrid           {false}; //< Whether to snap to grid or not.
    bool snapFree           {false}; //< Whether to snap freely
    bool snapAngle          {false}; //< Whether to snap along line under certain angle

    RS2::SnapRestriction restriction {RS2::RestrictNothing}; /// The restriction on the free snap.

    double distance {5.0}; //< The distance to snap before defaulting to free snapping.

    /**
      * Disable all snapping.
      *
      * This effectively puts the object into free snap mode.
      *
      * @returns A reference to itself.







|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    bool snapEndpoint       {false}; //< Whether to snap to endpoints or not.
    bool snapGrid           {false}; //< Whether to snap to grid or not.
    bool snapFree           {false}; //< Whether to snap freely
    bool snapAngle          {false}; //< Whether to snap along line under certain angle

    RS2::SnapRestriction restriction {RS2::RestrictNothing}; /// The restriction on the free snap.

    double distance {32.0}; //< The distance to snap before defaulting to free snapping.

    /**
      * Disable all snapping.
      *
      * This effectively puts the object into free snap mode.
      *
      * @returns A reference to itself.

Changes to librecad/src/lib/debug/rs_debug.cpp.

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
**
**********************************************************************/

#include <climits>
#include <cstdarg>
#include <cstdio>
#include <iostream>
#include <string_view>

#include <QDateTime>
#include <QString>
#include <QTextStream>

#include "rs_debug.h"








<







24
25
26
27
28
29
30

31
32
33
34
35
36
37
**
**********************************************************************/

#include <climits>
#include <cstdarg>
#include <cstdio>
#include <iostream>


#include <QDateTime>
#include <QString>
#include <QTextStream>

#include "rs_debug.h"

214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/**
 * Sets the debugging level.
 */
void RS_Debug::setLevel(RS_DebugLevel level) {
    if (debugLevel == level)
        return;
    debugLevel = level;
    print(D_NOTHING, "RS_DEBUG::setLevel(%d)", level);
    print(D_CRITICAL, "RS_DEBUG: Critical");
    print(D_ERROR, "RS_DEBUG: Errors");
    print(D_WARNING, "RS_DEBUG: Warnings");
    print(D_NOTICE, "RS_DEBUG: Notice");
    print(D_INFORMATIONAL, "RS_DEBUG: Informational");
    print(D_DEBUGGING, "RS_DEBUG: Debugging");
}







|







213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
/**
 * Sets the debugging level.
 */
void RS_Debug::setLevel(RS_DebugLevel level) {
    if (debugLevel == level)
        return;
    debugLevel = level;
    print(D_INFORMATIONAL, "RS_DEBUG::setLevel(%d)", level);
    print(D_CRITICAL, "RS_DEBUG: Critical");
    print(D_ERROR, "RS_DEBUG: Errors");
    print(D_WARNING, "RS_DEBUG: Warnings");
    print(D_NOTICE, "RS_DEBUG: Notice");
    print(D_INFORMATIONAL, "RS_DEBUG: Informational");
    print(D_DEBUGGING, "RS_DEBUG: Debugging");
}

Changes to librecad/src/lib/engine/document/container/rs_entitycontainer.cpp.

185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
    // point to new deep copies:
    for (auto e: tmp) {
        entities.append(e);
        e->reparent(this);
    }
}

void RS_EntityContainer::reparent(RS_EntityContainer *parent) {
    RS_Entity::reparent(parent);

    // All sub-entities:

    for (auto e: std::as_const(entities)) {
        e->reparent(parent);
    }
}

void RS_EntityContainer::setVisible(bool v) {
    //    RS_DEBUG->print("RS_EntityContainer::setVisible: %d", v);
    RS_Entity::setVisible(v);

    // All sub-entities:








<
<
<
<
<
<
<
<
<







185
186
187
188
189
190
191









192
193
194
195
196
197
198
    // point to new deep copies:
    for (auto e: tmp) {
        entities.append(e);
        e->reparent(this);
    }
}











void RS_EntityContainer::setVisible(bool v) {
    //    RS_DEBUG->print("RS_EntityContainer::setVisible: %d", v);
    RS_Entity::setVisible(v);

    // All sub-entities:

433
434
435
436
437
438
439

440

441
442


443
444
445
446
447
448
449
                   return;
               }
           }
       }
    */

    if (!entity) return;



    if (entity->rtti() == RS2::EntityImage ||
        entity->rtti() == RS2::EntityHatch) {


        entities.prepend(entity);
    } else {
        entities.append(entity);
    }
    if (autoUpdateBorders) {
        adjustBorders(entity);
    }







>

>

|
>
>







424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
                   return;
               }
           }
       }
    */

    if (!entity) return;
    RS_Layer* layer = entity->getLayer(true);


    if (entity->rtti() == RS2::EntityImage ||
        entity->rtti() == RS2::EntityHatch ||
        (layer != nullptr && layer->isConstruction())
    ) {
        entities.prepend(entity);
    } else {
        entities.append(entity);
    }
    if (autoUpdateBorders) {
        adjustBorders(entity);
    }

Changes to librecad/src/lib/engine/document/container/rs_entitycontainer.h.

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
    virtual void detach();

    /** @return RS2::EntityContainer */
    RS2::EntityType rtti() const override{
        return RS2::EntityContainer;
    }

    void reparent(RS_EntityContainer* parent) override;

    /**
     * @return true: because entities made from this class
	 *         and subclasses are containers for other entities.
     */
    bool isContainer() const override{
        return true;
    }







<
<







63
64
65
66
67
68
69


70
71
72
73
74
75
76
    virtual void detach();

    /** @return RS2::EntityContainer */
    RS2::EntityType rtti() const override{
        return RS2::EntityContainer;
    }



    /**
     * @return true: because entities made from this class
	 *         and subclasses are containers for other entities.
     */
    bool isContainer() const override{
        return true;
    }

Changes to librecad/src/lib/engine/document/entities/lc_dimarc.cpp.

21
22
23
24
25
26
27

28
29
30
31
32
33

34
35
36
37
38
39
40
** This copyright notice MUST APPEAR in all copies of the script!
**
**********************************************************************/


#include <cmath>
#include <iostream>


#include "lc_dimarc.h"
#include "rs_arc.h"
#include "rs_debug.h"
#include "rs_graphic.h"
#include "rs_line.h"

#include "rs_mtext.h"
#include "rs_solid.h"
#include "rs_units.h"


LC_DimArcData::LC_DimArcData(const LC_DimArcData &input_dimArcData)
    :







>






>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
** This copyright notice MUST APPEAR in all copies of the script!
**
**********************************************************************/


#include <cmath>
#include <iostream>
#include <libintl.h>

#include "lc_dimarc.h"
#include "rs_arc.h"
#include "rs_debug.h"
#include "rs_graphic.h"
#include "rs_line.h"
#include "rs_math.h"
#include "rs_mtext.h"
#include "rs_solid.h"
#include "rs_units.h"


LC_DimArcData::LC_DimArcData(const LC_DimArcData &input_dimArcData)
    :
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247

    extLine1->setLayer (nullptr);
    extLine2->setLayer (nullptr);

    addEntity (extLine1);
    addEntity (extLine2);

    RS_Arc* refArc
    {
        new RS_Arc( this, 
                    RS_ArcData( dimArcData.centre, 
                                dimArcData.radius, 
                                dimArcData.startAngle.angle(), 
                                dimArcData.endAngle.angle(), 
                                false) 
                  ) 
    };

    arrow (arrowStartPoint, dimArcData.startAngle.angle(), +1.0, pen);
    arrow (arrowEndPoint,   dimArcData.endAngle.angle(),   -1.0, pen);

    double textAngle  { 0.0 };

    RS_Vector textPos { refArc->getMiddlePoint() };

    const double textAngle_preliminary { std::trunc((textPos.angleTo(dimArcData.centre) - M_PI) * 1.0E+10) * 1.0E-10 };

    if ( ! this->getInsideHorizontalText())
    {
        RS_Vector textPosOffset;

        const double deg360 { M_PI * 2.0 };

        const double degTolerance { 1.0E-3 };

        /* With regards to Quadrants #1 and #2 */
        if (((textAngle_preliminary >= -degTolerance) && (textAngle_preliminary <= (M_PI + degTolerance))) 
        ||  ((textAngle_preliminary <= -(M_PI - degTolerance)) && (textAngle_preliminary >= -(deg360 + degTolerance))))
        {
            textPosOffset.setPolar (getDimensionLineGap() * getGeneralScale(), textAngle_preliminary);
            textAngle = textAngle_preliminary + M_PI + M_PI_2;
        }
        /* With regards to Quadrants #3 and #4 */
        else
        {
            textPosOffset.setPolar (getDimensionLineGap() * getGeneralScale(), textAngle_preliminary + M_PI);
            textAngle = textAngle_preliminary + M_PI_2;
        }
    }

    QString dimLabel { getLabel() };

    bool ok = false;

    const double dummyVar = dimLabel.toDouble(&ok);

    if (dummyVar) { /* This is a dummy code, to suppress the unused variable compiler warning. */ }

    if (ok)
        dimLabel.prepend("∩ ");

    RS_MTextData textData
    {
        RS_MTextData( textPos, 
                      getTextHeight() * getGeneralScale(),
                      30.0, 
                      RS_MTextData::VABottom, 
                      RS_MTextData::HACenter, 







<
<
<
<
<
<
<
<
<
<
<





|
<
<



<
|
<

<
<

|
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<







182
183
184
185
186
187
188











189
190
191
192
193
194


195
196
197

198

199


200
201











202
203
204
205









206
207
208
209
210
211
212

    extLine1->setLayer (nullptr);
    extLine2->setLayer (nullptr);

    addEntity (extLine1);
    addEntity (extLine2);












    arrow (arrowStartPoint, dimArcData.startAngle.angle(), +1.0, pen);
    arrow (arrowEndPoint,   dimArcData.endAngle.angle(),   -1.0, pen);

    double textAngle  { 0.0 };

    RS_Vector textPos { dimArc->getMiddlePoint() };



    if ( ! this->getInsideHorizontalText())
    {

        textAngle = RS_Math::correctAngle(textPos.angleTo(dimArcData.centre) - M_PI_2);




        /* With regards to Quadrants #1 and #2 */
        if ( (textAngle > M_PI_2) && (textAngle < M_PI+M_PI_2) ) textAngle = RS_Math::correctAngle(textAngle+M_PI);











    }

    QString dimLabel { getLabel() };










    RS_MTextData textData
    {
        RS_MTextData( textPos, 
                      getTextHeight() * getGeneralScale(),
                      30.0, 
                      RS_MTextData::VABottom, 
                      RS_MTextData::HACenter, 
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355

    auto* text { new RS_MText (this, textData) };

    text->setPen (RS_Pen (getTextColor(), RS2::WidthByBlock, RS2::SolidLine));
    text->setLayer (nullptr);
    addEntity (text);

    double halfWidth_plusGap  = (text->getUsedTextWidth() / 2.0) + getDimensionLineGap() * getGeneralScale();
    double halfHeight_plusGap = (getTextHeight()          / 2.0) + getDimensionLineGap() * getGeneralScale();

    text->move(-RS_Vector::polar(getTextHeight() / 2.0, textAngle + M_PI_2));

    /* Text rectangle's corners : top left, top right, bottom right, bottom left. */
    RS_Vector textRectCorners [4] = 
    {
        RS_Vector(false), 
        RS_Vector(textPos + RS_Vector(+halfWidth_plusGap, +halfHeight_plusGap)), 
        RS_Vector(false), 
        RS_Vector(textPos + RS_Vector(-halfWidth_plusGap, -halfHeight_plusGap))
    };

    RS_Vector cornerTopRight   { textRectCorners [1] };
    RS_Vector cornerBottomLeft { textRectCorners [3] };

    textRectCorners [0] = RS_Vector(cornerBottomLeft.x, cornerTopRight.y);
    textRectCorners [2] = RS_Vector(cornerTopRight.x,   cornerBottomLeft.y);

    for (int i = 0; i < 4; i++)
    {
        textRectCorners[i].rotate(textPos, text->getAngle());
        textRectCorners[i].x = std::trunc(textRectCorners[i].x * 1.0E+4) * 1.0E-4;
        textRectCorners[i].y = std::trunc(textRectCorners[i].y * 1.0E+4) * 1.0E-4;
    }

    if (RS_DEBUG->getLevel() == RS_Debug::D_INFORMATIONAL)
    {
        std::cout << std::endl 
                  << " LC_DimArc::updateDim: Text position / angle : " << textPos << " / " << text->getAngle() 
                  << std::endl;

        std::cout << std::endl 
                  << " LC_DimArc::updateDim: Reference arc middle point : " << refArc->getMiddlePoint() 
                  << std::endl;

        std::cout << std::endl 
                  << " LC_DimArc::updateDim: DimArc-1 start point : " << dimArc1->getStartpoint() 
                  << std::endl;

        std::cout << std::endl 
                  << " LC_DimArc::updateDim: DimArc-2 start point : " << dimArc2->getStartpoint() 
                  << std::endl;

        std::cout << std::endl 
                  << " LC_DimArc::updateDim: Text rectangle corners : " << textRectCorners [0] << ", " 
                                                                        << textRectCorners [1] << ", " 
                                                                        << textRectCorners [2] << ", " 
                                                                        << textRectCorners [3] 
                  << std::endl;
    }

    const auto [cornerLeftX, cornerRightX] = std::minmax(
        { textRectCorners[0].x, textRectCorners[1].x, textRectCorners[2].x, textRectCorners[3].x});

    const auto [cornerBottomY, cornerTopY] = std::minmax(
        { textRectCorners[0].y, textRectCorners[1].y, textRectCorners[2].y, textRectCorners[3].y});

    constexpr double deltaOffset { 1.0E-2 };

    while (((dimArc1->getEndpoint().x < cornerLeftX)   || (dimArc1->getEndpoint().x > cornerRightX) 
    ||      (dimArc1->getEndpoint().y < cornerBottomY) || (dimArc1->getEndpoint().y > cornerTopY))

    &&     (dimArc1->getAngle2() < RS_MAXDOUBLE) 
    &&     (dimArc1->getAngle2() > RS_MINDOUBLE))
    {
        dimArc1->setAngle2(dimArc1->getAngle2() + deltaOffset);
    }

    while (((dimArc2->getStartpoint().x < cornerLeftX)   || (dimArc2->getStartpoint().x > cornerRightX) 
    ||      (dimArc2->getStartpoint().y < cornerBottomY) || (dimArc2->getStartpoint().y > cornerTopY)) 

    &&     (dimArc2->getAngle1() < RS_MAXDOUBLE) 
    &&     (dimArc2->getAngle1() > RS_MINDOUBLE))
    {
        dimArc2->setAngle1(dimArc2->getAngle1() - deltaOffset);
    }

    dimArc1->setPen (pen);
    dimArc2->setPen (pen);

    dimArc1->setLayer (nullptr);
    dimArc2->setLayer (nullptr);

    addEntity (dimArc1);
    addEntity (dimArc2);

    calculateBorders();
}


void LC_DimArc::update()
{







|
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
|
<
<
|
<







220
221
222
223
224
225
226
227

228












































































229


230


231

232
233
234
235
236
237
238

    auto* text { new RS_MText (this, textData) };

    text->setPen (RS_Pen (getTextColor(), RS2::WidthByBlock, RS2::SolidLine));
    text->setLayer (nullptr);
    addEntity (text);

    text->move(RS_Vector::polar(getDimensionLineGap() * getGeneralScale(), textAngle + M_PI_2));














































































    dimArc->setPen (pen);


    dimArc->setLayer (nullptr);


    addEntity (dimArc);


    calculateBorders();
}


void LC_DimArc::update()
{
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467


void LC_DimArc::calcDimension()
{
    const double endAngle   = dimArcData.endAngle.angle();
    const double startAngle = dimArcData.startAngle.angle();

    dimArc1 = new RS_Arc (this, RS_ArcData(dimArcData.centre, dimArcData.radius, startAngle, startAngle, false));
    dimArc2 = new RS_Arc (this, RS_ArcData(dimArcData.centre, dimArcData.radius, endAngle,   endAngle, false));

    RS_Vector entityStartPoint = truncateVector(data.definitionPoint);

    const double entityRadius  = dimArcData.centre.distanceTo(entityStartPoint);

    RS_Vector entityEndPoint   = truncateVector(dimArcData.centre 
                               + RS_Vector(dimArcData.endAngle).scale(entityRadius));







|
<







335
336
337
338
339
340
341
342

343
344
345
346
347
348
349


void LC_DimArc::calcDimension()
{
    const double endAngle   = dimArcData.endAngle.angle();
    const double startAngle = dimArcData.startAngle.angle();

    dimArc = new RS_Arc (this, RS_ArcData(dimArcData.centre, dimArcData.radius, startAngle, endAngle, false));


    RS_Vector entityStartPoint = truncateVector(data.definitionPoint);

    const double entityRadius  = dimArcData.centre.distanceTo(entityStartPoint);

    RS_Vector entityEndPoint   = truncateVector(dimArcData.centre 
                               + RS_Vector(dimArcData.endAngle).scale(entityRadius));

Changes to librecad/src/lib/engine/document/entities/lc_dimarc.h.

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
        RS_Vector arrowEndPoint;

        RS_Vector dimStartPoint;
        RS_Vector dimEndPoint;

        RS_Line* extLine1 = nullptr;
        RS_Line* extLine2 = nullptr;
        RS_Arc*  dimArc1 = nullptr;
        RS_Arc*  dimArc2 = nullptr;

        void calcDimension();

        RS_Vector truncateVector(const RS_Vector input_vector);

        void arrow( const RS_Vector& point, 
                    const double angle, 







|
<







128
129
130
131
132
133
134
135

136
137
138
139
140
141
142
        RS_Vector arrowEndPoint;

        RS_Vector dimStartPoint;
        RS_Vector dimEndPoint;

        RS_Line* extLine1 = nullptr;
        RS_Line* extLine2 = nullptr;
        RS_Arc*  dimArc = nullptr;


        void calcDimension();

        RS_Vector truncateVector(const RS_Vector input_vector);

        void arrow( const RS_Vector& point, 
                    const double angle, 

Changes to librecad/src/lib/engine/document/entities/rs_arc.cpp.

296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
RS_Vector RS_Arc::getStartpoint() const{
    return startPoint;    
}

/** @return End point of the entity. */
RS_Vector RS_Arc::getEndpoint() const{
    return endPoint;
    return data.center + RS_Vector::polar(data.radius, data.angle2);
}

RS_VectorSolutions RS_Arc::getRefPoints() const{
	//order: start, end, center
    //order: start, center, middle, end
    return {{getStartpoint(),  data.center, middlePoint, getEndpoint()}};
}







|







296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
RS_Vector RS_Arc::getStartpoint() const{
    return startPoint;    
}

/** @return End point of the entity. */
RS_Vector RS_Arc::getEndpoint() const{
    return endPoint;
    return data.center + RS_Vector::polar(data.radius, data.angle2);         // ??????????????
}

RS_VectorSolutions RS_Arc::getRefPoints() const{
	//order: start, end, center
    //order: start, center, middle, end
    return {{getStartpoint(),  data.center, middlePoint, getEndpoint()}};
}

Changes to librecad/src/lib/engine/document/entities/rs_dimangular.cpp.

28
29
30
31
32
33
34

35
36
37
38
39
40
41
#include<cmath>
#include<iostream>

#include "rs_arc.h"
#include "rs_constructionline.h"
#include "rs_debug.h"
#include "rs_dimangular.h"

#include "rs_information.h"
#include "rs_line.h"
#include "rs_math.h"
#include "rs_mtext.h"
#include "rs_solid.h"
#include "rs_units.h"








>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include<cmath>
#include<iostream>

#include "rs_arc.h"
#include "rs_constructionline.h"
#include "rs_debug.h"
#include "rs_dimangular.h"
#include "rs_dimension.h"
#include "rs_information.h"
#include "rs_line.h"
#include "rs_math.h"
#include "rs_mtext.h"
#include "rs_solid.h"
#include "rs_units.h"

378
379
380
381
382
383
384




385
386
387
388
389
390
391
                             textAngle);

    RS_MText* text {new RS_MText( this, textData)};

    // move text to the side:
    text->setPen( RS_Pen( getTextColor(), RS2::WidthByBlock, RS2::SolidLine));
    text->setLayer( nullptr);




    addEntity( text);

    calculateBorders();
}

void RS_DimAngular::update()
{







>
>
>
>







379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
                             textAngle);

    RS_MText* text {new RS_MText( this, textData)};

    // move text to the side:
    text->setPen( RS_Pen( getTextColor(), RS2::WidthByBlock, RS2::SolidLine));
    text->setLayer( nullptr);

    auto* bg = createBackground(text);

    addEntity(bg);
    addEntity( text);

    calculateBorders();
}

void RS_DimAngular::update()
{

Changes to librecad/src/lib/engine/document/entities/rs_dimension.cpp.

21
22
23
24
25
26
27


28
29
30
31
32
33



34
35


36
37
38
39
40
41
42
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
**
** This copyright notice MUST APPEAR in all copies of the script!
**
**********************************************************************/
#include<iostream>



#include "rs_debug.h"
#include "rs_dimension.h"
#include "rs_filterdxfrw.h" //for int <-> rs_color conversion
#include "rs_information.h"
#include "rs_line.h"
#include "rs_math.h"



#include "rs_solid.h"
#include "rs_units.h"



RS_DimensionData::RS_DimensionData():
    definitionPoint(false),
    middleOfText(false),
    valign(RS_MTextData::VABottom),
    halign(RS_MTextData::HALeft),
    lineSpacingStyle(RS_MTextData::Exact),







>
>






>
>
>


>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
**
** This copyright notice MUST APPEAR in all copies of the script!
**
**********************************************************************/
#include<iostream>

#include "rs_block.h"
#include "rs_color.h"
#include "rs_debug.h"
#include "rs_dimension.h"
#include "rs_filterdxfrw.h" //for int <-> rs_color conversion
#include "rs_information.h"
#include "rs_line.h"
#include "rs_math.h"
#include "rs_modification.h"
#include "rs_mtext.h"
#include "rs_polyline.h"
#include "rs_solid.h"
#include "rs_units.h"
#include "rs_vector.h"
#include "rs_graphicview.h"

RS_DimensionData::RS_DimensionData():
    definitionPoint(false),
    middleOfText(false),
    valign(RS_MTextData::VABottom),
    halign(RS_MTextData::HALeft),
    lineSpacingStyle(RS_MTextData::Exact),
160
161
162
163
164
165
166























































167
168
169
170
171
172
173

/**
 * Sets a new text for the label.
 */
void RS_Dimension::setLabel(const QString& l) {
        data.text = l;
}
























































/**
 * Find intersections between a line and an EntityContainer.  Solutions are
 * sorted along the line before returning.
 *
 * @param infiniteLine Treat the line as infinitely long in both directions.
 */







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235

/**
 * Sets a new text for the label.
 */
void RS_Dimension::setLabel(const QString& l) {
        data.text = l;
}


RS_Hatch* RS_Dimension::createBackground(RS_MText* text) {

    text->update();
    double w = text->getUsedTextWidth()/2;
    double h = text->getUsedTextHeight()/2;

    auto* rect = new RS_Polyline();
    double b = -0.414213562373; // tan(90°/4)

    rect->addVertex(RS_Vector(-w, -2*h),   b);
    rect->addVertex(RS_Vector(-w-h, -h), 0.0);
    rect->addVertex(RS_Vector(-w-h, h),    b);
    rect->addVertex(RS_Vector(-w, 2*h),  0.0);
    rect->addVertex(RS_Vector(w, 2*h),     b);
    rect->addVertex(RS_Vector(w+h, h),   0.0);
    rect->addVertex(RS_Vector(w+h, -h),    b);
    rect->addVertex(RS_Vector(w, -2*h),  0.0);
    rect->setClosed(true, b);

    double ofsx = 0.0;
    double ofsy = 0.0;

    switch (text->getHAlign()) {
        case RS_MTextData::HALeft : ofsx = w; break;
        case RS_MTextData::HARight : ofsx = -w; break;
        default:;
    }

    switch (text->getVAlign()) {
        case RS_MTextData::VABottom : ofsy = h; break;
        case RS_MTextData::VATop : ofsy = -h; break;
        default:;
    }

    rect->move(RS_Vector(ofsx, ofsy, 0.0));
    rect->rotate(RS_Vector(0,0,0), text->getAngle());
    rect->move(text->getInsertionPoint());

    auto* bg = new RS_Hatch(this, RS_HatchData(true, 1.0, 0.0, nullptr));
    bg->addEntity(rect);
    bg->update();

    RS_Document* doc = getDocument();
    RS_Block* block = getBlock();
    RS_GraphicView* view = (doc) ? doc->getGraphicView() : (block) ? block->getGraphicView() : nullptr;
    RS_Color clr = (view) ? view->getBackground() : RS_Color(255, 255, 255, 254);

    bg->setPen(RS_Pen(clr, RS2::WidthByBlock, RS2::SolidLine));
    bg->setLayer(nullptr);

    return bg;
}


/**
 * Find intersections between a line and an EntityContainer.  Solutions are
 * sorted along the line before returning.
 *
 * @param infiniteLine Treat the line as infinitely long in both directions.
 */
282
283
284
285
286
287
288


289
290
291
292
293
294
295
                            getLabel(),
                            getTextStyle(),
                            textAngle);

    auto* text = new RS_MText(this, textData);
    text->setPen(RS_Pen(getTextColor(), RS2::WidthByBlock, RS2::SolidLine));
    text->setLayer(nullptr);



    // evaluate intersection between dim line and text
    double textIntersectionLength = 0.0;
    double w = text->getUsedTextWidth()/2+dimgap;
    double h = text->getUsedTextHeight()/2+dimgap;
    // textCorner variables correspond to the corners of the text bounding box
    // if the text were to be positioned in the center of the dimensionLine.







>
>







344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
                            getLabel(),
                            getTextStyle(),
                            textAngle);

    auto* text = new RS_MText(this, textData);
    text->setPen(RS_Pen(getTextColor(), RS2::WidthByBlock, RS2::SolidLine));
    text->setLayer(nullptr);

    RS_Hatch* bg = createBackground(text);

    // evaluate intersection between dim line and text
    double textIntersectionLength = 0.0;
    double w = text->getUsedTextWidth()/2+dimgap;
    double h = text->getUsedTextHeight()/2+dimgap;
    // textCorner variables correspond to the corners of the text bounding box
    // if the text were to be positioned in the center of the dimensionLine.
320
321
322
323
324
325
326

327
328
329
330
331
332
333
        dimensionLineOutside2 = new RS_Line{this, p2 + dir, p2};

        // move text to the side if it won't fit either
        RS_Vector distH;
        if (textIntersectionLength>distance && autoText) {
            distH.setPolar(textIntersectionLength/2.0+arrowSize*2+distance/2.0,
                           arrowAngle1);

            text->move(distH);
            textPos = text->getInsertionPoint();
            data.middleOfText = textPos;
        }
    }
    double dimtsz=getTickSize()*dimscale;
    bool displayArrows = dimtsz < 0.01;







>







384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
        dimensionLineOutside2 = new RS_Line{this, p2 + dir, p2};

        // move text to the side if it won't fit either
        RS_Vector distH;
        if (textIntersectionLength>distance && autoText) {
            distH.setPolar(textIntersectionLength/2.0+arrowSize*2+distance/2.0,
                           arrowAngle1);
            bg->move(distH);
            text->move(distH);
            textPos = text->getInsertionPoint();
            data.middleOfText = textPos;
        }
    }
    double dimtsz=getTickSize()*dimscale;
    bool displayArrows = dimtsz < 0.01;
433
434
435
436
437
438
439

440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459


460
461
462
463
464
465
466
    } else if (splitDimensionLine && dimensionLineInside1) {
        addEntity(dimensionLineInside1);
        addEntity(dimensionLineInside2);
    } else {
        addEntity(dimensionLine);
    }


    addEntity(text);
}

/**
 * Creates an aligned-text dimensioning line (line with one, two or no arrows
 * and aligned text).
 *
 * @param forceAutoText Automatically reposition the text label.
 */
void RS_Dimension::updateCreateAlignedTextDimensionLine(const RS_Vector& p1,
        const RS_Vector& p2, bool arrow1, bool arrow2, bool forceAutoText) {
    // general scale (DIMSCALE)
    double dimscale = getGeneralScale();
    // text height (DIMTXT)
    double dimtxt = getTextHeight()*dimscale;
    // text distance to line (DIMGAP)
    double dimgap = getDimensionLineGap()*dimscale;

    // length of dimension line:
    double distance = p1.distanceTo(p2);


    // arrow size:
    double arrowSize = getArrowSize()*dimscale;

    // do we have to put the arrows outside of the line?
    bool outsideArrows = (distance<arrowSize*2.5);

    // arrow angles:







>




















>
>







498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
    } else if (splitDimensionLine && dimensionLineInside1) {
        addEntity(dimensionLineInside1);
        addEntity(dimensionLineInside2);
    } else {
        addEntity(dimensionLine);
    }

    addEntity(bg);
    addEntity(text);
}

/**
 * Creates an aligned-text dimensioning line (line with one, two or no arrows
 * and aligned text).
 *
 * @param forceAutoText Automatically reposition the text label.
 */
void RS_Dimension::updateCreateAlignedTextDimensionLine(const RS_Vector& p1,
        const RS_Vector& p2, bool arrow1, bool arrow2, bool forceAutoText) {
    // general scale (DIMSCALE)
    double dimscale = getGeneralScale();
    // text height (DIMTXT)
    double dimtxt = getTextHeight()*dimscale;
    // text distance to line (DIMGAP)
    double dimgap = getDimensionLineGap()*dimscale;

    // length of dimension line:
    double distance = p1.distanceTo(p2);
    double direction = (cos(p1.angleTo(p2)) >= 0.0) ? 1.0 : -1.0;

    // arrow size:
    double arrowSize = getArrowSize()*dimscale;

    // do we have to put the arrows outside of the line?
    bool outsideArrows = (distance<arrowSize*2.5);

    // arrow angles:
494
495
496
497
498
499
500
501

502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518


519



520
521
522

523

524

525

526



527
528
529
530
531
532
533
534
535
536
537

538




539
540



541
542
543
544
545
546
547
        RS_Vector distV = RS_Vector::polar(dimgap + dimtxt/2.0, dimAngle1+a);

        // move text away from dimension line:
        textPos+=distV;

        //// the next update should still be able to adjust this
        ////   auto text position. leave it invalid
        data.middleOfText = textPos;

    }

    textData = RS_MTextData(textPos,
                            dimtxt, 30.0,
                            RS_MTextData::VAMiddle,
                            RS_MTextData::HACenter,
                            RS_MTextData::LeftToRight,
                            RS_MTextData::Exact,
                            1.0,
                            getLabel(),
                            getTextStyle(),
                            textAngle);

    auto text = new RS_MText(this, textData);
    text->setPen(RS_Pen(getTextColor(), RS2::WidthByBlock, RS2::SolidLine));
    text->setLayer(nullptr);



    // move text to the side:



    RS_Vector distH;
    if (text->getUsedTextWidth()>distance) {
        distH.setPolar(text->getUsedTextWidth()/2.0

                       +distance/2.0+dimgap, textAngle);

        text->move(distH);

    }





    addEntity(text);

    // add arrows
    if (outsideArrows==false) {
        arrowAngle1 = dimensionLine->getAngle2();
        arrowAngle2 = dimensionLine->getAngle1();
    } else {
        arrowAngle1 = dimensionLine->getAngle1();
        arrowAngle2 = dimensionLine->getAngle2();

        // extend dimension line outside arrows

        RS_Vector dir = RS_Vector::polar(arrowSize*2, arrowAngle2);




        dimensionLine->setStartpoint(p1 + dir);
        dimensionLine->setEndpoint(p2 - dir);



    }
    double dimtsz=getTickSize()*dimscale;
    if(dimtsz < 0.01) {
        //display arrow
        // Arrows:
        RS_SolidData sd;
        RS_Solid* arrow;







|
>

















>
>

>
>
>
|
<
|
>
|
>
|
>
|
>
|
>
>
>



|
<
<
<




>
|
>
>
>
>
|
|
>
>
>







562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594

595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610



611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
        RS_Vector distV = RS_Vector::polar(dimgap + dimtxt/2.0, dimAngle1+a);

        // move text away from dimension line:
        textPos+=distV;

        //// the next update should still be able to adjust this
        ////   auto text position. leave it invalid
 //       data.middleOfText = textPos;
 //       std::cout<<"Middle of text 1: "<<data.middleOfText<<std::endl;
    }

    textData = RS_MTextData(textPos,
                            dimtxt, 30.0,
                            RS_MTextData::VAMiddle,
                            RS_MTextData::HACenter,
                            RS_MTextData::LeftToRight,
                            RS_MTextData::Exact,
                            1.0,
                            getLabel(),
                            getTextStyle(),
                            textAngle);

    auto text = new RS_MText(this, textData);
    text->setPen(RS_Pen(getTextColor(), RS2::WidthByBlock, RS2::SolidLine));
    text->setLayer(nullptr);

    RS_Hatch* bg = createBackground(text);

    // move text to the side:
    bool outsideText = (text->getUsedTextWidth() > distance);

    if (outsideText) {
        RS_Vector distH;

        distH.setPolar(text->getUsedTextWidth()/2.0 + distance/2.0 + dimgap, textAngle);
        distH *= direction;

        if (!data.middleOfText.valid || forceAutoText) {
          text->move(distH);
          bg->move(distH);
        }
        outsideArrows = true;
    }

    data.middleOfText = text->getInsertionPoint();
    addEntity(bg);
    addEntity(text);

    // add arrows
    if (outsideArrows) {



        arrowAngle1 = dimensionLine->getAngle1();
        arrowAngle2 = dimensionLine->getAngle2();

        // extend dimension line outside arrows
        RS_Vector dir1 = RS_Vector::polar(arrowSize*2, arrowAngle1);
        RS_Vector dir2 = RS_Vector::polar(arrowSize*2, arrowAngle2);
        if (outsideText) {
          dir1 = RS_Vector::polar(std::min(arrowSize*2, text->getUsedTextWidth() + 2.0*dimgap), arrowAngle1);
          dir2 = RS_Vector::polar(text->getUsedTextWidth() + 2.0*dimgap, arrowAngle2);
        }
        dimensionLine->setStartpoint(p1 - dir1);
        dimensionLine->setEndpoint(p2 - dir2);
    } else {
        arrowAngle1 = dimensionLine->getAngle2();
        arrowAngle2 = dimensionLine->getAngle1();
    }
    double dimtsz=getTickSize()*dimscale;
    if(dimtsz < 0.01) {
        //display arrow
        // Arrows:
        RS_SolidData sd;
        RS_Solid* arrow;

Changes to librecad/src/lib/engine/document/entities/rs_dimension.h.

25
26
27
28
29
30
31

32
33
34
35
36
37
38
**********************************************************************/


#ifndef RS_DIMENSION_H
#define RS_DIMENSION_H

#include "rs_entitycontainer.h"

#include "rs_mtext.h"

/**
 * Holds the data that is common to all dimension entities.
 */
struct RS_DimensionData : public RS_Flags {
    /**







>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
**********************************************************************/


#ifndef RS_DIMENSION_H
#define RS_DIMENSION_H

#include "rs_entitycontainer.h"
#include "rs_hatch.h"
#include "rs_mtext.h"

/**
 * Holds the data that is common to all dimension entities.
 */
struct RS_DimensionData : public RS_Flags {
    /**
176
177
178
179
180
181
182

183
184
185
        bool arrow1=true, bool arrow2=true, bool autoText=false);
    void updateCreateAlignedTextDimensionLine(
        const RS_Vector& p1, const RS_Vector& p2,
        bool arrow1=true, bool arrow2=true, bool autoText=false);
protected:
    /** Data common to all dimension entities. */
    RS_DimensionData data;

};

#endif







>



177
178
179
180
181
182
183
184
185
186
187
        bool arrow1=true, bool arrow2=true, bool autoText=false);
    void updateCreateAlignedTextDimensionLine(
        const RS_Vector& p1, const RS_Vector& p2,
        bool arrow1=true, bool arrow2=true, bool autoText=false);
protected:
    /** Data common to all dimension entities. */
    RS_DimensionData data;
    RS_Hatch* createBackground(RS_MText* text);
};

#endif

Changes to librecad/src/lib/engine/document/entities/rs_entity.cpp.

27
28
29
30
31
32
33



34
35
36
37
38
39
40
41
42
43

44
45
46
47
48
49
50


#include <iostream>
#include <utility>
#include <QPolygon>
#include <QString>




#include "rs_arc.h"
#include "rs_block.h"
#include "rs_circle.h"
#include "rs_ellipse.h"
#include "rs_entity.h"
#include "rs_graphic.h"
#include "rs_graphicview.h"
#include "rs_information.h"
#include "rs_insert.h"
#include "rs_layer.h"

#include "rs_line.h"
#include "rs_mtext.h"
#include "rs_point.h"
#include "rs_polyline.h"
#include "rs_text.h"
#include "rs_units.h"
#include "rs_vector.h"







>
>
>










>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54


#include <iostream>
#include <utility>
#include <QPolygon>
#include <QString>

#include "lc_layertreeitem.h"
#include "lc_layertreemodel.h"
#include "lc_layertreemodel_options.h"
#include "rs_arc.h"
#include "rs_block.h"
#include "rs_circle.h"
#include "rs_ellipse.h"
#include "rs_entity.h"
#include "rs_graphic.h"
#include "rs_graphicview.h"
#include "rs_information.h"
#include "rs_insert.h"
#include "rs_layer.h"
#include "rs_layerlist.h"
#include "rs_line.h"
#include "rs_mtext.h"
#include "rs_point.h"
#include "rs_polyline.h"
#include "rs_text.h"
#include "rs_units.h"
#include "rs_vector.h"
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
}


/**
 * @return true if this entity or any parent entities are undone.
 */
bool RS_Entity::isUndone() const {
		if (!parent) {
                return RS_Undoable::isUndone();
        }
        else {
                return RS_Undoable::isUndone() || parent->isUndone();
        }
}


/**
 * @return True if the entity is in the given range.
 */
bool RS_Entity::isInWindow(RS_Vector v1, RS_Vector v2) const







|
|
<
|
|
|







238
239
240
241
242
243
244
245
246

247
248
249
250
251
252
253
254
255
256
}


/**
 * @return true if this entity or any parent entities are undone.
 */
bool RS_Entity::isUndone() const {
    if (!parent) {
        return RS_Undoable::isUndone();

    } else {
        return RS_Undoable::isUndone() || parent->isUndone();
    }
}


/**
 * @return True if the entity is in the given range.
 */
bool RS_Entity::isInWindow(RS_Vector v1, RS_Vector v2) const
762
763
764
765
766
767
768
769
770

771
772
773
774


















775
776
777
778
779
780
781
782
783
784
}

/**
 * Sets the layer of this entity to the current layer of
 * the graphic this entity is in. If this entity (and none
 * of its parents) are in a graphic the layer is set to nullptr.
 */
void RS_Entity::setLayerToActive() {
    RS_Graphic* graphic = getGraphic();


    if (graphic) {
        layer = graphic->getActiveLayer();
    } else {


















        layer = nullptr;
    }
}

RS_Pen RS_Entity::getPenResolved() const {
    RS_Pen p = pen;
    // use parental attributes (e.g. vertex of a polyline, block
    // entities when they are drawn in block documents):
    if (parent != nullptr && parent->rtti() != RS2::EntityGraphic) {
        //if pen is invalid gets all from parent







|

>


|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|







765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
}

/**
 * Sets the layer of this entity to the current layer of
 * the graphic this entity is in. If this entity (and none
 * of its parents) are in a graphic the layer is set to nullptr.
 */
void RS_Entity::setLayerToActive(bool dim) {
    RS_Graphic* graphic = getGraphic();
    RS_Layer* active = nullptr;

    if (graphic) {
      active = graphic->getActiveLayer();

      if (dim) {
        RS_LayerList* list = graphic->getLayerList();
        auto* op = new LC_LayerTreeModelOptions();
        auto* lt = new LC_LayerTreeModel(nullptr, op);
        lt->setLayerList(list);

        LC_LayerTreeItem* item = (active) ? lt->getItemForLayer(active) : lt->getRoot();

        if (item && item->getLayerType() != LC_LayerTreeItem::DIMENSIONAL) item = item->firstChildOfType(LC_LayerTreeItem::DIMENSIONAL);
        if (!item) {
          item = lt->getRoot();
          item = item->firstChildOfType(LC_LayerTreeItem::DIMENSIONAL);
        }

        if (item) active = item->getLayer();
      }
    }

    layer = active;
}


RS_Pen RS_Entity::getPenResolved() const {
    RS_Pen p = pen;
    // use parental attributes (e.g. vertex of a polyline, block
    // entities when they are drawn in block documents):
    if (parent != nullptr && parent->rtti() != RS2::EntityGraphic) {
        //if pen is invalid gets all from parent

Changes to librecad/src/lib/engine/document/entities/rs_entity.h.

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
    virtual RS_Graphic* getGraphic() const;
    RS_Block *getBlock() const;
    RS_Insert *getInsert() const;
    RS_Entity *getBlockOrInsert() const;
    RS_Document *getDocument() const;
    void setLayer(const QString &name);
    void setLayer(RS_Layer *l);
    void setLayerToActive();
    RS_Layer *getLayer(bool resolve = true) const;
    RS_Layer *getLayerResolved() const;

    /**
     * Sets the explicit pen for this entity or a pen with special
     * attributes such as BY_LAYER, ..
     */







|







141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
    virtual RS_Graphic* getGraphic() const;
    RS_Block *getBlock() const;
    RS_Insert *getInsert() const;
    RS_Entity *getBlockOrInsert() const;
    RS_Document *getDocument() const;
    void setLayer(const QString &name);
    void setLayer(RS_Layer *l);
    void setLayerToActive(bool dim=false);
    RS_Layer *getLayer(bool resolve = true) const;
    RS_Layer *getLayerResolved() const;

    /**
     * Sets the explicit pen for this entity or a pen with special
     * attributes such as BY_LAYER, ..
     */

Changes to librecad/src/lib/engine/document/entities/rs_hatch.cpp.

22
23
24
25
26
27
28

29
30
31
32
33
34
35
**
** This copyright notice MUST APPEAR in all copies of the script!
**
**********************************************************************/
#include <cmath>
#include <iostream>
#include <memory>

#include <set>

#include <QPainterPath>
#include <QBrush>
#include <QString>

#include "lc_looputils.h"







>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
**
** This copyright notice MUST APPEAR in all copies of the script!
**
**********************************************************************/
#include <cmath>
#include <iostream>
#include <memory>
#include <qnamespace.h>
#include <set>

#include <QPainterPath>
#include <QBrush>
#include <QString>

#include "lc_looputils.h"
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623



624


625
626
627
628
629
630
631
632
633
634
635
636
                    auto* loop = (RS_EntityContainer*)l;
                    loop->optimizeContours();
                }
            }
        needOptimization = false;
    }
    QPainterPath path;
    QList<QPolygon> paClosed;
    QPolygon pa;


    const QBrush brush(painter->brush());
    const RS_Pen pen=painter->getPen();
    painter->setBrush(pen.getColor());
//    painter->disablePen();

    createSolidFillPath(painter, view, path);
    /*  if(pa.size()>2){
            pa<<pa.first();
            paClosed<<pa;
        }

        for(auto& p:paClosed){
            path.addPolygon(p);
        }*/

    //bug#474, restore brush after solid fill
/*    const QBrush brush(painter->brush());
    const RS_Pen pen=painter->getPen();
    painter->setBrush(pen.getColor());
    painter->disablePen();*/
    painter->drawPath(path);
    QBrush fillBrush = brush;
    fillBrush.setColor(pen.getColor());
    fillBrush.setStyle(Qt::SolidPattern);
//    path.closeSubpath();



//    painter->fillPath(path, fillBrush);



//    debugOutPath(path);
//    painter->drawPath(path);
    painter->setBrush(brush);
    painter->setPen(pen);
}

void RS_Hatch::createSolidFillPath(RS_Painter *painter, const RS_GraphicView *view, QPainterPath &path) {
    painter->createSolidFillPath(path, view, entities);
}

void RS_Hatch::debugOutPath(const QPainterPath &tmpPath) const {







<
<

<
|
|
<
<


<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
|


|
>
>
>
|
>
>
|
|
<
|
|







589
590
591
592
593
594
595


596

597
598


599
600



601











602
603
604
605
606
607
608
609
610
611
612
613

614
615
616
617
618
619
620
621
622
                    auto* loop = (RS_EntityContainer*)l;
                    loop->optimizeContours();
                }
            }
        needOptimization = false;
    }
    QPainterPath path;




    const QBrush oldbrush(painter->brush());
    const RS_Pen oldpen=painter->getPen();



    createSolidFillPath(painter, view, path);















    QBrush fillBrush = oldbrush;
    fillBrush.setColor(pen.getColor());
    fillBrush.setStyle(Qt::SolidPattern);

    if (isSelected() || isHighlighted()) {
      fillBrush.setColor(oldpen.getColor());
      fillBrush.setStyle(Qt::Dense6Pattern);
      painter->fillPath(path, fillBrush);
    } else {
      painter->fillPath(path, fillBrush);
    }


    painter->setBrush(oldbrush);
    painter->setPen(oldpen);
}

void RS_Hatch::createSolidFillPath(RS_Painter *painter, const RS_GraphicView *view, QPainterPath &path) {
    painter->createSolidFillPath(path, view, entities);
}

void RS_Hatch::debugOutPath(const QPainterPath &tmpPath) const {

Changes to librecad/src/lib/engine/document/entities/rs_mtext.cpp.

263
264
265
266
267
268
269

270
271
272
273
274
275
276
 * text or it's data, position, alignment, .. changes.
 * This method also updates the usedTextWidth / usedTextHeight property.
 */
void RS_MText::update() {
  RS_DEBUG->print("RS_MText::update");

  clear();

  if (isUndone()) {
    return;
  }

  usedTextWidth = 0.0;
  usedTextHeight = 0.0;








>







263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
 * text or it's data, position, alignment, .. changes.
 * This method also updates the usedTextWidth / usedTextHeight property.
 */
void RS_MText::update() {
  RS_DEBUG->print("RS_MText::update");

  clear();

  if (isUndone()) {
    return;
  }

  usedTextWidth = 0.0;
  usedTextHeight = 0.0;

400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
          ++i;
        }

        // add texts:
        double upperWidth{0.0};
        if (!upperText.isEmpty()) {
          RS_MText *upper =
              createUpperLower(upperText, data, letterPos + RS_Vector{0., 9.});
          oneLine->addEntity(upper);
          upper->reparent(oneLine);
          upperWidth = upper->getSize().x;
        }

        double lowerWidth{0.0};
        if (!lowerText.isEmpty()) {







|







401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
          ++i;
        }

        // add texts:
        double upperWidth{0.0};
        if (!upperText.isEmpty()) {
          RS_MText *upper =
              createUpperLower(upperText, data, letterPos + RS_Vector{0.0, 12.0});
          oneLine->addEntity(upper);
          upper->reparent(oneLine);
          upperWidth = upper->getSize().x;
        }

        double lowerWidth{0.0};
        if (!lowerText.isEmpty()) {
571
572
573
574
575
576
577
578
579
580
581
582
583

584
585
586
587
588
589
590
    // next letter position:
    letterPosition += letterSpace;
}

RS_MText *RS_MText::createUpperLower(QString text, const RS_MTextData &data,
                                     const RS_Vector &position) {
    auto *line = new RS_MText(
        nullptr, {position, 4.0, 100.0, RS_MTextData::VATop, RS_MTextData::HALeft,
                  data.drawingDirection, RS_MTextData::Exact, 1.0,
                  std::move(text), data.style, 0.0, RS2::Update});
    line->setLayer(nullptr);
    line->setPen({RS2::FlagInvalid});
    line->calculateBorders();

    return line;
}

/**
 * Used internally by update() to add a text line created with
 * default values and alignment to this text container.
 *







|





>







572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
    // next letter position:
    letterPosition += letterSpace;
}

RS_MText *RS_MText::createUpperLower(QString text, const RS_MTextData &data,
                                     const RS_Vector &position) {
    auto *line = new RS_MText(
        nullptr, {position, 6.0, 100.0, RS_MTextData::VATop, RS_MTextData::HALeft,
                  data.drawingDirection, RS_MTextData::Exact, 1.0,
                  std::move(text), data.style, 0.0, RS2::Update});
    line->setLayer(nullptr);
    line->setPen({RS2::FlagInvalid});
    line->calculateBorders();
    line->update();
    return line;
}

/**
 * Used internally by update() to add a text line created with
 * default values and alignment to this text container.
 *
619
620
621
622
623
624
625




626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
            textLine->move(RS_Vector{- textLine->getMax().x, 0.});
            break;

        default:
            textLine->move(RS_Vector{- textLine->getMin().x, 0.});
            break;
    }





    // Update actual text size (before rotating, after scaling!):
    if (textLine->getSize().x > usedTextWidth) {
        usedTextWidth = textLine->getSize().x;
    }

    usedTextHeight += data.height * data.lineSpacingFactor * ls;

    // Gets the distance over text base-line (before rotating, after scaling!):
    double textTail = textLine->getMin().y;

    // Move:
    textLine->move(data.insertionPoint + RS_Vector{0., -data.height * lineCounter * data.lineSpacingFactor * ls});
    // Rotate:
    // textLine->rotate(data.insertionPoint, data.angle);

    textLine->setPen(RS_Pen(RS2::FlagInvalid));
    textLine->setLayer(nullptr);
    textLine->forcedCalculateBorders();

    addEntity(textLine);
    return textTail;
}

RS_Vector RS_MText::getNearestEndpoint(const RS_Vector &coord,
                                       double *dist) const {
    if (dist) {







>
>
>
>
















<
<
<
<







621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647




648
649
650
651
652
653
654
            textLine->move(RS_Vector{- textLine->getMax().x, 0.});
            break;

        default:
            textLine->move(RS_Vector{- textLine->getMin().x, 0.});
            break;
    }

    textLine->setPen(RS_Pen(RS2::FlagInvalid));
    textLine->setLayer(nullptr);
    textLine->forcedCalculateBorders();

    // Update actual text size (before rotating, after scaling!):
    if (textLine->getSize().x > usedTextWidth) {
        usedTextWidth = textLine->getSize().x;
    }

    usedTextHeight += data.height * data.lineSpacingFactor * ls;

    // Gets the distance over text base-line (before rotating, after scaling!):
    double textTail = textLine->getMin().y;

    // Move:
    textLine->move(data.insertionPoint + RS_Vector{0., -data.height * lineCounter * data.lineSpacingFactor * ls});
    // Rotate:
    // textLine->rotate(data.insertionPoint, data.angle);





    addEntity(textLine);
    return textTail;
}

RS_Vector RS_MText::getNearestEndpoint(const RS_Vector &coord,
                                       double *dist) const {
    if (dist) {
797
798
799
800
801
802
803

804

805
806
807
808
809
810
811
812
void RS_MText::draw(RS_Painter *painter, RS_GraphicView *view,
                    double & patternOffset) {
    /*if (!(painter && view))
        return;*/
#ifdef DEBUG_LINE_POINTS
    painter->drawRect(view->toGui(getMin()), view->toGui(getMax()));
#endif

    if (!view->isPrintPreview() && !view->isPrinting()) {

        if (view->isPanning() || view->toGuiDY(getHeight()) < view->getMinRenderableTextHeightInPx()) {
            drawDraft(painter, view, patternOffset);
            return;
        }
    }

    for (RS_Entity *entity: std::as_const(entities)) {
        entity->drawAsChild(painter, view, patternOffset);







>

>
|







799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
void RS_MText::draw(RS_Painter *painter, RS_GraphicView *view,
                    double & patternOffset) {
    /*if (!(painter && view))
        return;*/
#ifdef DEBUG_LINE_POINTS
    painter->drawRect(view->toGui(getMin()), view->toGui(getMax()));
#endif

    if (!view->isPrintPreview() && !view->isPrinting()) {
        if ((view->getSimplifyPanning() && view->isPanning()) ||
           (view->getSimplifySmall() && (view->toGuiDY(getHeight()) < view->getMinRenderableTextHeightInPx()))) {
            drawDraft(painter, view, patternOffset);
            return;
        }
    }

    for (RS_Entity *entity: std::as_const(entities)) {
        entity->drawAsChild(painter, view, patternOffset);

Changes to librecad/src/lib/engine/document/entities/rs_text.cpp.

542
543
544
545
546
547
548

549


550


551
552
553
554
555
556
557
    painter->drawLine(view->toGui(baselineStartPoint), view->toGui(baselineEndPoint));
}

void RS_Text::draw(RS_Painter* painter, RS_GraphicView* view, double& patternOffset){
//    if (!(painter && view)) {
//        return;
//    }

    if (!view->isPrintPreview() && !view->isPrinting()){


        if (view->isPanning() || view->toGuiDY(getHeight()) < view->getMinRenderableTextHeightInPx()){


            drawDraft(painter, view, patternOffset);
            return;
        }
    }

    foreach (auto e, entities){
       view->drawAsChild(painter, e, patternOffset);







>

>
>
|
>
>







542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
    painter->drawLine(view->toGui(baselineStartPoint), view->toGui(baselineEndPoint));
}

void RS_Text::draw(RS_Painter* painter, RS_GraphicView* view, double& patternOffset){
//    if (!(painter && view)) {
//        return;
//    }

    if (!view->isPrintPreview() && !view->isPrinting()){
        if (
           (view->getSimplifyPanning() && view->isPanning()) ||
           (view->getSimplifySmall() && (view->toGuiDY(getHeight()) < view->getMinRenderableTextHeightInPx()))
           )
        {
            drawDraft(painter, view, patternOffset);
            return;
        }
    }

    foreach (auto e, entities){
       view->drawAsChild(painter, e, patternOffset);

Changes to librecad/src/lib/engine/rs_pen.h.

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
     */
    RS_Pen(const RS_Color& c,
           RS2::LineWidth w,
           RS2::LineType t) : RS_Flags() {
        setColor(c);
        setWidth(w);
        setLineType(t);
		      setScreenWidth(0);
        setAlpha(1.0);
    }
    /**
     * Creates a default pen with the given flags. This is 
     * usually used to create invalid pens.
     *
     * e.g.:
     * <pre>
     *   RS_Pen p(RS2::FlagInvalid);
     * </pre>
     */
    RS_Pen(unsigned int f) : RS_Flags(f) {
        setColor(RS_Color(0,0,0));
        setWidth(RS2::Width00);
        setLineType(RS2::SolidLine);
		      setScreenWidth(0);
        setAlpha(1.0);
    }
    //RS_Pen(const RS_Pen& pen) : RS_Flags(pen.getFlags()) {
    //    lineType = pen.lineType;
    //    width = pen.width;
    //    color = pen.color;
    //}







|















|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
     */
    RS_Pen(const RS_Color& c,
           RS2::LineWidth w,
           RS2::LineType t) : RS_Flags() {
        setColor(c);
        setWidth(w);
        setLineType(t);
        setScreenWidth(1.0);
        setAlpha(1.0);
    }
    /**
     * Creates a default pen with the given flags. This is 
     * usually used to create invalid pens.
     *
     * e.g.:
     * <pre>
     *   RS_Pen p(RS2::FlagInvalid);
     * </pre>
     */
    RS_Pen(unsigned int f) : RS_Flags(f) {
        setColor(RS_Color(0,0,0));
        setWidth(RS2::Width00);
        setLineType(RS2::SolidLine);
        setScreenWidth(1.0);
        setAlpha(1.0);
    }
    //RS_Pen(const RS_Pen& pen) : RS_Flags(pen.getFlags()) {
    //    lineType = pen.lineType;
    //    width = pen.width;
    //    color = pen.color;
    //}
152
153
154
155
156
157
158








159
160
161
162
163
164
165

    float getAlpha() const {
        return alpha;
    }
    void setAlpha(float a) {
        alpha = a;
    }









    //RS_Pen& operator = (const RS_Pen& p) {
    //    lineType = p.lineType;
    //    width = p.width;
    //    color = p.color;
    //    setFlags(p.getFlags());








>
>
>
>
>
>
>
>







152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173

    float getAlpha() const {
        return alpha;
    }
    void setAlpha(float a) {
        alpha = a;
    }

    void setScale(double s) {
        Scale = s;
    }

    double getScale() const {
        return Scale;
    }

    //RS_Pen& operator = (const RS_Pen& p) {
    //    lineType = p.lineType;
    //    width = p.width;
    //    color = p.color;
    //    setFlags(p.getFlags());

199
200
201
202
203
204
205
206




207
208
209
210
211
212

    friend std::ostream& operator << (std::ostream& os, const RS_Pen& p);


protected:
    RS2::LineType lineType = RS2::SolidLine;
    RS2::LineWidth width = RS2::Width00;
    double screenWidth = 0.;




    RS_Color color{};
    float alpha = 1.;
    double m_dashOffset = 0.;
};

#endif







|
>
>
>
>






207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224

    friend std::ostream& operator << (std::ostream& os, const RS_Pen& p);


protected:
    RS2::LineType lineType = RS2::SolidLine;
    RS2::LineWidth width = RS2::Width00;
    double Scale = 1.0;

    double screenWidth = 1.0;               // This field MUST contain the exact width of the pen in pixels, in order to provide correct scaling of the line patterns.
                                            // The widths < 1.0 will be converted to plain 0 in RS_Painter, before actual draw.
                                            // Because of some reason, we still have values of 0.0 or ever wrong huge values in this field and this looks like a bug somewhere.
    RS_Color color{};
    float alpha = 1.;
    double m_dashOffset = 0.;
};

#endif

Changes to librecad/src/lib/engine/rs_system.cpp.

558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
            for(QString& file: files)
            {
                fileList += path + "/" + file;
            }
        }
    }

    LC_LOG<<__func__<<"():: fileList:";
    foreach(const auto& file, fileList)
        LC_LOG<<file;

    return fileList;
}


/**
 * @return List of all directories in subdirectory 'subDirectory' in
 * all possible LibreCAD directories.







<
<
<
<







558
559
560
561
562
563
564




565
566
567
568
569
570
571
            for(QString& file: files)
            {
                fileList += path + "/" + file;
            }
        }
    }





    return fileList;
}


/**
 * @return List of all directories in subdirectory 'subDirectory' in
 * all possible LibreCAD directories.
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689

    QStringList ret;

    RS_DEBUG->print("RS_System::getDirectoryList: Paths:");
    for (QStringList::Iterator it = dirList.begin(); it != dirList.end(); ++it ) {
        if (QFileInfo( *it).isDir()) {
            ret += (*it);
            RS_DEBUG->print(*it);
        }
    }

    for (auto& dir: ret) {
        RS_DEBUG->print("%s\n", QString("%1(): line %2: dir=%3").arg(__func__).arg(__LINE__).arg(dir).toUtf8().constData());
    }

    return ret;
}

/**
 * Converts a language string to a symbol (e.g. Deutsch or German to 'de').
 * Languages taken from RFC3066
 */







<



<
<
<
<







664
665
666
667
668
669
670

671
672
673




674
675
676
677
678
679
680

    QStringList ret;

    RS_DEBUG->print("RS_System::getDirectoryList: Paths:");
    for (QStringList::Iterator it = dirList.begin(); it != dirList.end(); ++it ) {
        if (QFileInfo( *it).isDir()) {
            ret += (*it);

        }
    }





    return ret;
}

/**
 * Converts a language string to a symbol (e.g. Deutsch or German to 'de').
 * Languages taken from RFC3066
 */
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
    QString ret;
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
    QString territory = RS_Locale::territoryToString(loc.territory());
#else
    QString territory = RS_Locale::countryToString(loc.country());
#endif

if (symb.contains( QRegularExpression( "^en"))) {
        ret = RS_Locale::languageToString( loc.language());
        if( symb.contains('_') ) {
            ret += " (" + territory + ')';
        }
    }
    else {
        ret = RS_Locale::languageToString( loc.language()) + ' ' + loc.nativeLanguageName();







|







707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
    QString ret;
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
    QString territory = RS_Locale::territoryToString(loc.territory());
#else
    QString territory = RS_Locale::countryToString(loc.country());
#endif

    if (symb.contains( QRegularExpression( "^en"))) {
        ret = RS_Locale::languageToString( loc.language());
        if( symb.contains('_') ) {
            ret += " (" + territory + ')';
        }
    }
    else {
        ret = RS_Locale::languageToString( loc.language()) + ' ' + loc.nativeLanguageName();

Changes to librecad/src/lib/engine/rs_vector.cpp.

43
44
45
46
47
48
49

50
51
52
53
54
55
56
57
58
59

60
61
62
63
64
65
66
 */
RS_Vector::RS_Vector(double vx, double vy, double vz):
    x(vx)
    ,y(vy)
    ,z(vz)
    ,valid(true)
{

}

/**
 * Constructor for a unit vector with given angle
 */
RS_Vector::RS_Vector(double angle):
    x(std::cos(angle))
    ,y(std::sin(angle))
    ,valid(true)
{

}

RS_Vector::RS_Vector(const QPointF &point):
    RS_Vector{point.x(), point.y()}
{}

/**







>










>







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 */
RS_Vector::RS_Vector(double vx, double vy, double vz):
    x(vx)
    ,y(vy)
    ,z(vz)
    ,valid(true)
{
    FixZeroes();
}

/**
 * Constructor for a unit vector with given angle
 */
RS_Vector::RS_Vector(double angle):
    x(std::cos(angle))
    ,y(std::sin(angle))
    ,valid(true)
{
    FixZeroes();
}

RS_Vector::RS_Vector(const QPointF &point):
    RS_Vector{point.x(), point.y()}
{}

/**
83
84
85
86
87
88
89

90
91
92
93
94
95
96
97
98
99

100
101
102
103
104
105

106
107
108
109
110
111

112
113
114
115
116
117
118
119
120
121

122
123
124
125
126
127
128
 * Sets to a unit vector by the direction angle
 */
void RS_Vector::set(double angle) {
    x = std::cos(angle);
    y = std::sin(angle);
    z = 0.;
    valid = true;

}

/**
 * Sets a new position for the vector.
 */
void RS_Vector::set(double vx, double vy, double vz) {
    x = vx;
    y = vy;
    z = vz;
    valid = true;

}

void RS_Vector::plus(const RS_Vector &other) {
   x+= other.x;
   y+= other.y;
   z+= other.z;

}

void RS_Vector::minus(const RS_Vector &other) {
    x-= other.x;
    y-= other.y;
    z-= other.z;

}

/**
 * Sets a new position for the vector in polar coordinates.
 */
void RS_Vector::setPolar(double radius, double angle) {
    x = radius * std::cos(angle);
    y = radius * std::sin(angle);
    z = 0.0;
    valid = true;

}

RS_Vector RS_Vector::polar(double rho, double theta){
    return {rho * std::cos(theta), rho * std::sin(theta), 0.};
}
/**
 * Returns vector that defines point located in specified distance and angle from current







>










>






>






>










>







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
 * Sets to a unit vector by the direction angle
 */
void RS_Vector::set(double angle) {
    x = std::cos(angle);
    y = std::sin(angle);
    z = 0.;
    valid = true;
    FixZeroes();
}

/**
 * Sets a new position for the vector.
 */
void RS_Vector::set(double vx, double vy, double vz) {
    x = vx;
    y = vy;
    z = vz;
    valid = true;
    FixZeroes();
}

void RS_Vector::plus(const RS_Vector &other) {
   x+= other.x;
   y+= other.y;
   z+= other.z;
   FixZeroes();
}

void RS_Vector::minus(const RS_Vector &other) {
    x-= other.x;
    y-= other.y;
    z-= other.z;
    FixZeroes();
}

/**
 * Sets a new position for the vector in polar coordinates.
 */
void RS_Vector::setPolar(double radius, double angle) {
    x = radius * std::cos(angle);
    y = radius * std::sin(angle);
    z = 0.0;
    valid = true;
    FixZeroes();
}

RS_Vector RS_Vector::polar(double rho, double theta){
    return {rho * std::cos(theta), rho * std::sin(theta), 0.};
}
/**
 * Returns vector that defines point located in specified distance and angle from current
289
290
291
292
293
294
295

296
297
298
299
300
301
302
 * 0/0 by the angle of the vector
 */
RS_Vector& RS_Vector::rotate(const RS_Vector& angleVector) {
    double x0 = x * angleVector.x - y * angleVector.y;
    y = x * angleVector.y + y * angleVector.x;
    x = x0;


    return *this;
}

/**
 * Rotates this vector around the given center by the given angle.
 */
RS_Vector& RS_Vector::rotate(const RS_Vector& center, double ang) {







>







296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
 * 0/0 by the angle of the vector
 */
RS_Vector& RS_Vector::rotate(const RS_Vector& angleVector) {
    double x0 = x * angleVector.x - y * angleVector.y;
    y = x * angleVector.y + y * angleVector.x;
    x = x0;

    FixZeroes();
    return *this;
}

/**
 * Rotates this vector around the given center by the given angle.
 */
RS_Vector& RS_Vector::rotate(const RS_Vector& center, double ang) {
310
311
312
313
314
315
316

317
318
319
320
321
322
323
324
325

326
327
328
329
330
331
332

/**
 * Scales this vector by the given factors with 0/0 as center.
 */
RS_Vector& RS_Vector::scale(double factor) {
    x *= factor;
    y *= factor;

    return *this;
}

/**
 * Scales this vector by the given factors with 0/0 as center.
 */
RS_Vector& RS_Vector::scale(const RS_Vector& factor) {
    x *= factor.x;
    y *= factor.y;

    return *this;
}

RS_Vector RS_Vector::scale(const RS_Vector& factor) const{
    return {x*factor.x, y*factor.y};
}








>









>







318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342

/**
 * Scales this vector by the given factors with 0/0 as center.
 */
RS_Vector& RS_Vector::scale(double factor) {
    x *= factor;
    y *= factor;
    FixZeroes();
    return *this;
}

/**
 * Scales this vector by the given factors with 0/0 as center.
 */
RS_Vector& RS_Vector::scale(const RS_Vector& factor) {
    x *= factor.x;
    y *= factor.y;
    FixZeroes();
    return *this;
}

RS_Vector RS_Vector::scale(const RS_Vector& factor) const{
    return {x*factor.x, y*factor.y};
}

357
358
359
360
361
362
363

364
365
366
367
368
369
370

    return *this;
}

RS_Vector& RS_Vector::shear(double k)
{
    x += k * y;

    return *this;
}

/**
 * Streams the vector components to stdout. e.g.: "1/4/0"
 */
std::ostream& operator << (std::ostream& os, const RS_Vector& v) {







>







367
368
369
370
371
372
373
374
375
376
377
378
379
380
381

    return *this;
}

RS_Vector& RS_Vector::shear(double k)
{
    x += k * y;
    FixZeroes();
    return *this;
}

/**
 * Streams the vector components to stdout. e.g.: "1/4/0"
 */
std::ostream& operator << (std::ostream& os, const RS_Vector& v) {
487
488
489
490
491
492
493

494
495
496
497
498
499
500
501
502
503

504
505
506
507
508
509
510

511
512
513
514
515
516
517
518
519
520

521
522
523
524
525
526
527
528
529
530

531
532
533
534
535
536
537
538
539
540
541

542
543
544
545
546
547
548
/**
 * += operator. Assert: both vectors must be valid.
 */
RS_Vector RS_Vector::operator += (const RS_Vector& v) {
    x += v.x;
    y += v.y;
    z += v.z;

    return *this;
}

/**
 * -= operator
 */
RS_Vector RS_Vector::operator -= (const RS_Vector& v) {
    x -= v.x;
    y -= v.y;
    z -= v.z;

    return *this;
}

RS_Vector RS_Vector::operator *= (const RS_Vector& v) {
    x *= v.x;
    y *= v.y;
    z *= v.z;

    return *this;
}

RS_Vector RS_Vector::operator /= (const RS_Vector& v) {
    if (fabs(v.x)> RS_TOLERANCE && fabs(v.y)>RS_TOLERANCE){
        x /= v.x;
        y /= v.y;
        if (std::isnormal(v.z))
            z /= v.z;
    }

    return *this;
}

/**
 * *= operator
 */
RS_Vector RS_Vector::operator *= (double s) {
    x *= s;
    y *= s;
    z *= s;

    return *this;
}
/**
 * /= operator
 */
RS_Vector RS_Vector::operator /= (double s) {
    if(std::abs(s)>RS_TOLERANCE) {
        x /= s;
        y /= s;
        z /= s;
    }

    return *this;
}

/**
 * == operator
 */
bool RS_Vector::operator == (const RS_Vector& v) const {







>










>







>










>










>











>







498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
/**
 * += operator. Assert: both vectors must be valid.
 */
RS_Vector RS_Vector::operator += (const RS_Vector& v) {
    x += v.x;
    y += v.y;
    z += v.z;
    FixZeroes();
    return *this;
}

/**
 * -= operator
 */
RS_Vector RS_Vector::operator -= (const RS_Vector& v) {
    x -= v.x;
    y -= v.y;
    z -= v.z;
    FixZeroes();
    return *this;
}

RS_Vector RS_Vector::operator *= (const RS_Vector& v) {
    x *= v.x;
    y *= v.y;
    z *= v.z;
    FixZeroes();
    return *this;
}

RS_Vector RS_Vector::operator /= (const RS_Vector& v) {
    if (fabs(v.x)> RS_TOLERANCE && fabs(v.y)>RS_TOLERANCE){
        x /= v.x;
        y /= v.y;
        if (std::isnormal(v.z))
            z /= v.z;
    }
    FixZeroes();
    return *this;
}

/**
 * *= operator
 */
RS_Vector RS_Vector::operator *= (double s) {
    x *= s;
    y *= s;
    z *= s;
    FixZeroes();
    return *this;
}
/**
 * /= operator
 */
RS_Vector RS_Vector::operator /= (double s) {
    if(std::abs(s)>RS_TOLERANCE) {
        x /= s;
        y /= s;
        z /= s;
    }
    FixZeroes();
    return *this;
}

/**
 * == operator
 */
bool RS_Vector::operator == (const RS_Vector& v) const {
559
560
561
562
563
564
565







566
567
568
569
570
571
572
}

bool RS_Vector::operator != (bool valid) const
{
    return this->valid != valid;
}








/**
 * @return A vector with the minimum components from the vectors v1 and v2.
 * These might be mixed components from both vectors.
 */
RS_Vector RS_Vector::minimum (const RS_Vector& v1, const RS_Vector& v2) {
    if (!v2) return v1;
    if (!v1) return v2;







>
>
>
>
>
>
>







576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
}

bool RS_Vector::operator != (bool valid) const
{
    return this->valid != valid;
}


void RS_Vector::FixZeroes() {
  if (fabs(x)<RS_TOLERANCE) x = 0.0;
  if (fabs(y)<RS_TOLERANCE) y = 0.0;
  if (fabs(z)<RS_TOLERANCE) z = 0.0;
}

/**
 * @return A vector with the minimum components from the vectors v1 and v2.
 * These might be mixed components from both vectors.
 */
RS_Vector RS_Vector::minimum (const RS_Vector& v1, const RS_Vector& v2) {
    if (!v2) return v1;
    if (!v1) return v2;

Changes to librecad/src/lib/engine/rs_vector.h.

24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
**
**********************************************************************/


#ifndef RS_VECTOR_H
#define RS_VECTOR_H


#include <vector>
#include <iosfwd>

class QPointF;

/**
 * Represents a 3d vector (x/y/z)
 *
 * @author Andrew Mustun
 */
class RS_Vector {

public:
    RS_Vector()=default;
    RS_Vector(double vx, double vy, double vz=0.0);
    explicit RS_Vector(double angle);
    //RS_Vector(double v[]);
    explicit RS_Vector(bool valid);
    explicit RS_Vector(const QPointF& point);







>











>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
**
**********************************************************************/


#ifndef RS_VECTOR_H
#define RS_VECTOR_H

#include "rs.h"
#include <vector>
#include <iosfwd>

class QPointF;

/**
 * Represents a 3d vector (x/y/z)
 *
 * @author Andrew Mustun
 */
class RS_Vector {

public:
    RS_Vector()=default;
    RS_Vector(double vx, double vy, double vz=0.0);
    explicit RS_Vector(double angle);
    //RS_Vector(double v[]);
    explicit RS_Vector(bool valid);
    explicit RS_Vector(const QPointF& point);
154
155
156
157
158
159
160




161
162
163
164
165
166
167
#endif

public:
    double x=0.;
    double y=0.;
    double z=0.;
    bool valid=false;




};


/**
 * Represents one to 4 vectors. Typically used to return multiple
 * solutions from a function.
 */







>
>
>
>







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#endif

public:
    double x=0.;
    double y=0.;
    double z=0.;
    bool valid=false;

private:
    void FixZeroes();

};


/**
 * Represents one to 4 vectors. Typically used to return multiple
 * solutions from a function.
 */

Changes to librecad/src/lib/gui/rs_graphicview.cpp.

44
45
46
47
48
49
50

51
52
53
54
55
56
57
#include "rs_math.h"
#include "rs_painter.h"
#include "rs_snapper.h"
#include "rs_settings.h"
#include "rs_units.h"
#include "lc_linemath.h"
#include "dxf_format.h"


#ifdef EMU_C99
#include "emu_c99.h"
#endif

#ifdef DEBUG_RENDERING
#define DEBUG_RENDERING_DETAILS







>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "rs_math.h"
#include "rs_painter.h"
#include "rs_snapper.h"
#include "rs_settings.h"
#include "rs_units.h"
#include "lc_linemath.h"
#include "dxf_format.h"
#include "lc_defaults.h"

#ifdef EMU_C99
#include "emu_c99.h"
#endif

#ifdef DEBUG_RENDERING
#define DEBUG_RENDERING_DETAILS
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140

141
142
143

















































144
145



146
147
148
149
150
151
152
    :QWidget(parent, f), eventHandler{new RS_EventHandler{this}},
    m_colorData{std::make_unique<ColorData>()},
    grid{std::make_unique<RS_Grid>(this)},
    defaultSnapMode{std::make_unique<RS_SnapMode>()},
    drawingMode(RS2::ModeFull),
    savedViews(16),
    previousViewTime{std::make_unique<QDateTime>(QDateTime::currentDateTime())} {
//    loadSettings();
}

void RS_GraphicView::loadSettings() {

    LC_GROUP("Appearance");
    {
        this->m_colorData->hideRelativeZero = LC_GET_BOOL("hideRelativeZero");
        extendAxisLines = LC_GET_BOOL("ExtendAxisLines", false);
        entityHandleHalfSize = LC_GET_INT("EntityHandleSize", 4) / 2;
        relativeZeroRadius = LC_GET_INT("RelZeroMarkerRadius", 5);
        zeroShortAxisMarkSize = LC_GET_INT("ZeroShortAxisMarkSize", 20);
        extendAxisModeX = LC_GET_INT("ExtendModeXAxis",0);
        extendAxisModeY = LC_GET_INT("ExtendModeYAxis",0);
        ignoreDraftForHighlight = LC_GET_BOOL("IgnoreDraftForHighlight", false);
        draftLinesMode = LC_GET_BOOL("DraftLinesMode", false);

        m_panOnZoom = LC_GET_BOOL("PanOnZoom", false);
        m_skipFirstZoom = LC_GET_BOOL("FirstTimeNoZoom", false);

    } // Appearance group
    LC_GROUP_END();


















































    LC_GROUP("Render");
    {



        minRenderableTextHeightInPx = LC_GET_INT("MinRenderableTextHeightPx", 4);
        int minArcRadius100 = LC_GET_INT("MinArcRadius", 80);
        minArcDrawingRadius = minArcRadius100 / 100.0;

        int minCircleRadius100 = LC_GET_INT("MinCircleRadius", 200);
        minCircleDrawingRadius = minCircleRadius100 / 100.0;








<


















>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>







116
117
118
119
120
121
122

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
    :QWidget(parent, f), eventHandler{new RS_EventHandler{this}},
    m_colorData{std::make_unique<ColorData>()},
    grid{std::make_unique<RS_Grid>(this)},
    defaultSnapMode{std::make_unique<RS_SnapMode>()},
    drawingMode(RS2::ModeFull),
    savedViews(16),
    previousViewTime{std::make_unique<QDateTime>(QDateTime::currentDateTime())} {

}

void RS_GraphicView::loadSettings() {

    LC_GROUP("Appearance");
    {
        this->m_colorData->hideRelativeZero = LC_GET_BOOL("hideRelativeZero");
        extendAxisLines = LC_GET_BOOL("ExtendAxisLines", false);
        entityHandleHalfSize = LC_GET_INT("EntityHandleSize", 4) / 2;
        relativeZeroRadius = LC_GET_INT("RelZeroMarkerRadius", 5);
        zeroShortAxisMarkSize = LC_GET_INT("ZeroShortAxisMarkSize", 20);
        extendAxisModeX = LC_GET_INT("ExtendModeXAxis",0);
        extendAxisModeY = LC_GET_INT("ExtendModeYAxis",0);
        ignoreDraftForHighlight = LC_GET_BOOL("IgnoreDraftForHighlight", false);
        draftLinesMode = LC_GET_BOOL("DraftLinesMode", false);

        m_panOnZoom = LC_GET_BOOL("PanOnZoom", false);
        m_skipFirstZoom = LC_GET_BOOL("FirstTimeNoZoom", false);
        m_modifyOnZoom = LC_GET_BOOL("ModifyOnViewChange", true);
    } // Appearance group
    LC_GROUP_END();

    RS_Graphic* graphic = getGraphic();
    if (graphic != nullptr) {
        unitFactor = RS_Units::convert(1.0, RS2::Millimeter, graphic->getUnit());
        unitFactor100 =  unitFactor / 100.0;
        defaultWidthFactor = graphic->getVariableDouble("$DIMSCALE", 1.0);

        pdmode = graphic->getGraphicVariableInt("$PDMODE", LC_DEFAULTS_PDMode);
        pdsize = graphic->getGraphicVariableDouble("$PDSIZE", LC_DEFAULTS_PDSize);

        //        Lineweight endcaps setting for new objects:
        //        0 = none; 1 = round; 2 = angle; 3 = square
        int endCaps = graphic->getGraphicVariableInt("$ENDCAPS", 1);
        switch (endCaps){
            case 0:
                penCapStyle = Qt::FlatCap;
                break;
            case 1:
                penCapStyle = Qt::RoundCap;
                break;
            case 2:
                penCapStyle = Qt::MPenCapStyle;
                break;
            case 3:
                penCapStyle = Qt::SquareCap;
                break;
            default:
                penCapStyle = Qt::FlatCap; // fixme - or round?
        }
        //0=none; 1= round; 2 = angle; 3 = flat
        int joinStyle = graphic->getGraphicVariableInt("$JOINSTYLE", 1);

        switch (joinStyle){
            case 0:
                penJoinStyle = Qt::BevelJoin;
                break;
            case 1:
                penJoinStyle = Qt::RoundJoin;
                break;
            case 2:
                penJoinStyle = Qt::MiterJoin;
                break;
            case 3:
                penJoinStyle = Qt::BevelJoin;
                break;
            default:
                penJoinStyle = Qt::RoundJoin;
        }
    }

    LC_GROUP("Render");
    {
        simplifySmall = LC_GET_BOOL("SimplifySmall", true);
        simplifyPanning = LC_GET_BOOL("SimplifyPanning", true);

        minRenderableTextHeightInPx = LC_GET_INT("MinRenderableTextHeightPx", 4);
        int minArcRadius100 = LC_GET_INT("MinArcRadius", 80);
        minArcDrawingRadius = minArcRadius100 / 100.0;

        int minCircleRadius100 = LC_GET_INT("MinCircleRadius", 200);
        minCircleDrawingRadius = minCircleRadius100 / 100.0;

463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
}

/**
 * zooms in by factor f in x
 */
void RS_GraphicView::zoomInX(double f) {
    factor.x *= f;
    offsetX = (int) ((offsetX - getWidth() / 2) * f) + getWidth() / 2;
    adjustOffsetControls();
    adjustZoomControls();
    invalidate();
    redraw();
}

/**
 * zooms in by factor f in y
 */
void RS_GraphicView::zoomInY(double f) {
    factor.y *= f;
    offsetY = (int) ((offsetY - getHeight() / 2) * f) + getHeight() / 2;
    adjustOffsetControls();
    adjustZoomControls();
    invalidate();
    redraw();
}

/**







|











|







516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
}

/**
 * zooms in by factor f in x
 */
void RS_GraphicView::zoomInX(double f) {
    factor.x *= f;
    offsetX = offsetX + RS_Math::round((getWidth() / 2.0) * (1 - f));
    adjustOffsetControls();
    adjustZoomControls();
    invalidate();
    redraw();
}

/**
 * zooms in by factor f in y
 */
void RS_GraphicView::zoomInY(double f) {
    factor.y *= f;
    offsetY = offsetY + RS_Math::round((getHeight() / 2.0) * (1-f));
    adjustOffsetControls();
    adjustZoomControls();
    invalidate();
    redraw();
}

/**
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
            auto const dV = container->getMax() - container->getMin();
            sx = std::max(dV.x, 0.);
            sy = std::max(dV.y, 0.);
        } else {
            sx = container->getSize().x;
            sy = container->getSize().y;
        }
//		    std::cout<<" RS_GraphicView::zoomAuto("<<sx<<","<<sy<<")"<<std::endl;
//			std::cout<<" RS_GraphicView::zoomAuto("<<axis<<","<<keepAspectRatio<<")"<<std::endl;

        double fx = 1., fy = 1.;
        unsigned short fFlags = 0;

        if (sx > RS_TOLERANCE) {
            fx = (getWidth() - borderLeft - borderRight) / sx;
        } else {







|
|







605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
            auto const dV = container->getMax() - container->getMin();
            sx = std::max(dV.x, 0.);
            sy = std::max(dV.y, 0.);
        } else {
            sx = container->getSize().x;
            sy = container->getSize().y;
        }
//                  std::cout<<" RS_GraphicView::zoomAuto("<<sx<<","<<sy<<")"<<std::endl;
//                      std::cout<<" RS_GraphicView::zoomAuto("<<axis<<","<<keepAspectRatio<<")"<<std::endl;

        double fx = 1., fy = 1.;
        unsigned short fFlags = 0;

        if (sx > RS_TOLERANCE) {
            fx = (getWidth() - borderLeft - borderRight) / sx;
        } else {
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
}

/**
 * Saves the current view as previous view to which we can
 * switch back later with @see restoreView().
 */
void RS_GraphicView::saveView() {
    if (getGraphic()) getGraphic()->setModified(true);
    QDateTime noUpdateWindow = QDateTime::currentDateTime().addMSecs(-500);
//do not update view within 500 milliseconds
    if (*previousViewTime > noUpdateWindow) return;
    *previousViewTime = QDateTime::currentDateTime();
    savedViews[savedViewIndex] = std::make_tuple(offsetX, offsetY, factor);
    savedViewIndex = (savedViewIndex + 1) % savedViews.size();
    if (savedViewCount < savedViews.size()) savedViewCount++;







|







696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
}

/**
 * Saves the current view as previous view to which we can
 * switch back later with @see restoreView().
 */
void RS_GraphicView::saveView() {
    if (m_modifyOnZoom && getGraphic()) getGraphic()->setModified(true);
    QDateTime noUpdateWindow = QDateTime::currentDateTime().addMSecs(-500);
//do not update view within 500 milliseconds
    if (*previousViewTime > noUpdateWindow) return;
    *previousViewTime = QDateTime::currentDateTime();
    savedViews[savedViewIndex] = std::make_tuple(offsetX, offsetY, factor);
    savedViewIndex = (savedViewIndex + 1) % savedViews.size();
    if (savedViewCount < savedViews.size()) savedViewCount++;
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
    adjustOffsetControls();
    adjustZoomControls();
    invalidate();
    redraw();
}


/*	*
 *	Function name:
 *	Description:		Performs autozoom in Y axis only.
 *	Author(s):			..., Claude Sylvain
 *	Created:				?
 *	Last modified:		23 July 2011
 *
 *	Parameters:			bool axis:
 *								Axis in zoom.
 *
 *	Returns:				void
 *	*/

void RS_GraphicView::zoomAutoY(bool axis) {
    if (container) {
        double visibleHeight = 0.0;
        double minY = RS_MAXDOUBLE;
        double maxY = RS_MINDOUBLE;
        bool noChange = false;







|
|
|
|
|
|

|
|

|
|







734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
    adjustOffsetControls();
    adjustZoomControls();
    invalidate();
    redraw();
}


/*      *
 *      Function name:
 *      Description:            Performs autozoom in Y axis only.
 *      Author(s):                      ..., Claude Sylvain
 *      Created:                                ?
 *      Last modified:          23 July 2011
 *
 *      Parameters:                     bool axis:
 *                                                              Axis in zoom.
 *
 *      Returns:                                void
 *      */

void RS_GraphicView::zoomAutoY(bool axis) {
    if (container) {
        double visibleHeight = 0.0;
        double minY = RS_MAXDOUBLE;
        double maxY = RS_MINDOUBLE;
        bool noChange = false;
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
            painter->setPen(penSaved);
    }
#ifdef DEBUG_RENDERING_DETAILS
    layer1Time += drawLayer1Timer.elapsed();
#endif
}

/*	*
 *	Function name:
 *	Description: 		Do the drawing, step 2/3.
 *	Author(s):			..., Claude Sylvain
 *	Created:				?
 *	Last modified:		23 July 2011
 *
 *	Parameters:			RS_Painter *painter:
 *								...
 *
 *	Returns:				void
 *	*/

void RS_GraphicView::drawLayer2(RS_Painter *painter) {
#ifdef DEBUG_RENDERING_DETAILS
    drawLayer2Timer.start();
#endif
    screenPDSize = determinePointScreenSize(painter, pdsize);
    double patternOffset = 0.;







|
|
|
|
|
|

|
|

|
|







1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
            painter->setPen(penSaved);
    }
#ifdef DEBUG_RENDERING_DETAILS
    layer1Time += drawLayer1Timer.elapsed();
#endif
}

/*      *
 *      Function name:
 *      Description:            Do the drawing, step 2/3.
 *      Author(s):                      ..., Claude Sylvain
 *      Created:                                ?
 *      Last modified:          23 July 2011
 *
 *      Parameters:                     RS_Painter *painter:
 *                                                              ...
 *
 *      Returns:                                void
 *      */

void RS_GraphicView::drawLayer2(RS_Painter *painter) {
#ifdef DEBUG_RENDERING_DETAILS
    drawLayer2Timer.start();
#endif
    screenPDSize = determinePointScreenSize(painter, pdsize);
    double patternOffset = 0.;
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
                pen.setColor(m_colorData->previewReferenceHighlightedEntitiesColor);
            } else {
                pen.setColor(m_colorData->previewReferenceEntitiesColor);
            }
            pen.setLineType(RS2::SolidLine);
            pen.setWidth(RS2::LineWidth::Width00);
            e->setPen(pen);

//            pen.setScreenWidth(0.0);
            painter->setPen(pen);
            break;
        }
        default: {
            if (draftMode){
                if (ignoreDraftForHighlight) {
                    setPenForEntity(painter, e, patternOffset, true);







<
|







1187
1188
1189
1190
1191
1192
1193

1194
1195
1196
1197
1198
1199
1200
1201
                pen.setColor(m_colorData->previewReferenceHighlightedEntitiesColor);
            } else {
                pen.setColor(m_colorData->previewReferenceEntitiesColor);
            }
            pen.setLineType(RS2::SolidLine);
            pen.setWidth(RS2::LineWidth::Width00);
            e->setPen(pen);

            pen.setScreenWidth(1.0);
            painter->setPen(pen);
            break;
        }
        default: {
            if (draftMode){
                if (ignoreDraftForHighlight) {
                    setPenForEntity(painter, e, patternOffset, true);
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
                }
            }
        }
    }
}


/*	*
 *	Function name:
 *
 *	Description:	- Sets the pen of the painter object to the suitable pen
 *						  for the given entity.
 *
 *	Author(s):		..., Claude Sylvain
 *	Created:			?
 *	Last modified:	17 November 2011
 *
 *	Parameters:		RS_Painter *painter:
 *							...
 *
 *						RS_Entity *e:
 *							...
 *
 *	Returns:			void
 */
void RS_GraphicView::setPenForPrintingEntity(RS_Painter *painter, RS_Entity *e, double &patternOffset) {
#ifdef DEBUG_RENDERING
    setPenTimer.start();
#endif
// Getting pen from entity (or layer)








|
|

|
|

|
|
|

|
|

|
|

|







1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
                }
            }
        }
    }
}


/*      *
 *      Function name:
 *
 *      Description:    - Sets the pen of the painter object to the suitable pen
 *                                                for the given entity.
 *
 *      Author(s):              ..., Claude Sylvain
 *      Created:                        ?
 *      Last modified:  17 November 2011
 *
 *      Parameters:             RS_Painter *painter:
 *                                                      ...
 *
 *                                              RS_Entity *e:
 *                                                      ...
 *
 *      Returns:                        void
 */
void RS_GraphicView::setPenForPrintingEntity(RS_Painter *painter, RS_Entity *e, double &patternOffset) {
#ifdef DEBUG_RENDERING
    setPenTimer.start();
#endif
// Getting pen from entity (or layer)

1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238

1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
//   This is the standard (AutoCAD like) behaviour.
// bug# 3437941
// ------------------------------------------------------------

    if (pen.getAlpha() == 1.0) {
        if (width >0) {
            double wf = 1.0; // Width factor.

            if (paperScale > RS_TOLERANCE) {
                if (scaleLineWidth) {
                    wf = defaultWidthFactor;
                } else {
                    wf = 1.0 / paperScale;
                }
            }
            double screenWidth = toGuiDX(width * unitFactor100 * wf);

            /*// prevent drawing with 1-width which is slow:
            if (RS_Math::round(pen.getScreenWidth()) == 1) {
                pen.setScreenWidth(0.0);
            }*/
            if (screenWidth < 1){ // fixme - not sure about this check. However, without it, lines will stay transparent and then disappear on zooming out. Probably some other threshold value (instead 1) should be used?
                screenWidth = 0.0;
            }
            pen.setScreenWidth(screenWidth);
        }
        else{
            pen.setScreenWidth(0.0);

        }
    }
    else{
        // fixme - if we'll support transparency, add necessary processing there
        if (RS_Math::round(pen.getScreenWidth()) == 1) {
            pen.setScreenWidth(0.0);
        }
    }

    RS_Color backgroundColor;
    if (printPreview /*|| inPrintingMode*/){ //  todo - should we change color for printer mode too?
        backgroundColor = printPreviewPrintAreaColor; // same color as used for drawing print area in drawPaper
        // fixme - sand - nicer handling colors is needed. That should work fine if entity is over paper entity.







<
|
<
<
<
<
|
<

<
<
<
|
<
<
<
|
|


|
>





|







1263
1264
1265
1266
1267
1268
1269

1270




1271

1272



1273



1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
//   This is the standard (AutoCAD like) behaviour.
// bug# 3437941
// ------------------------------------------------------------

    if (pen.getAlpha() == 1.0) {
        if (width >0) {
            double wf = 1.0; // Width factor.

            if (paperScale > RS_TOLERANCE && !scaleLineWidth) wf = 1.0 / paperScale;






            double screenWidth = toGuiDX(width * unitFactor100 * wf);



            pen.setScreenWidth(screenWidth);




            pen.setScale(1.0/wf);
        }
        else{
            pen.setScreenWidth(1.0);
            pen.setScale(1.0);
        }
    }
    else{
        // fixme - if we'll support transparency, add necessary processing there
        if (RS_Math::round(pen.getScreenWidth()) == 1) {
            pen.setScreenWidth(1.0);
        }
    }

    RS_Color backgroundColor;
    if (printPreview /*|| inPrintingMode*/){ //  todo - should we change color for printer mode too?
        backgroundColor = printPreviewPrintAreaColor; // same color as used for drawing print area in drawPaper
        // fixme - sand - nicer handling colors is needed. That should work fine if entity is over paper entity.
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320

1321
1322
1323
1324
1325
1326
1327
        }
    }
    else{
        lastPaintedHighlighted = highlighted;
        lastPaintedSelected = selected;
        lastPaintOverlay = overlayPaint;
    }
    pen.setScreenWidth(0.0);

    if (overlayPaint) {
        if (highlighted) {    // Glowing effects on mouse hovering: use the "selected" color
            // for glowing effects on mouse hovering, draw solid lines
            pen.setColor(m_colorData->selectedColor);
            pen.setLineType(RS2::SolidLine);
        }
        else{
            if (pen.getColor().isEqualIgnoringFlags(m_colorData->background) || (pen.getColor().toIntColor() == RS_Color::Black
                                                                                 && pen.getColor().colorDistance(m_colorData->background) < RS_Color::MinColorDistance)) {
                pen.setColor(this->m_colorData->foreground);
            }
        }
    } else {
        // this entity is selected:
        if (selected) {
            pen.setLineType(RS2::DashLineTiny);
            pen.setWidth(RS2::Width00);
            pen.setColor(m_colorData->selectedColor);

        }
        else if (highlighted) {
            pen.setColor(m_colorData->highlightedColor);
        }
        else if (deleteMode || e->getFlag(RS2::FlagTransparent)) {
            pen.setColor(m_colorData->background);
        }







|





<










<


>







1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347

1348
1349
1350
1351
1352
1353
1354
1355
1356
1357

1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
        }
    }
    else{
        lastPaintedHighlighted = highlighted;
        lastPaintedSelected = selected;
        lastPaintOverlay = overlayPaint;
    }
    pen.setScreenWidth(1.0);

    if (overlayPaint) {
        if (highlighted) {    // Glowing effects on mouse hovering: use the "selected" color
            // for glowing effects on mouse hovering, draw solid lines
            pen.setColor(m_colorData->selectedColor);

        }
        else{
            if (pen.getColor().isEqualIgnoringFlags(m_colorData->background) || (pen.getColor().toIntColor() == RS_Color::Black
                                                                                 && pen.getColor().colorDistance(m_colorData->background) < RS_Color::MinColorDistance)) {
                pen.setColor(this->m_colorData->foreground);
            }
        }
    } else {
        // this entity is selected:
        if (selected) {

            pen.setWidth(RS2::Width00);
            pen.setColor(m_colorData->selectedColor);
            pen.setAlpha(0.7);
        }
        else if (highlighted) {
            pen.setColor(m_colorData->highlightedColor);
        }
        else if (deleteMode || e->getFlag(RS2::FlagTransparent)) {
            pen.setColor(m_colorData->background);
        }
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422

1423
1424
1425
1426
1427
1428
1429
        lastPaintOverlay = overlayPaint;
    }


#ifdef DEBUG_RENDERING
    setPenTimer.start();
#endif
    // Avoid negative widths
//    int w = std::max(static_cast<int>(pen.getWidth()), 0);
    double width = pen.getWidth();
    if (pen.getAlpha() == 1.0) {
        if (width>0) {
            double screenWidth = toGuiDX(width * unitFactor100);
            // prevent drawing with 1-width which is slow:
           /* if (RS_Math::round(screenWidth) == 1) {
                screenWidth = 0.0;
            }
            else*/ if (screenWidth < 1){ // fixme - not sure about this check. However, without it, lines will stay transparent and then disappear on zooming out. Probably some other threshold value (instead 1) should be used?
                screenWidth = 0.0;
            }
            pen.setScreenWidth(screenWidth);
        }
        else{
            pen.setScreenWidth(0.0);
        }
    }
    else{
            // fixme - if we'll support transparency, add necessary processing there
        if (RS_Math::round(pen.getScreenWidth()) == 1) {
            pen.setScreenWidth(0.0);
        }
    }


    if (overlayPaint) {
        if (highlighted) {    // Glowing effects on mouse hovering: use the "selected" color
            // for glowing effects on mouse hovering, draw solid lines
            pen.setColor(m_colorData->selectedColor);
            pen.setLineType(RS2::SolidLine);
        }
        else{
            if (pen.getColor().isEqualIgnoringFlags(m_colorData->background) || (pen.getColor().toIntColor() == RS_Color::Black
                                                                                 && pen.getColor().colorDistance(m_colorData->background) < RS_Color::MinColorDistance)) {
                pen.setColor(this->m_colorData->foreground);
            }
        }
    } else {
        // this entity is selected:
        if (selected) {
            pen.setLineType(RS2::DashLineTiny);
            pen.setWidth(RS2::Width00); // fixme - move to settings?
            pen.setColor(m_colorData->selectedColor);

        }
        // this entity is highlighted:
        else if (highlighted) {
            pen.setColor(m_colorData->highlightedColor);
        }
        else  if (deleteMode || e->getFlag(RS2::FlagTransparent)) {
            pen.setColor(m_colorData->background);







|
<

<
|
|
<
<
<
<
<
<
<
|
<
|
|
<
<
<
<
<
<
<







<










<
<

>







1411
1412
1413
1414
1415
1416
1417
1418

1419

1420
1421







1422

1423
1424







1425
1426
1427
1428
1429
1430
1431

1432
1433
1434
1435
1436
1437
1438
1439
1440
1441


1442
1443
1444
1445
1446
1447
1448
1449
1450
        lastPaintOverlay = overlayPaint;
    }


#ifdef DEBUG_RENDERING
    setPenTimer.start();
#endif


    double width = pen.getWidth();

    if (width>0) {
        double screenWidth = toGuiDX(width * unitFactor100);







        pen.setScreenWidth(screenWidth);

    } else {
        pen.setScreenWidth(1.0);







    }


    if (overlayPaint) {
        if (highlighted) {    // Glowing effects on mouse hovering: use the "selected" color
            // for glowing effects on mouse hovering, draw solid lines
            pen.setColor(m_colorData->selectedColor);

        }
        else{
            if (pen.getColor().isEqualIgnoringFlags(m_colorData->background) || (pen.getColor().toIntColor() == RS_Color::Black
                                                                                 && pen.getColor().colorDistance(m_colorData->background) < RS_Color::MinColorDistance)) {
                pen.setColor(this->m_colorData->foreground);
            }
        }
    } else {
        // this entity is selected:
        if (selected) {


            pen.setColor(m_colorData->selectedColor);
            pen.setAlpha(0.7);
        }
        // this entity is highlighted:
        else if (highlighted) {
            pen.setColor(m_colorData->highlightedColor);
        }
        else  if (deleteMode || e->getFlag(RS2::FlagTransparent)) {
            pen.setColor(m_colorData->background);
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
    // update is disabled:
    // given entity is nullptr:
    if (!e) {
        return;
    }

    // check for selected entity drawing
    if (/*!e->isContainer() && */(e->getFlag(RS2::FlagSelected) != painter->shouldDrawSelected())) {
        return;
    }
#ifdef DEBUG_RENDERING
    isVisibleTimer.start();
#endif
    // entity is not visible:
    bool visible = e->isVisible();







|







1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
    // update is disabled:
    // given entity is nullptr:
    if (!e) {
        return;
    }

    // check for selected entity drawing
    if ((e->getFlag(RS2::FlagSelected) != painter->shouldDrawSelected())) {
        return;
    }
#ifdef DEBUG_RENDERING
    isVisibleTimer.start();
#endif
    // entity is not visible:
    bool visible = e->isVisible();
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
 *
 * @see drawIt()
 */
void RS_GraphicView::drawAbsoluteZero(RS_Painter *painter){
    int const zr = zeroShortAxisMarkSize;

    RS_Pen pen_xAxis (m_colorData->xAxisExtensionColor, RS2::Width00, RS2::SolidLine);
    pen_xAxis.setScreenWidth(0);

    RS_Pen pen_yAxis (m_colorData->yAxisExtensionColor, RS2::Width00, RS2::SolidLine);
    pen_yAxis.setScreenWidth(0);

    auto originPoint = toGui(RS_Vector(0,0));


    int width = getWidth();
    int height = getHeight();
    if (extendAxisLines){







|


|







1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
 *
 * @see drawIt()
 */
void RS_GraphicView::drawAbsoluteZero(RS_Painter *painter){
    int const zr = zeroShortAxisMarkSize;

    RS_Pen pen_xAxis (m_colorData->xAxisExtensionColor, RS2::Width00, RS2::SolidLine);
    pen_xAxis.setScreenWidth(1.0);

    RS_Pen pen_yAxis (m_colorData->yAxisExtensionColor, RS2::Width00, RS2::SolidLine);
    pen_yAxis.setScreenWidth(1.0);

    auto originPoint = toGui(RS_Vector(0,0));


    int width = getWidth();
    int height = getHeight();
    if (extendAxisLines){
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
    }

    RS2::LineType relativeZeroPenType = RS2::SolidLine;

    if (m_colorData->hideRelativeZero) relativeZeroPenType = RS2::NoPen;

    RS_Pen p(m_colorData->relativeZeroColor, RS2::Width00, relativeZeroPenType);
    p.setScreenWidth(0);
    painter->setPen(p);

    int const zr = relativeZeroRadius*2;
    auto vp = toGui(relativeZero);
    if (vp.x + zr < 0 || vp.x - zr > getWidth()) return;
    if (vp.y + zr < 0 || vp.y - zr > getHeight()) return;








|







1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
    }

    RS2::LineType relativeZeroPenType = RS2::SolidLine;

    if (m_colorData->hideRelativeZero) relativeZeroPenType = RS2::NoPen;

    RS_Pen p(m_colorData->relativeZeroColor, RS2::Width00, relativeZeroPenType);
    p.setScreenWidth(1.0);
    painter->setPen(p);

    int const zr = relativeZeroRadius*2;
    auto vp = toGui(relativeZero);
    if (vp.x + zr < 0 || vp.x - zr > getWidth()) return;
    if (vp.y + zr < 0 || vp.y - zr > getHeight()) return;

1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
    int numX = graphic->getPagesNumHoriz();
    int numY = graphic->getPagesNumVert();

// gray background:
    painter->fillRect(0, 0, getWidth(), getHeight(),
                      printPreviewBackgroundColor);

// shadow:    
    painter->fillRect(paperX1 + 6, paperY1 + 6, paperW, paperH,
                      printPreviewBorderAndShadowColor);

// border:
    painter->fillRect(paperX1, paperY1, paperW, paperH,
                      printPreviewBorderAndShadowColor);

// paper:    
    painter->fillRect(paperX1 + 1, paperY1 - 1, paperW - 2, paperH + 2,
                      printPreviewPaperColor);

// print area:
    painter->fillRect(paperX1 + 1 + marginLeft, paperY1 - 1 - marginBottom,
                      printAreaW - 2, printAreaH + 2,
                      printPreviewPrintAreaColor);







|







|







1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
    int numX = graphic->getPagesNumHoriz();
    int numY = graphic->getPagesNumVert();

// gray background:
    painter->fillRect(0, 0, getWidth(), getHeight(),
                      printPreviewBackgroundColor);

// shadow:
    painter->fillRect(paperX1 + 6, paperY1 + 6, paperW, paperH,
                      printPreviewBorderAndShadowColor);

// border:
    painter->fillRect(paperX1, paperY1, paperW, paperH,
                      printPreviewBorderAndShadowColor);

// paper:
    painter->fillRect(paperX1 + 1, paperY1 - 1, paperW - 2, paperH + 2,
                      printPreviewPaperColor);

// print area:
    painter->fillRect(paperX1 + 1 + marginLeft, paperY1 - 1 - marginBottom,
                      printAreaW - 2, printAreaH + 2,
                      printPreviewPrintAreaColor);
2445
2446
2447
2448
2449
2450
2451









2452
2453
2454
2455
2456
2457
2458
RS2::EntityType RS_GraphicView::getTypeToSelect() const {
    return typeToSelect;
}

void RS_GraphicView::setTypeToSelect(RS2::EntityType mType) {
    typeToSelect = mType;
}










int RS_GraphicView::getMinRenderableTextHeightInPx() const {
    return minRenderableTextHeightInPx;
}

void RS_GraphicView::loadGridSettings() {
    if (grid != nullptr){







>
>
>
>
>
>
>
>
>







2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
RS2::EntityType RS_GraphicView::getTypeToSelect() const {
    return typeToSelect;
}

void RS_GraphicView::setTypeToSelect(RS2::EntityType mType) {
    typeToSelect = mType;
}

bool RS_GraphicView::getSimplifySmall() const {
  return simplifySmall;
}

bool RS_GraphicView::getSimplifyPanning() const {
  return simplifyPanning;
}


int RS_GraphicView::getMinRenderableTextHeightInPx() const {
    return minRenderableTextHeightInPx;
}

void RS_GraphicView::loadGridSettings() {
    if (grid != nullptr){

Changes to librecad/src/lib/gui/rs_graphicview.h.

377
378
379
380
381
382
383
384


385
386
387
388
389
390
391
    int getPointMode() const;
    int getPointSize() const;
    double getMinCircleDrawingRadius() const;
    double getMinArcDrawingRadius() const;
    double getMinEllipseMajorRadius() const;
    double getMinEllipseMinorRadius() const;
    double getMinLineDrawingLen() const;
    int getMinRenderableTextHeightInPx() const;


    void setHasNoGrid(bool hasNoGrid);
    bool isDraftLinesMode() const;
    void setDraftLinesMode(bool draftLinesMode);
    void setForcedActionKillAllowed(bool forcedActionKillAllowed);

    bool getPanOnZoom() const;
    bool getSkipFirstZoom() const;







|
>
>







377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
    int getPointMode() const;
    int getPointSize() const;
    double getMinCircleDrawingRadius() const;
    double getMinArcDrawingRadius() const;
    double getMinEllipseMajorRadius() const;
    double getMinEllipseMinorRadius() const;
    double getMinLineDrawingLen() const;
    int  getMinRenderableTextHeightInPx() const;
    bool getSimplifySmall() const;
    bool getSimplifyPanning() const;
    void setHasNoGrid(bool hasNoGrid);
    bool isDraftLinesMode() const;
    void setDraftLinesMode(bool draftLinesMode);
    void setForcedActionKillAllowed(bool forcedActionKillAllowed);

    bool getPanOnZoom() const;
    bool getSkipFirstZoom() const;
425
426
427
428
429
430
431


432
433

434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453

    bool extendAxisLines = false;
    int extendAxisModeX = 0;
    int extendAxisModeY = 0;
    int entityHandleHalfSize = 2;
    int relativeZeroRadius = 5;
    int zeroShortAxisMarkSize = 20;


    int minRenderableTextHeightInPx = 4;
    bool ignoreDraftForHighlight = false;

/**
  * Delete mode. If true, all drawing actions will delete in background color
  * instead.
  */
    bool deleteMode = false;
    LC_Rect view_rect;
    void drawEntityReferencePoints(RS_Painter *painter, const RS_Entity *e) const;
    void invalidate();

    // painting cached values

    double unitFactor;
    double unitFactor100;
    double defaultWidthFactor;
    double paperScale;
    // points rendering settings
    int pdmode;
    double pdsize;
    int screenPDSize;
#ifdef DEBUG_RENDERING







>
>


>











|
|







427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458

    bool extendAxisLines = false;
    int extendAxisModeX = 0;
    int extendAxisModeY = 0;
    int entityHandleHalfSize = 2;
    int relativeZeroRadius = 5;
    int zeroShortAxisMarkSize = 20;
    bool simplifySmall = true;
    bool simplifyPanning = true;
    int minRenderableTextHeightInPx = 4;
    bool ignoreDraftForHighlight = false;

/**
  * Delete mode. If true, all drawing actions will delete in background color
  * instead.
  */
    bool deleteMode = false;
    LC_Rect view_rect;
    void drawEntityReferencePoints(RS_Painter *painter, const RS_Entity *e) const;
    void invalidate();

    // painting cached values

    double unitFactor = 1.0;
    double unitFactor100 = 0.01;
    double defaultWidthFactor;
    double paperScale;
    // points rendering settings
    int pdmode;
    double pdsize;
    int screenPDSize;
#ifdef DEBUG_RENDERING
518
519
520
521
522
523
524

525
526
527
signals:
    void relative_zero_changed(const RS_Vector &);
    void previous_zoom_state(bool);
private:

    bool m_panOnZoom = false;
    bool m_skipFirstZoom = false;

};

#endif







>



523
524
525
526
527
528
529
530
531
532
533
signals:
    void relative_zero_changed(const RS_Vector &);
    void previous_zoom_state(bool);
private:

    bool m_panOnZoom = false;
    bool m_skipFirstZoom = false;
    bool m_modifyOnZoom = true;
};

#endif

Changes to librecad/src/lib/gui/rs_linetypepattern.cpp.

29
30
31
32
33
34
35




36
37
38
39
40
41
42
43
#include <map>

#include "rs_linetypepattern.h"

#include "rs.h"

namespace {




//define all line patterns in pixels
const RS_LineTypePattern patternSolidLine={10.0};

const RS_LineTypePattern patternDotLineTiny{{0.15, -1.}};
const RS_LineTypePattern patternDotLine{{0.2, -6.2}};
const RS_LineTypePattern patternDotLine2{{0.2, -3.1}};
const RS_LineTypePattern patternDotLineX2{{0.2, -12.4}};








>
>
>
>
|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <map>

#include "rs_linetypepattern.h"

#include "rs.h"

namespace {
// after the line pattern fixed, these patteds are defined in millimeters.
// It is another question how correct are these numbers bellow.
// For example - in my drawings, patternCenterSmall is too big and patternCenterTiny a
// little bit smaller than I need.

const RS_LineTypePattern patternSolidLine={10.0};

const RS_LineTypePattern patternDotLineTiny{{0.15, -1.}};
const RS_LineTypePattern patternDotLine{{0.2, -6.2}};
const RS_LineTypePattern patternDotLine2{{0.2, -3.1}};
const RS_LineTypePattern patternDotLineX2{{0.2, -12.4}};

Changes to librecad/src/lib/gui/rs_painter.cpp.

23
24
25
26
27
28
29

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

59
60
61
62
63
64
65
66
** This copyright notice MUST APPEAR in all copies of the script!
**
**********************************************************************/
#include<cmath>

#include<QPainterPath>
#include<QPolygon>


#include "dxf_format.h"
#include "rs_color.h"
#include "rs_spline.h"
#include "rs_polyline.h"
#include "rs_debug.h"
#include "rs_math.h"
#include "rs_painter.h"
#include "rs_graphicview.h"
#include "rs_linetypepattern.h"
#include "rs_arc.h"
#include "rs_ellipse.h"
#include "rs_circle.h"


namespace {
// Convert from LibreCAD line style pattern to QPen Dash Pattern.
// QPen dash pattern by default is in the unit of pixel
    QVector<qreal> rsToQDashPattern(const RS2::LineType &t, double screenWidth, double dpmm, double &newDashOffset) {
        // dash pattern is in mm
        // d*dpmm/screenWidth, so, the scaling factor k = dpmm/screenWidth
        dpmm = std::max(dpmm, 1e-6);
        double k = dpmm / std::max(screenWidth, 1.);

        const std::vector<double> &pattern = RS_LineTypePattern::getPattern(t)->pattern;
        QVector<qreal> dashPattern;
        std::transform(pattern.cbegin(), pattern.cend(), std::back_inserter(dashPattern), [k](double d) {
            return std::max(k * std::abs(d), 1.);
        });

        dashPattern.resize(dashPattern.size() - dashPattern.size() % 2);

        newDashOffset = newDashOffset * k;
        return dashPattern;
    }

/**
 * Wrapper for Qt







>


















|

|
<
|






>
|







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
** This copyright notice MUST APPEAR in all copies of the script!
**
**********************************************************************/
#include<cmath>

#include<QPainterPath>
#include<QPolygon>
#include <cstdio>

#include "dxf_format.h"
#include "rs_color.h"
#include "rs_spline.h"
#include "rs_polyline.h"
#include "rs_debug.h"
#include "rs_math.h"
#include "rs_painter.h"
#include "rs_graphicview.h"
#include "rs_linetypepattern.h"
#include "rs_arc.h"
#include "rs_ellipse.h"
#include "rs_circle.h"


namespace {
// Convert from LibreCAD line style pattern to QPen Dash Pattern.
// QPen dash pattern by default is in the unit of pixel
    QVector<qreal> rsToQDashPattern(const RS2::LineType &t, double k, double &newDashOffset) {
        // dash pattern is in mm
        // Qt dash pattern is in line width units.

        // k == 1/linewidth[mm]

        const std::vector<double> &pattern = RS_LineTypePattern::getPattern(t)->pattern;
        QVector<qreal> dashPattern;
        std::transform(pattern.cbegin(), pattern.cend(), std::back_inserter(dashPattern), [k](double d) {
            return std::max(k * std::abs(d), 1.);
        });

        dashPattern.resize(dashPattern.size() - dashPattern.size() % 2); // do we really need this?

        newDashOffset = newDashOffset * k;
        return dashPattern;
    }

/**
 * Wrapper for Qt
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
        restore();
    }
}


void RS_Painter::createSolidFillPath(QPainterPath &path, const RS_GraphicView *view,   QList<RS_Entity *> entities)  {
        foreach (auto l, entities) {
            if (l->rtti()==RS2::EntityContainer) {
                auto* loop = (RS_EntityContainer*)l;
                QPainterPath loopPath;
                // edges:
//                LC_ERR << "loop------------------------------- " << loop->count();
                for(auto e: *loop){
                    switch (e->rtti()) {
                        case RS2::EntityLine: {







|







278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
        restore();
    }
}


void RS_Painter::createSolidFillPath(QPainterPath &path, const RS_GraphicView *view,   QList<RS_Entity *> entities)  {
        foreach (auto l, entities) {
            if (l->isContainer()) {
                auto* loop = (RS_EntityContainer*)l;
                QPainterPath loopPath;
                // edges:
//                LC_ERR << "loop------------------------------- " << loop->count();
                for(auto e: *loop){
                    switch (e->rtti()) {
                        case RS2::EntityLine: {
687
688
689
690
691
692
693








694
695
696











697
698
699

700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
    }

    pColor.setAlphaF(pen.getAlpha());
    RS2::LineType lineType = pen.getLineType();
    Qt::PenStyle style = rsToQtLineType(lineType);

    double screenWidth = pen.getScreenWidth();








    if (style == Qt::CustomDashLine){
        double newDashOffset = pen.dashOffset();
        auto dashPattern = rsToQDashPattern(lineType,











                                            screenWidth/*p.widthF()*/,
                                            getDpmmCached(),
                                            newDashOffset);

        if (dashPattern.isEmpty()) {
            style = Qt::SolidLine;
        } else {
            QPen p(pColor, screenWidth, style);
            p.setDashPattern(std::move(dashPattern));
            // fixme - how this is related to RS_AtomicEntity::updateDashOffset??? Will we set dash offset twice?
            p.setDashOffset(newDashOffset);
            p.setJoinStyle(penJoinStyle);
            p.setCapStyle(penCapStyle);
            lastUsedPen = p;
            QPainter::setPen(p);
            return;
        }
    }
    // processing solid line

    bool changed = false;
    if (lastUsedPen.color() != pColor){
        lastUsedPen.setColor(pColor);
        changed = true;
    }
    if (lastUsedPen.widthF() != screenWidth){
        lastUsedPen.setWidthF(screenWidth);
        changed = true;
    }
    if (lastUsedPen.style() != style){
        lastUsedPen.setStyle(style);
        changed = true;
    }
    lastUsedPen.setJoinStyle(penJoinStyle);







>
>
>
>
>
>
>
>


|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
>



|

















|
|







688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
    }

    pColor.setAlphaF(pen.getAlpha());
    RS2::LineType lineType = pen.getLineType();
    Qt::PenStyle style = rsToQtLineType(lineType);

    double screenWidth = pen.getScreenWidth();
    double swpx;

    if (screenWidth < 1.0) {
        swpx = 0.0;
    } else {
        swpx = screenWidth;
    }

    if (style == Qt::CustomDashLine){
        double newDashOffset = pen.dashOffset();

        double k = pen.getWidth();

        if (k <= 0.0) {
            k = 1.0;
        } else {
            k = 100.0/k;
        }

        k = k * pen.getScale();

        if ((screenWidth < 1.0) && (screenWidth > RS_TOLERANCE) )
          k = k*screenWidth;

        auto dashPattern = rsToQDashPattern(lineType, k, newDashOffset);

        if (dashPattern.isEmpty()) {
            style = Qt::SolidLine;
        } else {
            QPen p(pColor, swpx, style);
            p.setDashPattern(std::move(dashPattern));
            // fixme - how this is related to RS_AtomicEntity::updateDashOffset??? Will we set dash offset twice?
            p.setDashOffset(newDashOffset);
            p.setJoinStyle(penJoinStyle);
            p.setCapStyle(penCapStyle);
            lastUsedPen = p;
            QPainter::setPen(p);
            return;
        }
    }
    // processing solid line

    bool changed = false;
    if (lastUsedPen.color() != pColor){
        lastUsedPen.setColor(pColor);
        changed = true;
    }
    if (lastUsedPen.widthF() != swpx){
        lastUsedPen.setWidthF(swpx);
        changed = true;
    }
    if (lastUsedPen.style() != style){
        lastUsedPen.setStyle(style);
        changed = true;
    }
    lastUsedPen.setJoinStyle(penJoinStyle);

Changes to librecad/src/main/doc_plugin_interface.cpp.

26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42

43
44
45
46
47
48
49

#include <QEventLoop>
#include <QList>
#include <QInputDialog>
#include <QFileInfo>

#include "doc_plugin_interface.h"

#include "intern/qc_actiongetent.h"
#include "intern/qc_actiongetpoint.h"
#include "intern/qc_actiongetselect.h"
#include "lc_splinepoints.h"
#include "lc_undosection.h"
#include "rs_actioninterface.h"
#include "rs_arc.h"
#include "rs_block.h"
#include "rs_circle.h"
#include "rs_debug.h"

#include "rs_ellipse.h"
#include "rs_eventhandler.h"
#include "rs_graphicview.h"
#include "rs_image.h"
#include "rs_insert.h"
#include "rs_layer.h"
#include "rs_line.h"







>










>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

#include <QEventLoop>
#include <QList>
#include <QInputDialog>
#include <QFileInfo>

#include "doc_plugin_interface.h"
#include "document_interface.h"
#include "intern/qc_actiongetent.h"
#include "intern/qc_actiongetpoint.h"
#include "intern/qc_actiongetselect.h"
#include "lc_splinepoints.h"
#include "lc_undosection.h"
#include "rs_actioninterface.h"
#include "rs_arc.h"
#include "rs_block.h"
#include "rs_circle.h"
#include "rs_debug.h"
#include "rs_dimension.h"
#include "rs_ellipse.h"
#include "rs_eventhandler.h"
#include "rs_graphicview.h"
#include "rs_image.h"
#include "rs_insert.h"
#include "rs_layer.h"
#include "rs_line.h"
353
354
355
356
357
358
359


360
361
362


363
364
365


366
367
368


369
370
371


372
373
374
375
376
377
378
        data->insert(DPI::CLOSEPOLY, static_cast<RS_Polyline*>(entity)->isClosed() );
        break;
    case RS2::EntityVertex:
        data->insert(DPI::ETYPE, DPI::UNKNOWN);
        break;
    case RS2::EntityDimAligned:
        data->insert(DPI::ETYPE, DPI::DIMALIGNED);


        break;
    case RS2::EntityDimLinear:
        data->insert(DPI::ETYPE, DPI::DIMLINEAR);


        break;
    case RS2::EntityDimRadial:
        data->insert(DPI::ETYPE, DPI::DIMRADIAL);


        break;
    case RS2::EntityDimDiametric:
        data->insert(DPI::ETYPE, DPI::DIMDIAMETRIC);


        break;
    case RS2::EntityDimAngular:
        data->insert(DPI::ETYPE, DPI::DIMANGULAR);


        break;
    case RS2::EntityDimLeader:
        data->insert(DPI::ETYPE, DPI::DIMLEADER);
        break;
    case RS2::EntityUnknown:
    default:
        data->insert(DPI::ETYPE, DPI::UNKNOWN);







>
>



>
>



>
>



>
>



>
>







355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
        data->insert(DPI::CLOSEPOLY, static_cast<RS_Polyline*>(entity)->isClosed() );
        break;
    case RS2::EntityVertex:
        data->insert(DPI::ETYPE, DPI::UNKNOWN);
        break;
    case RS2::EntityDimAligned:
        data->insert(DPI::ETYPE, DPI::DIMALIGNED);
        data->insert(DPI::TEXTCONTENT, static_cast<RS_Dimension*>(entity)->getLabel(false));
        data->insert(DPI::SIZEU, static_cast<RS_Dimension*>(entity)->getMeasuredLabel().toDouble());
        break;
    case RS2::EntityDimLinear:
        data->insert(DPI::ETYPE, DPI::DIMLINEAR);
        data->insert(DPI::TEXTCONTENT, static_cast<RS_Dimension*>(entity)->getLabel(false));
        data->insert(DPI::SIZEU, static_cast<RS_Dimension*>(entity)->getMeasuredLabel().toDouble());
        break;
    case RS2::EntityDimRadial:
        data->insert(DPI::ETYPE, DPI::DIMRADIAL);
        data->insert(DPI::TEXTCONTENT, static_cast<RS_Dimension*>(entity)->getLabel(false));
        data->insert(DPI::SIZEU, static_cast<RS_Dimension*>(entity)->getMeasuredLabel().toDouble());
        break;
    case RS2::EntityDimDiametric:
        data->insert(DPI::ETYPE, DPI::DIMDIAMETRIC);
        data->insert(DPI::TEXTCONTENT, static_cast<RS_Dimension*>(entity)->getLabel(false));
        data->insert(DPI::SIZEU, static_cast<RS_Dimension*>(entity)->getMeasuredLabel().toDouble());
        break;
    case RS2::EntityDimAngular:
        data->insert(DPI::ETYPE, DPI::DIMANGULAR);
        data->insert(DPI::TEXTCONTENT, static_cast<RS_Dimension*>(entity)->getLabel(false));
        data->insert(DPI::SIZEU, static_cast<RS_Dimension*>(entity)->getMeasuredLabel().toDouble());
        break;
    case RS2::EntityDimLeader:
        data->insert(DPI::ETYPE, DPI::DIMLEADER);
        break;
    case RS2::EntityUnknown:
    default:
        data->insert(DPI::ETYPE, DPI::UNKNOWN);
617
618
619
620
621
622
623



624
625



626
627



628
629



630
631



632
633
634
635
636
637
638
        }else{
            pl->setClosed(false);
        }
        break;}
    case RS2::EntityVertex:
        break;
    case RS2::EntityDimAligned:



        break;
    case RS2::EntityDimLinear:



        break;
    case RS2::EntityDimRadial:



        break;
    case RS2::EntityDimDiametric:



        break;
    case RS2::EntityDimAngular:



        break;
    case RS2::EntityDimLeader:
        break;
    case RS2::EntityUnknown:
    default:
        break;
    }







>
>
>


>
>
>


>
>
>


>
>
>


>
>
>







629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
        }else{
            pl->setClosed(false);
        }
        break;}
    case RS2::EntityVertex:
        break;
    case RS2::EntityDimAligned:
        if (hash.contains(DPI::TEXTCONTENT)) {
           static_cast<RS_Dimension*>(ec)->setLabel(hash.take(DPI::TEXTCONTENT).toString());
        }
        break;
    case RS2::EntityDimLinear:
        if (hash.contains(DPI::TEXTCONTENT)) {
            static_cast<RS_Dimension*>(ec)->setLabel(hash.take(DPI::TEXTCONTENT).toString());
        }
        break;
    case RS2::EntityDimRadial:
        if (hash.contains(DPI::TEXTCONTENT)) {
            static_cast<RS_Dimension*>(ec)->setLabel(hash.take(DPI::TEXTCONTENT).toString());
        }
        break;
    case RS2::EntityDimDiametric:
        if (hash.contains(DPI::TEXTCONTENT)) {
            static_cast<RS_Dimension*>(ec)->setLabel(hash.take(DPI::TEXTCONTENT).toString());
        }
        break;
    case RS2::EntityDimAngular:
        if (hash.contains(DPI::TEXTCONTENT)) {
            static_cast<RS_Dimension*>(ec)->setLabel(hash.take(DPI::TEXTCONTENT).toString());
        }
        break;
    case RS2::EntityDimLeader:
        break;
    case RS2::EntityUnknown:
    default:
        break;
    }

Changes to librecad/src/main/main.cpp.

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
 * Main. Creates Application window.
 */
 // fixme - sand - refactor and split to several specialized functions
int main(int argc, char** argv)
{
    QT_REQUIRE_VERSION(argc, argv, "5.2.1");

    // Check first two arguments in order to decide if we want to run librecad
    // as console dxf2pdf or dxf2png tools. On Linux we can create a link to
    // librecad executable and  name it dxf2pdf. So, we can run either:
    //
    //     librecad dxf2pdf [options] ...
    //
    // or just:
    //
    //     dxf2pdf [options] ...
    //
    for (int i = 0; i < qMin(argc, 2); i++) {
        QString arg(argv[i]);
        if (i == 0) {
            arg = QFileInfo(QFile::decodeName(argv[i])).baseName();
        }
        if (arg.compare("dxf2pdf") == 0) {
            return console_dxf2pdf(argc, argv);
        }
        if (arg.compare("dxf2png") == 0 || arg == "dxf2svg") {
            return console_dxf2png(argc, argv);
        }
    }

    RS_DEBUG->setLevel(RS_Debug::D_WARNING);

    LC_Application app(argc, argv);
    QCoreApplication::setOrganizationName("LibreCAD");
    QCoreApplication::setApplicationName("LibreCAD");
    QCoreApplication::setApplicationVersion(XSTR(LC_VERSION));

    RS_Settings::init(app.organizationName(), app.applicationName());

#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0))
    QGuiApplication::setDesktopFileName("librecad.desktop");
#endif

    QSettings settings; // fixme - direct invocation of settings

    bool first_load = settings.value("Startup/FirstLoad", 1).toBool();

    const QString lpDebugSwitch0("-d"),lpDebugSwitch1("--debug") ;
    const QString help0("-h"), help1("--help");
    bool allowOptions=true;
    QList<int> argClean;
    for (int i=0; i<argc; i++)
    {
        QString argstr(argv[i]);
        if(allowOptions&&QString::compare("--", argstr)==0)
        {
            allowOptions=false;
            continue;
        }
        if (allowOptions && (help0.compare(argstr, Qt::CaseInsensitive)==0 ||
                             help1.compare(argstr, Qt::CaseInsensitive)==0 ))
        {
            qDebug()<<"Usage: librecad [command] <options> <dxf file>";
            qDebug()<<"";
            qDebug()<<"Commands:";
            qDebug()<<"";
            qDebug()<<"  dxf2pdf\tRun librecad as console dxf2pdf tool. Use -h for help.";
            qDebug()<<"  dxf2png\tRun librecad as console dxf2png tool. Use -h for help.";







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














|







60
61
62
63
64
65
66























67















68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 * Main. Creates Application window.
 */
 // fixme - sand - refactor and split to several specialized functions
int main(int argc, char** argv)
{
    QT_REQUIRE_VERSION(argc, argv, "5.2.1");
























    RS_DEBUG->setLevel(RS_Debug::D_NOTHING);
















    const QString lpDebugSwitch0("-d"),lpDebugSwitch1("--debug") ;
    const QString help0("-h"), help1("--help");
    bool allowOptions=true;
    QList<int> argClean;
    for (int i=0; i<argc; i++)
    {
        QString argstr(argv[i]);
        if(allowOptions&&QString::compare("--", argstr)==0)
        {
            allowOptions=false;
            continue;
        }
        if (allowOptions && (help0.compare(argstr, Qt::CaseInsensitive)==0 ||
            help1.compare(argstr, Qt::CaseInsensitive)==0 ))
        {
            qDebug()<<"Usage: librecad [command] <options> <dxf file>";
            qDebug()<<"";
            qDebug()<<"Commands:";
            qDebug()<<"";
            qDebug()<<"  dxf2pdf\tRun librecad as console dxf2pdf tool. Use -h for help.";
            qDebug()<<"  dxf2png\tRun librecad as console dxf2png tool. Use -h for help.";
139
140
141
142
143
144
145
146
147
148
149
150
151

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
            RS_DEBUG->print( RS_Debug::D_NOTHING, "    %d Warning", RS_Debug::D_WARNING);
            RS_DEBUG->print( RS_Debug::D_NOTHING, "    %d Notice", RS_Debug::D_NOTICE);
            RS_DEBUG->print( RS_Debug::D_NOTHING, "    %d Informational", RS_Debug::D_INFORMATIONAL);
            RS_DEBUG->print( RS_Debug::D_NOTHING, "    %d Debugging", RS_Debug::D_DEBUGGING);
            exit(0);
        }
        if (allowOptions&& (argstr.startsWith(lpDebugSwitch0, Qt::CaseInsensitive) ||
                             argstr.startsWith(lpDebugSwitch1, Qt::CaseInsensitive) )){
            argClean<<i;

            // to control the level of debugging output use --debug with level 0-6, e.g. --debug3
            // for a list of debug levels use --debug?
            // if no level follows, the debugging level is set

            argstr.remove(QRegularExpression("^"+lpDebugSwitch0));
            argstr.remove(QRegularExpression("^"+lpDebugSwitch1));
            char level;
            if(argstr.size()==0){
                if(i+1<argc){
                    if(QRegularExpression(R"(\d*)").match(argv[i+1]).hasMatch()){
                        ++i;
                        qDebug()<<"reading "<<argv[i]<<" as debugging level";
                        level=argv[i][0];
                        argClean<<i;
                    }
                    else {
                        level = '3';
                    }
                }
                else {
                    level = '3'; //default to D_WARNING
                }
            }
            else {
                level = argstr.toStdString()[0];
            }

            switch(level){
                case '?' : {
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "possible debug levels:");
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Nothing", RS_Debug::D_NOTHING);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Critical", RS_Debug::D_CRITICAL);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Error", RS_Debug::D_ERROR);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Warning", RS_Debug::D_WARNING);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Notice", RS_Debug::D_NOTICE);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Informational", RS_Debug::D_INFORMATIONAL);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Debugging", RS_Debug::D_DEBUGGING);
                    return false;
                }
                case '0' + RS_Debug::D_NOTHING : {
                    RS_DEBUG->setLevel(RS_Debug::D_NOTHING);
                    break;
                }
                case '0' + RS_Debug::D_CRITICAL : {
                    RS_DEBUG->setLevel(RS_Debug::D_CRITICAL);







|


|
|
|
>
|
|
|
|
|
|

<


|



|



|














|







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
            RS_DEBUG->print( RS_Debug::D_NOTHING, "    %d Warning", RS_Debug::D_WARNING);
            RS_DEBUG->print( RS_Debug::D_NOTHING, "    %d Notice", RS_Debug::D_NOTICE);
            RS_DEBUG->print( RS_Debug::D_NOTHING, "    %d Informational", RS_Debug::D_INFORMATIONAL);
            RS_DEBUG->print( RS_Debug::D_NOTHING, "    %d Debugging", RS_Debug::D_DEBUGGING);
            exit(0);
        }
        if (allowOptions&& (argstr.startsWith(lpDebugSwitch0, Qt::CaseInsensitive) ||
            argstr.startsWith(lpDebugSwitch1, Qt::CaseInsensitive) )){
            argClean<<i;

        // to control the level of debugging output use --debug with level 0-6, e.g. --debug3
        // for a list of debug levels use --debug?
        // if no level follows, the debugging level is set

        argstr.remove(QRegularExpression("^"+lpDebugSwitch0));
        argstr.remove(QRegularExpression("^"+lpDebugSwitch1));
        char level;
        if(argstr.size()==0){
            if(i+1<argc){
                if(QRegularExpression(R"(\d*)").match(argv[i+1]).hasMatch()){
                        ++i;

                        level=argv[i][0];
                        argClean<<i;
                }
                    else {
                        level = '3';
                    }
            }
                else {
                    level = '3'; //default to D_WARNING
                }
        }
            else {
                level = argstr.toStdString()[0];
            }

            switch(level){
                case '?' : {
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "possible debug levels:");
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Nothing", RS_Debug::D_NOTHING);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Critical", RS_Debug::D_CRITICAL);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Error", RS_Debug::D_ERROR);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Warning", RS_Debug::D_WARNING);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Notice", RS_Debug::D_NOTICE);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Informational", RS_Debug::D_INFORMATIONAL);
                    RS_DEBUG->print(RS_Debug::D_NOTHING, "    %d Debugging", RS_Debug::D_DEBUGGING);
                    return 0;
                }
                case '0' + RS_Debug::D_NOTHING : {
                    RS_DEBUG->setLevel(RS_Debug::D_NOTHING);
                    break;
                }
                case '0' + RS_Debug::D_CRITICAL : {
                    RS_DEBUG->setLevel(RS_Debug::D_CRITICAL);
214
215
216
217
218
219
220
221
222









































223
224
225
226
227
228
229
                }
                default : {
                    RS_DEBUG->setLevel(RS_Debug::D_DEBUGGING);
                    break;
                }
            }

        }
    }









































    RS_DEBUG->print("param 0: %s", argv[0]);

    QFileInfo prgInfo( QFile::decodeName(argv[0]) );
    QString prgDir(prgInfo.absolutePath());

    RS_SYSTEM->init(app.applicationName(), app.applicationVersion(), XSTR(QC_APPDIR), prgDir);








|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
                }
                default : {
                    RS_DEBUG->setLevel(RS_Debug::D_DEBUGGING);
                    break;
                }
            }

            }
    }


    // Check first two arguments in order to decide if we want to run librecad
    // as console dxf2pdf or dxf2png tools. On Linux we can create a link to
    // librecad executable and  name it dxf2pdf. So, we can run either:
    //
    //     librecad dxf2pdf [options] ...
    //
    // or just:
    //
    //     dxf2pdf [options] ...
    //
    for (int i = 0; i < qMin(argc, 2); i++) {
        QString arg(argv[i]);
        if (i == 0) {
            arg = QFileInfo(QFile::decodeName(argv[i])).baseName();
        }
        if (arg.compare("dxf2pdf") == 0) {
            return console_dxf2pdf(argc, argv);
        }
        if (arg.compare("dxf2png") == 0 || arg == "dxf2svg") {
            return console_dxf2png(argc, argv);
        }
    }


    LC_Application app(argc, argv);
    QCoreApplication::setOrganizationName("LibreCAD");
    QCoreApplication::setApplicationName("LibreCAD");
    QCoreApplication::setApplicationVersion(XSTR(LC_VERSION));

    RS_Settings::init(app.organizationName(), app.applicationName());

#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0))
    QGuiApplication::setDesktopFileName("librecad");
#endif

    QSettings settings; // fixme - direct invocation of settings

    bool first_load = settings.value("Startup/FirstLoad", 1).toBool();

    RS_DEBUG->print("param 0: %s", argv[0]);

    QFileInfo prgInfo( QFile::decodeName(argv[0]) );
    QString prgDir(prgInfo.absolutePath());

    RS_SYSTEM->init(app.applicationName(), app.applicationVersion(), XSTR(QC_APPDIR), prgDir);

Changes to librecad/src/plugins/qc_plugininterface.h.

24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39
40
41
42



43
44
45
46


47
48
49
50
51
52
53
**
**********************************************************************/

#ifndef QC_PLUGININTERFACE_H
#define QC_PLUGININTERFACE_H

#include <QtPlugin>


class Document_Interface;

/**
  * Menu locations for Plugins
  */
class PluginMenuLocation
{
    public:
        PluginMenuLocation(QString menuEntryPoint, QString menuEntryActionName) {
            this->menuEntryActionName=menuEntryActionName;
            this->menuEntryPoint=menuEntryPoint;



        }

    QString menuEntryPoint;
    QString menuEntryActionName;


};

class PluginCapabilities {
    public:
        QList<PluginMenuLocation> menuEntryPoints;
        QList<int> paintEventPriorities;    // if set, this plugin will get it's paintEvent function called
                                        // lower numbers are drawn first







>









|


>
>
>




>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
**
**********************************************************************/

#ifndef QC_PLUGININTERFACE_H
#define QC_PLUGININTERFACE_H

#include <QtPlugin>
#include <qcontainerfwd.h>

class Document_Interface;

/**
  * Menu locations for Plugins
  */
class PluginMenuLocation
{
    public:
        PluginMenuLocation(QString menuEntryPoint, QString menuEntryActionName, QString menuEntryCmd="", QString menuEntryKey="") {
            this->menuEntryActionName=menuEntryActionName;
            this->menuEntryPoint=menuEntryPoint;
            this->menuEntryCmd=menuEntryCmd;
            this->menuEntryKey=menuEntryKey;

        }

    QString menuEntryPoint;
    QString menuEntryActionName;
    QString menuEntryCmd;
    QString menuEntryKey;
};

class PluginCapabilities {
    public:
        QList<PluginMenuLocation> menuEntryPoints;
        QList<int> paintEventPriorities;    // if set, this plugin will get it's paintEvent function called
                                        // lower numbers are drawn first

Changes to librecad/src/ui/action_options/insert/qg_insertoptions.cpp.

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
}

void QG_InsertOptions::onAngleEditingFinished(){
    setAngleToActionAndView(ui->leAngle->text());
}

void QG_InsertOptions::onFactorEditingFinished(){
    setAngleToActionAndView(ui->leFactor->text());
}

void QG_InsertOptions::onColumnSpacingEditingFinished() {
    setColumnSpacingActionAndView(ui->leColumnSpacing->text());
}

void QG_InsertOptions::onRowSpacingEditingFinished() {







|







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
}

void QG_InsertOptions::onAngleEditingFinished(){
    setAngleToActionAndView(ui->leAngle->text());
}

void QG_InsertOptions::onFactorEditingFinished(){
    setFactorToActionAndView(ui->leFactor->text());
}

void QG_InsertOptions::onColumnSpacingEditingFinished() {
    setColumnSpacingActionAndView(ui->leColumnSpacing->text());
}

void QG_InsertOptions::onRowSpacingEditingFinished() {

Changes to librecad/src/ui/dialogs/settings/options_general/qg_dlgoptionsgeneral.cpp.

299
300
301
302
303
304
305


306
307
308
309
310






311
312
313
314
315
316
317

        checked = LC_GET_BOOL("PanOnZoom", false);
        cbPanOnWheelZoom->setChecked(checked);

        checked = LC_GET_BOOL("FirstTimeNoZoom", false);
        cbFirstTimeNoZoom->setChecked(checked);



    }
    LC_GROUP_END();

    LC_GROUP("Render");
    {






        int minTextHeight = LC_GET_INT("MinRenderableTextHeightPx", 4);
        sbTextMinHeight->setValue(minTextHeight);

        int minArcRadius100 = LC_GET_INT("MinArcRadius", 80);
        double minArcRadius = minArcRadius100 / 100.0;
        sbRenderMinArcRadius->setValue(minArcRadius);








>
>





>
>
>
>
>
>







299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325

        checked = LC_GET_BOOL("PanOnZoom", false);
        cbPanOnWheelZoom->setChecked(checked);

        checked = LC_GET_BOOL("FirstTimeNoZoom", false);
        cbFirstTimeNoZoom->setChecked(checked);

        checked = LC_GET_BOOL("ModifyOnViewChange", true);
        cbModifyOnView->setChecked(checked);
    }
    LC_GROUP_END();

    LC_GROUP("Render");
    {
        bool checked = LC_GET_BOOL("SimplifyPanning", true);
        cbSimplifyPanning->setChecked(checked);

        checked = LC_GET_BOOL("SimplifySmall", true);
        cbSimplifySmall->setChecked(checked);

        int minTextHeight = LC_GET_INT("MinRenderableTextHeightPx", 4);
        sbTextMinHeight->setValue(minTextHeight);

        int minArcRadius100 = LC_GET_INT("MinArcRadius", 80);
        double minArcRadius = minArcRadius100 / 100.0;
        sbRenderMinArcRadius->setValue(minArcRadius);

564
565
566
567
568
569
570

571
572
573
574
575


576
577
578
579
580
581
582
            LC_SET("ShowCloseButtonActiveOnly", cbTabCloseButtonMode->currentIndex() == 1);

            LC_SET("ShowActionIconInOptions", cbShowCurrentActionIconInOptions->isChecked());
            LC_SET("ShowEntityIDs", cbShowEntityIDs->isChecked());

            LC_SET("PanOnZoom", cbPanOnWheelZoom->isChecked());
            LC_SET("FirstTimeNoZoom", cbFirstTimeNoZoom->isChecked());

        }
        LC_GROUP_END();

        LC_GROUP("Render");
        {


            LC_SET("MinRenderableTextHeightPx", sbTextMinHeight->value());
            LC_SET("MinArcRadius", (int)(sbRenderMinArcRadius->value()*100));
            LC_SET("MinCircleRadius", (int)(sbRenderMinCircleRadius->value()*100));
            LC_SET("MinLineLen", (int)(sbRenderMinLineLen->value()*100));
            LC_SET("MinEllipseMajor", (int)(sbRenderMinEllipseMajor->value()*100));
            LC_SET("MinEllipseMinor", (int)(sbRenderMinEllipseMinor->value()*100));
        }







>





>
>







572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
            LC_SET("ShowCloseButtonActiveOnly", cbTabCloseButtonMode->currentIndex() == 1);

            LC_SET("ShowActionIconInOptions", cbShowCurrentActionIconInOptions->isChecked());
            LC_SET("ShowEntityIDs", cbShowEntityIDs->isChecked());

            LC_SET("PanOnZoom", cbPanOnWheelZoom->isChecked());
            LC_SET("FirstTimeNoZoom", cbFirstTimeNoZoom->isChecked());
            LC_SET("ModifyOnViewChange", cbModifyOnView->isChecked());
        }
        LC_GROUP_END();

        LC_GROUP("Render");
        {
            LC_SET("SimplifySmall", cbSimplifySmall->isChecked());
            LC_SET("SimplifyPanning", cbSimplifyPanning->isChecked());
            LC_SET("MinRenderableTextHeightPx", sbTextMinHeight->value());
            LC_SET("MinArcRadius", (int)(sbRenderMinArcRadius->value()*100));
            LC_SET("MinCircleRadius", (int)(sbRenderMinCircleRadius->value()*100));
            LC_SET("MinLineLen", (int)(sbRenderMinLineLen->value()*100));
            LC_SET("MinEllipseMajor", (int)(sbRenderMinEllipseMajor->value()*100));
            LC_SET("MinEllipseMinor", (int)(sbRenderMinEllipseMinor->value()*100));
        }

Changes to librecad/src/ui/dialogs/settings/options_general/qg_dlgoptionsgeneral.ui.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>QG_DlgOptionsGeneral</class>
 <widget class="QDialog" name="QG_DlgOptionsGeneral">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>730</width>
    <height>636</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>Application Preferences</string>
  </property>
  <property name="sizeGripEnabled">
   <bool>true</bool>








|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>QG_DlgOptionsGeneral</class>
 <widget class="QDialog" name="QG_DlgOptionsGeneral">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>797</width>
    <height>677</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>Application Preferences</string>
  </property>
  <property name="sizeGripEnabled">
   <bool>true</bool>
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
     </property>
    </widget>
   </item>
   <item row="0" column="0">
    <widget class="QTabWidget" name="tabWidget">
     <property name="currentIndex">
      <number>3</number>
     </property>
     <widget class="QWidget" name="tabAppearance">
      <attribute name="title">
       <string>&amp;Graphic View</string>
      </attribute>
      <layout class="QGridLayout" name="gridLayout_6">
       <item row="0" column="2">







|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
     </property>
    </widget>
   </item>
   <item row="0" column="0">
    <widget class="QTabWidget" name="tabWidget">
     <property name="currentIndex">
      <number>0</number>
     </property>
     <widget class="QWidget" name="tabAppearance">
      <attribute name="title">
       <string>&amp;Graphic View</string>
      </attribute>
      <layout class="QGridLayout" name="gridLayout_6">
       <item row="0" column="2">
1009
1010
1011
1012
1013
1014
1015







1016
1017
1018
1019
1020
1021
1022
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="text">
             <string>First time only pan</string>
            </property>
           </widget>







          </item>
         </layout>
        </widget>
       </item>
       <item row="2" column="0">
        <spacer name="verticalSpacer_7">
         <property name="orientation">







>
>
>
>
>
>
>







1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="text">
             <string>First time only pan</string>
            </property>
           </widget>
          </item>
          <item row="10" column="0">
           <widget class="QCheckBox" name="cbModifyOnView">
            <property name="text">
             <string>View change modifies the document</string>
            </property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item row="2" column="0">
        <spacer name="verticalSpacer_7">
         <property name="orientation">
3168
3169
3170
3171
3172
3173
3174
3175



















































3176
3177
3178
3179
3180
3181
3182
       </item>
       <item row="2" column="0">
        <widget class="QGroupBox" name="groupBox_14">
         <property name="title">
          <string>Rendering Minimums</string>
         </property>
         <layout class="QGridLayout" name="gridLayout_27">
          <item row="0" column="2">



















































           <widget class="QSpinBox" name="sbTextMinHeight">
            <property name="toolTip">
             <string>If height of text line on the screen is less than specified pixels, placholder will be drawn instead of text</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
       </item>
       <item row="2" column="0">
        <widget class="QGroupBox" name="groupBox_14">
         <property name="title">
          <string>Rendering Minimums</string>
         </property>
         <layout class="QGridLayout" name="gridLayout_27">
          <item row="3" column="0">
           <widget class="QLabel" name="label_13">
            <property name="text">
             <string>Line length:</string>
            </property>
           </widget>
          </item>
          <item row="4" column="3">
           <widget class="QLabel" name="label_17">
            <property name="text">
             <string>Ellipse Major Axis:</string>
            </property>
           </widget>
          </item>
          <item row="2" column="0">
           <widget class="QLabel" name="label_2">
            <property name="text">
             <string>Height of text line:</string>
            </property>
           </widget>
          </item>
          <item row="4" column="0">
           <widget class="QLabel" name="label_16">
            <property name="text">
             <string>Ellipse Minor Axis:</string>
            </property>
           </widget>
          </item>
          <item row="2" column="3">
           <widget class="QLabel" name="label_14">
            <property name="text">
             <string>Arc Radius:</string>
            </property>
           </widget>
          </item>
          <item row="2" column="4">
           <widget class="QDoubleSpinBox" name="sbRenderMinArcRadius">
            <property name="toolTip">
             <string>If screen radius of arc is less than value, arc is drawn as point</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="2" column="2">
           <widget class="QSpinBox" name="sbTextMinHeight">
            <property name="toolTip">
             <string>If height of text line on the screen is less than specified pixels, placholder will be drawn instead of text</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
















3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
             <number>15</number>
            </property>
            <property name="singleStep">
             <number>1</number>
            </property>
           </widget>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="label_13">
            <property name="text">
             <string>Line length:</string>
            </property>
           </widget>
          </item>
          <item row="0" column="0">
           <widget class="QLabel" name="label_2">
            <property name="text">
             <string>Height of text line:</string>
            </property>
           </widget>
          </item>
          <item row="2" column="3">
           <widget class="QLabel" name="label_17">
            <property name="text">
             <string>Ellipse Major Axis:</string>
            </property>
           </widget>
          </item>
          <item row="2" column="4">
           <widget class="QDoubleSpinBox" name="sbRenderMinEllipseMinor">
            <property name="toolTip">
             <string>If screen size of minor ellipse axis is less than value, ellipse is drawn as line</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="1" column="2">
           <widget class="QDoubleSpinBox" name="sbRenderMinLineLen">
            <property name="toolTip">
             <string>If screen length of line is less than value, the line is drawn as point</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="1" column="4">
           <widget class="QDoubleSpinBox" name="sbRenderMinCircleRadius">
            <property name="toolTip">
             <string>If screen radius of circle is less than value, circle is drawn as point</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="1" column="3">
           <widget class="QLabel" name="label_15">
            <property name="text">
             <string>Circle Radius:</string>
            </property>
           </widget>
          </item>
          <item row="0" column="3">
           <widget class="QLabel" name="label_14">
            <property name="text">
             <string>Arc Radius:</string>
            </property>
           </widget>
          </item>
          <item row="0" column="4">
           <widget class="QDoubleSpinBox" name="sbRenderMinArcRadius">
            <property name="toolTip">
             <string>If screen radius of arc is less than value, arc is drawn as point</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="2" column="0">
           <widget class="QLabel" name="label_16">
            <property name="text">
             <string>Ellipse Minor Axis:</string>
















            </property>
           </widget>
          </item>
          <item row="2" column="2">
           <widget class="QDoubleSpinBox" name="sbRenderMinEllipseMajor">
            <property name="toolTip">
             <string>If screen size for major ellipse axis is less than value, ellipse is drawn as point</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>
      </layout>







|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|

|












|















|
|

|












|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|

|












|
|

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
|
|
|
|
|
|

|
|

|
|







3248
3249
3250
3251
3252
3253
3254
3255





















3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303














3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
             <number>15</number>
            </property>
            <property name="singleStep">
             <number>1</number>
            </property>
           </widget>
          </item>
          <item row="3" column="4">





















           <widget class="QDoubleSpinBox" name="sbRenderMinCircleRadius">
            <property name="toolTip">
             <string>If screen radius of circle is less than value, circle is drawn as point</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="3" column="2">
           <widget class="QDoubleSpinBox" name="sbRenderMinLineLen">
            <property name="toolTip">
             <string>If screen length of line is less than value, the line is drawn as point</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="4" column="4">
           <widget class="QDoubleSpinBox" name="sbRenderMinEllipseMinor">
            <property name="toolTip">
             <string>If screen size of minor ellipse axis is less than value, ellipse is drawn as line</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="4" column="2">














           <widget class="QDoubleSpinBox" name="sbRenderMinEllipseMajor">
            <property name="toolTip">
             <string>If screen size for major ellipse axis is less than value, ellipse is drawn as point</string>
            </property>
            <property name="suffix">
             <string> px</string>
            </property>
            <property name="maximum">
             <double>5.000000000000000</double>
            </property>
            <property name="singleStep">
             <double>0.010000000000000</double>
            </property>
           </widget>
          </item>
          <item row="3" column="3">
           <widget class="QLabel" name="label_15">
            <property name="text">
             <string>Circle Radius:</string>
            </property>
           </widget>
          </item>
          <item row="1" column="0" colspan="4">
           <widget class="QCheckBox" name="cbSimplifySmall">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="toolTip">
             <string>Render the small entities in draft mode</string>
            </property>
            <property name="text">
             <string>Simplify the small entities</string>
            </property>
           </widget>
          </item>
          <item row="0" column="0" colspan="5">
           <widget class="QCheckBox" name="cbSimplifyPanning">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="toolTip">
             <string>Simplify the rendering during the mouse drag panning.</string>
            </property>
            <property name="text">
             <string>Simplify rendering on panning</string>
            </property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>
      </layout>

Changes to librecad/src/ui/dock_widgets/command_line/qg_commandwidget.cpp.

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#include <QAction>
#include <QDockWidget>
#include <QKeyEvent>
#include <QFileDialog>
#include <QSettings>

#include "lc_application.h"
#include "qc_applicationwindow.h"
#include "qg_actionhandler.h"
#include "rs_commandevent.h"
#include "rs_commands.h"
#include "rs_debug.h"
#include "rs_settings.h"
#include "rs_system.h"
#include "rs_utility.h"

/*
 *  Constructs a QG_CommandWidget as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
QG_CommandWidget::QG_CommandWidget(QWidget* parent, const char* name, Qt::WindowFlags fl)







<


<



<







29
30
31
32
33
34
35

36
37

38
39
40

41
42
43
44
45
46
47

#include <QAction>
#include <QDockWidget>
#include <QKeyEvent>
#include <QFileDialog>
#include <QSettings>


#include "qc_applicationwindow.h"
#include "qg_actionhandler.h"

#include "rs_commands.h"
#include "rs_debug.h"
#include "rs_settings.h"

#include "rs_utility.h"

/*
 *  Constructs a QG_CommandWidget as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
QG_CommandWidget::QG_CommandWidget(QWidget* parent, const char* name, Qt::WindowFlags fl)

Changes to librecad/src/ui/dock_widgets/entity_info/lc_quickinfowidget.h.

69
70
71
72
73
74
75



76
77
78
79
80
81
82

    bool isDisplayPointsPathOnPreview(){return options->displayPointsPath;};
    bool isSelectEntitiesInDefaultActionWithCTRL(){return options->selectEntitiesInDefaultActionByCTRL;};
    bool isAutoSelectEntitiesInDefaultAction(){return options->autoSelectEntitiesInDefaultAction;};

    void onEntityPropertiesEdited(unsigned long originalId, unsigned long editedCloneId);




protected slots:
    void onSettings();
    void onClearAll();
    void onCopyAll();
    void onTextChanged();
    void onPickEntity();
    void onPickCoordinates();







>
>
>







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

    bool isDisplayPointsPathOnPreview(){return options->displayPointsPath;};
    bool isSelectEntitiesInDefaultActionWithCTRL(){return options->selectEntitiesInDefaultActionByCTRL;};
    bool isAutoSelectEntitiesInDefaultAction(){return options->autoSelectEntitiesInDefaultAction;};

    void onEntityPropertiesEdited(unsigned long originalId, unsigned long editedCloneId);

signals:
    virtual void escape();

protected slots:
    void onSettings();
    void onClearAll();
    void onCopyAll();
    void onTextChanged();
    void onPickEntity();
    void onPickCoordinates();

Changes to librecad/src/ui/dock_widgets/layers_tree/lc_layertreeitem.cpp.

255
256
257
258
259
260
261




























262
263
264
265
266
267
268
        if (child->getLayerType() == type){
            result = true;
            break;
        }
    }
    return result;
}





























void LC_LayerTreeItem::setLayerType(int value){
    layerType = value;
}
/**
 * If layer is secondary, this is the reference to the normal layer (if any) that corresponds to this item
 * @return primary layer item







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
        if (child->getLayerType() == type){
            result = true;
            break;
        }
    }
    return result;
}


/**
 * Searches recursively and returns the first child of the given type.
 * Or nullptr if there is none.
 * @param type layer type
 * @return LC_LayerTreeItem* or nullptr
 */
LC_LayerTreeItem* LC_LayerTreeItem::firstChildOfType(int type){
    LC_LayerTreeItem* result = nullptr;
    int count = childItems.length();

    for (int i = 0; i < count; i++) {
        LC_LayerTreeItem *child = childItems.at(i);

        if (child->getLayerType() == type){
            result = child;
            break;
        } else {
          result = child->firstChildOfType(type);
          if (result) break;
        }
    }

    return result;
}



void LC_LayerTreeItem::setLayerType(int value){
    layerType = value;
}
/**
 * If layer is secondary, this is the reference to the normal layer (if any) that corresponds to this item
 * @return primary layer item

Changes to librecad/src/ui/dock_widgets/layers_tree/lc_layertreeitem.h.

100
101
102
103
104
105
106

107
108
109
110
111
112
113
    void setMatched(bool enabled) {matched = enabled;};
    bool isMatched() const {return matched;};
    bool isActiveLayer() const {return activeLayer;};
    void setActiveLayer(bool value){activeLayer = value;};
    void invalidate();
    bool isInValid() const;
    bool hasChildOfType(int type);

    bool hasChildWithName(QString& nameToFind, int layerTypeToFind);
    void collectPathToParent(QList<LC_LayerTreeItem*> &result, bool includeSelf);
    bool isDescendantOf(LC_LayerTreeItem* item);
    bool isZero() const {return zero_layer;}
    void markAsZero(){zero_layer = true;}
    QString getFullName(){return fullName;};
    void setFullName(QString &name){fullName = name;};







>







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    void setMatched(bool enabled) {matched = enabled;};
    bool isMatched() const {return matched;};
    bool isActiveLayer() const {return activeLayer;};
    void setActiveLayer(bool value){activeLayer = value;};
    void invalidate();
    bool isInValid() const;
    bool hasChildOfType(int type);
    LC_LayerTreeItem* firstChildOfType(int type);
    bool hasChildWithName(QString& nameToFind, int layerTypeToFind);
    void collectPathToParent(QList<LC_LayerTreeItem*> &result, bool includeSelf);
    bool isDescendantOf(LC_LayerTreeItem* item);
    bool isZero() const {return zero_layer;}
    void markAsZero(){zero_layer = true;}
    QString getFullName(){return fullName;};
    void setFullName(QString &name){fullName = name;};

Changes to librecad/src/ui/dock_widgets/library_widget/qg_librarywidget.cpp.

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    vboxLayout->addWidget(dirView);
    ivPreview = new QListView(this);
    ivPreview->setViewMode(QListView::IconMode);
    vboxLayout->addWidget(ivPreview);
    bInsert = new QPushButton(tr("Insert"), this);
    vboxLayout->addWidget(bInsert);

    QHBoxLayout *refreshButtonsLayout = new QHBoxLayout(this);
    bRefresh = new QPushButton(tr("Refresh"), this);
    refreshButtonsLayout->addWidget(bRefresh);
    bRebuild = new QPushButton(tr("Rebuild"), this);
    refreshButtonsLayout->addWidget(bRebuild);
    vboxLayout->addLayout(refreshButtonsLayout);

    buildTree();







|







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    vboxLayout->addWidget(dirView);
    ivPreview = new QListView(this);
    ivPreview->setViewMode(QListView::IconMode);
    vboxLayout->addWidget(ivPreview);
    bInsert = new QPushButton(tr("Insert"), this);
    vboxLayout->addWidget(bInsert);

    QHBoxLayout *refreshButtonsLayout = new QHBoxLayout();
    bRefresh = new QPushButton(tr("Refresh"), this);
    refreshButtonsLayout->addWidget(bRefresh);
    bRebuild = new QPushButton(tr("Rebuild"), this);
    refreshButtonsLayout->addWidget(bRebuild);
    vboxLayout->addLayout(refreshButtonsLayout);

    buildTree();

Changes to librecad/src/ui/dock_widgets/pen_palette/lc_penpalettedata.cpp.

66
67
68
69
70
71
72



73


74
75
76
77
78
79
80
        // handle error later
    }
    return result;
}

bool LC_PenPaletteData::loadItems(){
    QString fileName = options->pensFileName;



    bool result = false;


    QFile file(fileName);
    file.open(QIODevice::ReadOnly | QIODevice::Text);
    if (file.isOpen()){
        QTextStream in(&file);
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
        in.setEncoding(QStringConverter::Utf8);
#else







>
>
>
|
>
>







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
        // handle error later
    }
    return result;
}

bool LC_PenPaletteData::loadItems(){
    QString fileName = options->pensFileName;

    if (fileName.length() == 0) {
        createDefaultPens();
        return false;
    }

    QFile file(fileName);
    file.open(QIODevice::ReadOnly | QIODevice::Text);
    if (file.isOpen()){
        QTextStream in(&file);
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
        in.setEncoding(QStringConverter::Utf8);
#else
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
        }
        file.close();
        return true;
    }
    else {
        createDefaultPens();
    }
    return result;
}

/**
 * Quite naive implementation that stores all attributes of pen in string using common separator.
 * @param item
 * @return
 */







|







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
        }
        file.close();
        return true;
    }
    else {
        createDefaultPens();
    }
    return false;
}

/**
 * Quite naive implementation that stores all attributes of pen in string using common separator.
 * @param item
 * @return
 */

Changes to librecad/src/ui/dock_widgets/views_list/lc_namedviewslistwidget.cpp.

128
129
130
131
132
133
134

135
136
137
138

139
140
141
142
143
144
145
}

void LC_NamedViewsListWidget::setGraphicView(RS_GraphicView *gv,
                                             QMdiSubWindow *w) {
    LC_ViewList *viewsList = nullptr;
    if (gv != nullptr && gv->getGraphic() != nullptr) {
        RS_Graphic *graphic = gv->getGraphic();

        linearFormat = graphic->getLinearFormat();
        precision = graphic->getLinearPrecision();
        drawingUnit = graphic->getUnit();
        viewsList = graphic->getViewList();

    }
    graphicView = gv;
    window = w;
    setViewsList(viewsList);
}

void LC_NamedViewsListWidget::setViewsList(LC_ViewList *viewsList) {







>
|
|
|
|
>







128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
}

void LC_NamedViewsListWidget::setGraphicView(RS_GraphicView *gv,
                                             QMdiSubWindow *w) {
    LC_ViewList *viewsList = nullptr;
    if (gv != nullptr && gv->getGraphic() != nullptr) {
        RS_Graphic *graphic = gv->getGraphic();
        if (graphic != nullptr) {
            linearFormat = graphic->getLinearFormat();
            precision = graphic->getLinearPrecision();
            drawingUnit = graphic->getUnit();
            viewsList = graphic->getViewList();
        }
    }
    graphicView = gv;
    window = w;
    setViewsList(viewsList);
}

void LC_NamedViewsListWidget::setViewsList(LC_ViewList *viewsList) {

Changes to librecad/src/ui/main/qc_applicationwindow.cpp.

609
610
611
612
613
614
615


616




617
618
619
620
621
622
623
                QC_PluginInterface *pluginInterface = qobject_cast<QC_PluginInterface *>(plugin);
                if (pluginInterface) {
                    loadedPlugins.push_back(pluginInterface);
                    loadedPluginFileNames.push_back(fileName);
                    PluginCapabilities pluginCapabilities=pluginInterface->getCapabilities();
                    for(const PluginMenuLocation& loc: pluginCapabilities.menuEntryPoints) {
                        QAction *actpl = new QAction(loc.menuEntryActionName, plugin);


                        actpl->setData(loc.menuEntryActionName);




                        connect(actpl, SIGNAL(triggered()), this, SLOT(execPlug()));
                        connect(this, SIGNAL(windowsChanged(bool)), actpl, SLOT(setEnabled(bool)));
                        QMenu *atMenu = findMenu("/"+loc.menuEntryPoint, menuBar()->children(), "");
                        if (atMenu) {
                            atMenu->addAction(actpl);
                        } else {
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)







>
>
|
>
>
>
>







609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
                QC_PluginInterface *pluginInterface = qobject_cast<QC_PluginInterface *>(plugin);
                if (pluginInterface) {
                    loadedPlugins.push_back(pluginInterface);
                    loadedPluginFileNames.push_back(fileName);
                    PluginCapabilities pluginCapabilities=pluginInterface->getCapabilities();
                    for(const PluginMenuLocation& loc: pluginCapabilities.menuEntryPoints) {
                        QAction *actpl = new QAction(loc.menuEntryActionName, plugin);
                        actpl->setText(loc.menuEntryActionName);
                        if (loc.menuEntryCmd == "") {
                          actpl->setData(loc.menuEntryActionName);
                        } else {
                          actpl->setData(loc.menuEntryCmd);
                        }
                        if (loc.menuEntryKey != "") actpl->setShortcut(QKeySequence::fromString(loc.menuEntryKey));
                        connect(actpl, SIGNAL(triggered()), this, SLOT(execPlug()));
                        connect(this, SIGNAL(windowsChanged(bool)), actpl, SLOT(setEnabled(bool)));
                        QMenu *atMenu = findMenu("/"+loc.menuEntryPoint, menuBar()->children(), "");
                        if (atMenu) {
                            atMenu->addAction(actpl);
                        } else {
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)

Changes to librecad/src/ui/main/qc_applicationwindow.h.

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

#include <QMap>
#include <QSettings>

#include "rs.h"
#include "rs_pen.h"
#include "rs_snapper.h"
#include "mainwindowx.h"
#include "lc_penpalettewidget.h"
#include "lc_quickinfowidget.h"
#include "lc_mdiapplicationwindow.h"
#include "lc_releasechecker.h"
#include "lc_qtstatusbarmanager.h"
#include "lc_namedviewslistwidget.h"








<







33
34
35
36
37
38
39

40
41
42
43
44
45
46

#include <QMap>
#include <QSettings>

#include "rs.h"
#include "rs_pen.h"
#include "rs_snapper.h"

#include "lc_penpalettewidget.h"
#include "lc_quickinfowidget.h"
#include "lc_mdiapplicationwindow.h"
#include "lc_releasechecker.h"
#include "lc_qtstatusbarmanager.h"
#include "lc_namedviewslistwidget.h"

Changes to librecad/src/ui/view/qg_graphicview.cpp.

519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
        break;
    }
    RS_DEBUG->print("QG_GraphicView::mouseReleaseEvent: OK");
}

void QG_GraphicView::addEditEntityEntry(QMouseEvent* event, QMenu& contextMenu){
    RS_Entity* entity = snapEntity(*this, event);
    if (entity == nullptr)
    return;
    if (container==nullptr)
        return;
    RS_Insert* insert = getAncestorInsert(entity);
    // MText/Text should not be edited as blocks
    RS_Entity* toEdit = getParentText(insert) != nullptr ? getParentText(insert) : nullptr;
    if (toEdit != nullptr) {
        insert = nullptr;
        entity = toEdit;
    }







|
<
|
<







519
520
521
522
523
524
525
526

527

528
529
530
531
532
533
534
        break;
    }
    RS_DEBUG->print("QG_GraphicView::mouseReleaseEvent: OK");
}

void QG_GraphicView::addEditEntityEntry(QMouseEvent* event, QMenu& contextMenu){
    RS_Entity* entity = snapEntity(*this, event);
    if (entity == nullptr)  return;

    if (container==nullptr)  return;

    RS_Insert* insert = getAncestorInsert(entity);
    // MText/Text should not be edited as blocks
    RS_Entity* toEdit = getParentText(insert) != nullptr ? getParentText(insert) : nullptr;
    if (toEdit != nullptr) {
        insert = nullptr;
        entity = toEdit;
    }
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
        antialiasing  = LC_GET_BOOL("Antialiasing");
        classicRenderer =  LC_GET_BOOL("ClassicRenderer", true);
        int zoomFactor1000 = LC_GET_INT("ScrollZoomFactor", 1137);
        scrollZoomFactor = zoomFactor1000 / 1000.0;
    }
    LC_GROUP_END();

    RS_Graphic* graphic = getGraphic();
    if (graphic != nullptr) {
        unitFactor = RS_Units::convert(1.0, RS2::Millimeter, graphic->getUnit());
        unitFactor100 =  unitFactor / 100.0;
        defaultWidthFactor = graphic->getVariableDouble("$DIMSCALE", 1.0);

        pdmode = graphic->getGraphicVariableInt("$PDMODE", LC_DEFAULTS_PDMode);
        pdsize = graphic->getGraphicVariableDouble("$PDSIZE", LC_DEFAULTS_PDSize);

//        Lineweight endcaps setting for new objects:
//        0 = none; 1 = round; 2 = angle; 3 = square
        int endCaps = graphic->getGraphicVariableInt("$ENDCAPS", 1);
        switch (endCaps){
            case 0:
                penCapStyle = Qt::FlatCap;
                break;
            case 1:
                penCapStyle = Qt::RoundCap;
                break;
            case 2:
                penCapStyle = Qt::MPenCapStyle;
                break;
            case 3:
                penCapStyle = Qt::SquareCap;
                break;
            default:
                penCapStyle = Qt::FlatCap; // fixme - or round?
        }
        //0=none; 1= round; 2 = angle; 3 = flat
        int joinStyle = graphic->getGraphicVariableInt("$JOINSTYLE", 1);

        switch (joinStyle){
            case 0:
                penJoinStyle = Qt::BevelJoin;
                break;
            case 1:
                penJoinStyle = Qt::RoundJoin;
                break;
            case 2:
                penJoinStyle = Qt::MiterJoin;
                break;
            case 3:
                penJoinStyle = Qt::BevelJoin;
                break;
            default:
                penJoinStyle = Qt::RoundJoin;
        }
    }

    if (HIDE_SELECT_CURSOR) {
        // potentially, select cursor may be also hidden and so snapper will be used instead of cursor.
        // however, this will require review and modifications of significant amount of actions, so
        // probably I'll return to this later. In such case, the code within this "if" will be handy for such support
        LC_GROUP("Appearance");
        {
            cursor_hiding = LC_GET_BOOL("cursor_hiding", false);







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1383
1384
1385
1386
1387
1388
1389

















































1390
1391
1392
1393
1394
1395
1396
        antialiasing  = LC_GET_BOOL("Antialiasing");
        classicRenderer =  LC_GET_BOOL("ClassicRenderer", true);
        int zoomFactor1000 = LC_GET_INT("ScrollZoomFactor", 1137);
        scrollZoomFactor = zoomFactor1000 / 1000.0;
    }
    LC_GROUP_END();


















































    if (HIDE_SELECT_CURSOR) {
        // potentially, select cursor may be also hidden and so snapper will be used instead of cursor.
        // however, this will require review and modifications of significant amount of actions, so
        // probably I'll return to this later. In such case, the code within this "if" will be handy for such support
        LC_GROUP("Appearance");
        {
            cursor_hiding = LC_GET_BOOL("cursor_hiding", false);

Changes to librecad/support/fonts/lc_opengost-ar.lff.

1
2
3
4
5
6
7
8
9
10
11
12
13



14
15
16
17
18
19
20
# Format:            LibreCAD Font 1
# Creator:           LibreCAD
# Version:           1.1
# Name:              lc_opengost-ar
# Encoding:          UTF-8
# LetterSpacing:     1.92857
# WordSpacing:       3.85715
# LineSpacingFactor: 0.94286
# Created:           2014-10-02
# Last modified:     2014-12-03
# Author:            stranger573 <stranger573@mail.ru>
# License:           SIL OPEN FONT LICENSE Version 1.1




[0021] !
0,8.67857;0,2.25
0,0.27143;0,0.37143

[0022] "
0.32143,8.67857;0,7.39286
1.60714,8.67857;1.28571,7.39285


|






|



>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Format:            LibreCAD Font 1
# Creator:           LibreCAD
# Version:           2.2.2.6-alpha
# Name:              lc_opengost-ar
# Encoding:          UTF-8
# LetterSpacing:     1.92857
# WordSpacing:       3.85715
# LineSpacingFactor: 0.94286
# Created:           2014-10-02
# Last modified:     2025-09-13
# Author:            stranger573 <stranger573@mail.ru>
# License:           SIL OPEN FONT LICENSE Version 1.1

[fffd] �
1,0;0,2;1,4;2,2;1,0

[0021] !
0,8.67857;0,2.25
0,0.27143;0,0.37143

[0022] "
0.32143,8.67857;0,7.39286
1.60714,8.67857;1.28571,7.39285
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[0035] 5
3.21428,8.67857;0,8.67857;0,4.82143;1.28571,4.82143;3.21429,2.89286,A-0.41333;3.21428,2.25;1.28571,0.32143,A-0.415;0,0.32143

[0036] 6
2.57142,8.67857;-0,4.5,A0.25451;0,2.05714;3.85714,2.05714,A1;3.85714,2.89286;1.92857,4.82143,A0.41333;0.02727,4.82143

[0037] 7
0,7.71429;0,8.67857;3.85815,8.67857;1.92857,0.32143

[0038] 8
3.92143,6.62143;0.32143,6.62143,A-1;0.32143,7.07143;3.92143,7.07143,A-1;3.92143,6.62143
4.24286,2.25;0,2.25,A-1;0,2.7;4.24286,2.7,A-1;4.24286,2.25

[0039] 9
3.82884,4.17857;1.92857,4.17857;0,6.10714,A-0.41667;0,6.94286;3.85714,6.94286,A-1;3.85714,4.5;1.28571,0.32143,A-0.25272







|







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[0035] 5
3.21428,8.67857;0,8.67857;0,4.82143;1.28571,4.82143;3.21429,2.89286,A-0.41333;3.21428,2.25;1.28571,0.32143,A-0.415;0,0.32143

[0036] 6
2.57142,8.67857;-0,4.5,A0.25451;0,2.05714;3.85714,2.05714,A1;3.85714,2.89286;1.92857,4.82143,A0.41333;0.02727,4.82143

[0037] 7
0,7.71429;0,8.67857;3.8,8.67857;1.92857,0.32143

[0038] 8
3.92143,6.62143;0.32143,6.62143,A-1;0.32143,7.07143;3.92143,7.07143,A-1;3.92143,6.62143
4.24286,2.25;0,2.25,A-1;0,2.7;4.24286,2.7,A-1;4.24286,2.25

[0039] 9
3.82884,4.17857;1.92857,4.17857;0,6.10714,A-0.41667;0,6.94286;3.85714,6.94286,A-1;3.85714,4.5;1.28571,0.32143,A-0.25272
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
[0071] q
3.21429,-2.25;3.21429,6.10714;1.28571,6.10714;0,4.82143,A0.415;0,1.60714;1.28571,0.32143,A0.415;3.21429,0.32143

[0072] r
2.57143,5.14286;1.60714,6.10714,A0.40667;0,6.10714;0,0.32143

[0073] s
3.08605,5.78571;0.74175,6.11515,A0.22001;0.40309,4.29213,A0.60873;2.72857,2.48419;2.2205,0.25996,A-0.63711;-0,0.64307,A-0.1935

[0074] t
0,6.10714;1.92857,6.10714
0.64285,8.67857;0.64285,0.32143

[0075] u
0,6.10714;0,1.60714;1.28571,0.32143,A0.415;3.21428,0.32143;3.21428,6.10714







|







293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
[0071] q
3.21429,-2.25;3.21429,6.10714;1.28571,6.10714;0,4.82143,A0.415;0,1.60714;1.28571,0.32143,A0.415;3.21429,0.32143

[0072] r
2.57143,5.14286;1.60714,6.10714,A0.40667;0,6.10714;0,0.32143

[0073] s
3.08605,5.78571;0.74175,6.11515,A0.22001;0.40309,4.29213,A0.60873;2.72857,2.48419;2.2205,0.25996,A-0.63711;0,0.64307,A-0.1935

[0074] t
0,6.10714;1.92857,6.10714
0.64285,8.67857;0.64285,0.32143

[0075] u
0,6.10714;0,1.60714;1.28571,0.32143,A0.415;3.21428,0.32143;3.21428,6.10714
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
0.64286,8.67857;1.28572,8.03961;1.92857,8.67857

[015a] Ś
3.66448,8.35714;0.91938,8.73186,A0.21596;0.28961,6.68501,A0.53506;3.50134,2.74655;2.56751,0.19158,A-0.56893;-0,0.64298,A-0.18192
2.25011,10.60714;1.92869,9.96429

[015b] ś
3.08605,5.78571;0.74175,6.11515,A0.22001;0.40309,4.29213,A0.60873;2.72857,2.48419;2.2205,0.25996,A-0.63711;-0,0.64307,A-0.1935
1.92876,8.67857;1.60734,8.03571

[0160] Š
3.66448,8.35714;0.91938,8.73186,A0.21596;0.28961,6.68501,A0.53506;3.50134,2.74655;2.56751,0.19158,A-0.56893;-0,0.64298,A-0.18192
1.28583,10.60714;1.92869,9.96818;2.57154,10.60714

[0161] š
3.08605,5.78571;0.74175,6.11515,A0.22001;0.40309,4.29213,A0.60873;2.72857,2.48419;2.2205,0.25996,A-0.63711;-0,0.64307,A-0.1935
0.96449,8.67857;1.60735,8.03961;2.2502,8.67857

[0164] Ť
0,8.67857;3.85714,8.67857
1.92857,8.67857;1.92857,0.32143
1.28571,10.60714;1.92857,9.96818;2.57143,10.60714








|







|







870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
0.64286,8.67857;1.28572,8.03961;1.92857,8.67857

[015a] Ś
3.66448,8.35714;0.91938,8.73186,A0.21596;0.28961,6.68501,A0.53506;3.50134,2.74655;2.56751,0.19158,A-0.56893;-0,0.64298,A-0.18192
2.25011,10.60714;1.92869,9.96429

[015b] ś
3.08605,5.78571;0.74175,6.11515,A0.22001;0.40309,4.29213,A0.60873;2.72857,2.48419;2.2205,0.25996,A-0.63711;0,0.64307,A-0.1935
1.92876,8.67857;1.60734,8.03571

[0160] Š
3.66448,8.35714;0.91938,8.73186,A0.21596;0.28961,6.68501,A0.53506;3.50134,2.74655;2.56751,0.19158,A-0.56893;-0,0.64298,A-0.18192
1.28583,10.60714;1.92869,9.96818;2.57154,10.60714

[0161] š
3.08605,5.78571;0.74175,6.11515,A0.22001;0.40309,4.29213,A0.60873;2.72857,2.48419;2.2205,0.25996,A-0.63711;0,0.64307,A-0.1935
0.96449,8.67857;1.60735,8.03961;2.2502,8.67857

[0164] Ť
0,8.67857;3.85714,8.67857
1.92857,8.67857;1.92857,0.32143
1.28571,10.60714;1.92857,9.96818;2.57143,10.60714

935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
0.96467,8.67857;1.60753,8.03961;2.25039,8.67857

[0218] Ș
3.66448,8.35714;0.91938,8.73186,A0.21596;0.28961,6.68501,A0.53506;3.50134,2.74655;2.56751,0.19158,A-0.56893;-0,0.64298,A-0.18192
1.92869,-0.96428;1.92869,-1.60714

[0219] ș
3.08605,5.78571;0.74175,6.11515,A0.22001;0.40309,4.29213,A0.60873;2.72857,2.48419;2.2205,0.25996,A-0.63711;-0,0.64307,A-0.1935
1.60734,-0.96428;1.60734,-1.60714

[021a] Ț
0,8.67857;3.85714,8.67857
1.92857,8.67857;1.92857,0.32143
1.92857,-0.96428;1.92857,-1.60714








|







938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
0.96467,8.67857;1.60753,8.03961;2.25039,8.67857

[0218] Ș
3.66448,8.35714;0.91938,8.73186,A0.21596;0.28961,6.68501,A0.53506;3.50134,2.74655;2.56751,0.19158,A-0.56893;-0,0.64298,A-0.18192
1.92869,-0.96428;1.92869,-1.60714

[0219] ș
3.08605,5.78571;0.74175,6.11515,A0.22001;0.40309,4.29213,A0.60873;2.72857,2.48419;2.2205,0.25996,A-0.63711;0,0.64307,A-0.1935
1.60734,-0.96428;1.60734,-1.60714

[021a] Ț
0,8.67857;3.85714,8.67857
1.92857,8.67857;1.92857,0.32143
1.92857,-0.96428;1.92857,-1.60714

1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
2.25,8.67857;2.25,0.32143
0,8.67857;0,5.14286;4.5,5.14286,A1;4.5,8.67857

[03a9] Ω
0.64286,0.32143;1.60714,0.32143;1.60714,1.93398;-0,3.53571,A-0.41555;0,6.62143;4.5,6.62143,A-1;4.5,3.53571;2.89286,1.93364,A-0.41432;2.89286,0.32143;3.85714,0.32143

[03b1] α
3.85714,6.10714;2.52965,1.14429;-0,1.47857,A-0.8756;0,4.95;2.52964,5.28429,A-0.8756;3.77035,0.64929;4.17857,0.32143,A0.38774

[03b2] β
1.28571,0.32143;1.60714,0.32143;3.21429,1.92857,A0.412;3.21428,3.85714;1.52679,5.46429,A0.42546;2.89286,6.91071,A0.39856;2.89286,7.36071;0,7.36071,A1;0,-2.25
1.28571,5.46429;1.52679,5.46429

[03b3] γ
0,6.10714;1.03231,5.49095,A-0.27576;2.25,0.32143,A-0.1157;2.25681,-0.3383;2.1501,-2.05288,A-0.03109;1.70312,-2.04951,A-0.88954;1.60955,-0.3383,A-0.02732;1.60714,0.32143;3.21107,6.10071,A-0.15441







|







1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
2.25,8.67857;2.25,0.32143
0,8.67857;0,5.14286;4.5,5.14286,A1;4.5,8.67857

[03a9] Ω
0.64286,0.32143;1.60714,0.32143;1.60714,1.93398;-0,3.53571,A-0.41555;0,6.62143;4.5,6.62143,A-1;4.5,3.53571;2.89286,1.93364,A-0.41432;2.89286,0.32143;3.85714,0.32143

[03b1] α
3.85714,6.10714;2.52965,1.14429;0,1.47857,A-0.8756;0,4.95;2.52964,5.28429,A-0.8756;3.77035,0.64929;4.17857,0.32143,A0.38774

[03b2] β
1.28571,0.32143;1.60714,0.32143;3.21429,1.92857,A0.412;3.21428,3.85714;1.52679,5.46429,A0.42546;2.89286,6.91071,A0.39856;2.89286,7.36071;0,7.36071,A1;0,-2.25
1.28571,5.46429;1.52679,5.46429

[03b3] γ
0,6.10714;1.03231,5.49095,A-0.27576;2.25,0.32143,A-0.1157;2.25681,-0.3383;2.1501,-2.05288,A-0.03109;1.70312,-2.04951,A-0.88954;1.60955,-0.3383,A-0.02732;1.60714,0.32143;3.21107,6.10071,A-0.15441
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
0,6.10714;2.57143,6.10714;3.53571,6.42857,A0.169
1.60714,6.10714;1.60714,0.96429;2.25,0.32143,A0.42;2.57143,0.32143

[03c5] υ
0,6.12;0.3825,5.72142,A-0.38513;0.3825,1.15714;1.56374,0.21918,A0.48257;2.55214,0.95464,A0.20391;2.95393,6.10393,A0.19823

[03c6] φ
0.64285,6.10714;-0,2.44286,A0.08705;4.5,2.44286,A1;4.02783,5.59603,A0.07446;2.25,5.32981,A0.86141;2.25,-2.25

[03c7] χ
3.53572,6.10715;0.32143,-2.25
0,6.10714;0.6075,5.67964,A-0.32241;3.24964,-1.8225;3.85714,-2.25,A0.32241

[03c8] ψ
2.25,7.39286;2.25,-2.25







|







1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
0,6.10714;2.57143,6.10714;3.53571,6.42857,A0.169
1.60714,6.10714;1.60714,0.96429;2.25,0.32143,A0.42;2.57143,0.32143

[03c5] υ
0,6.12;0.3825,5.72142,A-0.38513;0.3825,1.15714;1.56374,0.21918,A0.48257;2.55214,0.95464,A0.20391;2.95393,6.10393,A0.19823

[03c6] φ
0.64285,6.10714;0,2.44286,A0.08705;4.5,2.44286,A1;4.02783,5.59603,A0.07446;2.25,5.32981,A0.86141;2.25,-2.25

[03c7] χ
3.53572,6.10715;0.32143,-2.25
0,6.10714;0.6075,5.67964,A-0.32241;3.24964,-1.8225;3.85714,-2.25,A0.32241

[03c8] ψ
2.25,7.39286;2.25,-2.25
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
[0416] Ж
2.57143,8.67857;2.57143,0.32143
0,8.67857;2.22857,4.77857;0,0.32143
5.14285,8.67857;2.91429,4.77857;5.14286,0.32143
2.22857,4.77857;2.91429,4.77857

[0417] З
0.33672,8.33049;1.59578,8.87143,A-0.20573;1.91721,8.87143;3.65292,7.13571,A-0.41421;3.65292,6.55714;1.91721,4.82143,A-0.41421;3.84578,2.89286,A-0.41421;3.84578,2.05714;1.91721,0.12857,A-0.41421;1.59578,0.12857;-0,0.97415,A-0.24857
1.27435,4.82143;1.91721,4.82143

[0418] И
0,8.67857;0,0.32589;3.85714,8.67411;3.85714,0.32143

[0419] Й
1.28571,9.96429;2.57143,9.96429







|







1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
[0416] Ж
2.57143,8.67857;2.57143,0.32143
0,8.67857;2.22857,4.77857;0,0.32143
5.14285,8.67857;2.91429,4.77857;5.14286,0.32143
2.22857,4.77857;2.91429,4.77857

[0417] З
0.33672,8.33049;1.59578,8.87143,A-0.20573;1.91721,8.87143;3.65292,7.13571,A-0.41421;3.65292,6.55714;1.91721,4.82143,A-0.41421;3.84578,2.89286,A-0.41421;3.84578,2.05714;1.91721,0.12857,A-0.41421;1.59578,0.12857;0,0.97415,A-0.24857
1.27435,4.82143;1.91721,4.82143

[0418] И
0,8.67857;0,0.32589;3.85714,8.67411;3.85714,0.32143

[0419] Й
1.28571,9.96429;2.57143,9.96429
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
2.25096,7.71429;2.25096,5.14286
1.28667,10.92857;0,6.42857;3.21524,6.42857

[2075] ⁵
2.57143,10.92857;0,10.92857;0,8.35714;1.28571,8.35714;2.57143,7.07143,A-0.415;2.57143,6.42857;1.28571,5.14286,A-0.415;0,5.14286

[2076] ⁶
1.92214,10.92857;0,8.03571,A0.32203;0,6.42857;2.57143,6.42857,A1;2.57143,7.07143;1.28571,8.35714,A0.415;0.0056,8.35714

[2077] ⁷
0,10.28571;0,10.92857;2.56976,10.92857;0.96429,5.14286

[2078] ⁸
2.57143,9.64286;0,9.64286,A-1;2.57143,9.64286,A-1
2.57143,7.07143;2.57143,6.42857;0,6.42857,A-1;0,7.07143;2.57143,7.07143,A-1







|







1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
2.25096,7.71429;2.25096,5.14286
1.28667,10.92857;0,6.42857;3.21524,6.42857

[2075] ⁵
2.57143,10.92857;0,10.92857;0,8.35714;1.28571,8.35714;2.57143,7.07143,A-0.415;2.57143,6.42857;1.28571,5.14286,A-0.415;0,5.14286

[2076] ⁶
1.92214,10.92857;-0,8.03571,A0.32203;0,6.42857;2.57143,6.42857,A1;2.57143,7.07143;1.28571,8.35714,A0.415;0.0056,8.35714

[2077] ⁷
0,10.28571;0,10.92857;2.56976,10.92857;0.96429,5.14286

[2078] ⁸
2.57143,9.64286;0,9.64286,A-1;2.57143,9.64286,A-1
2.57143,7.07143;2.57143,6.42857;0,6.42857,A-1;0,7.07143;2.57143,7.07143,A-1
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
[2081] ₁
0,2.57143;1.28571,3.85306;1.28571,-1.92857

[2082] ₂
0.00702,3.22393;2.19274,3.48108,A-0.45417;2.37273,1.89321,A-0.35006;0,-1.92857;2.56881,-1.92857

[2083] ₃
0,3.85714;1.28571,3.85714;1.28573,1.28571,A-1.00001;2.57143,0,A-0.41409;2.57143,-0.64286;1.28571,-1.92857,A-0.415;0,-1.92857
0.64286,1.28571;1.28573,1.28571

[2084] ₄
2.25096,0.64286;2.25096,-1.92857
1.28667,3.85714;0,-0.64286;3.21524,-0.64286

[2085] ₅







|







1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
[2081] ₁
0,2.57143;1.28571,3.85306;1.28571,-1.92857

[2082] ₂
0.00702,3.22393;2.19274,3.48108,A-0.45417;2.37273,1.89321,A-0.35006;0,-1.92857;2.56881,-1.92857

[2083] ₃
0,3.85714;1.28571,3.85714;1.28573,1.28571,A-1.00001;2.57143,-0,A-0.41409;2.57143,-0.64286;1.28571,-1.92857,A-0.415;0,-1.92857
0.64286,1.28571;1.28573,1.28571

[2084] ₄
2.25096,0.64286;2.25096,-1.92857
1.28667,3.85714;0,-0.64286;3.21524,-0.64286

[2085] ₅
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
13.49585,11.24916;0,-2.25;13.49346,-2.25;26.99585,11.24916

[e05e] 
0,0.32143;17.35714,0.32143,A-0.96296

[e05f] 
0,0.32143;17.36598,0.32143,A-0.96247;0,0.32143

[fffd] �
1,0;0,2;1,4;2,2;1,0







<
<
<
2742
2743
2744
2745
2746
2747
2748



13.49585,11.24916;0,-2.25;13.49346,-2.25;26.99585,11.24916

[e05e] 
0,0.32143;17.35714,0.32143,A-0.96296

[e05f] 
0,0.32143;17.36598,0.32143,A-0.96247;0,0.32143



Changes to librecad/support/patterns/gost_ceramics.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_concrete.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_ferroconcrete.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_ferroconcrete1.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_glass.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_glass1.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_ground.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_ground1.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_liquid.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_metal.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_non-metal.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_sand.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_stone.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_wood.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/gost_wood1.dxf.

more than 10,000 changes

Changes to librecad/support/patterns/kerpele.dxf.

1
2
3
4
5
6
7
8
9
10
11














































































12











13
14












15
16
17
18
19
20
21
22
23
24
25
26
27
28

29


30

















31
32
33
34
35
























































































































































































































































































































































































































































































































































































































































36












37
38

39
40

41
42









43
44
45




























46






































































































47












48





















49













50
51




























52
53







54











































55
56
57
58
59
60
61
62
63
64
65
66


67
68
69
70
71
72
73
74


75
76
77
78
79
80
81
82
83
84

85
86

87
88

89
90

91
92
93
94
95
96

97
98

99
100
101
102
103
104
105
106
107
108

109
110

111
112

113
114

115
116

117
118

119
120
121
122
123
124
125
126

127
128

129
130

131
132

133
134
135
136
137
138
139
140
141
142

143
144
145
146
147
148
149
150
151
152
153
154

155
156

157
158

159
160

161
162

163
164

165
166

167
168

169
170

171
172
173


174
















175
176
177
178
179
180
181
182


183
184
185
186

187
188
189
190


191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206

207
208
209
210


211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

227
228
229
230


231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246

247
248
249
250


251
252
253
254
255
256
257
258









259







260
261
262
































263
264
265
266
267
268
269
270
















271
272
273

274

275
276
277
278
279
280
281
282
















283
284
285
286


287
288
289
290
291
292
293
294











295





296
297
298
































299
300
301
302
303
304
305
306
















307
308
309
310


311
312
313
314
315
316
317
318
















319
320
321
322


323
324
325
326
327
328
329
330






























































331
332
333
334


335
336
337
338
339
340
341
342
























343
344
345
346


347
348
349
350
351
352
353
354
























355
356
357
358


359
360
361
362
363
364
365
366














































































367
368
369

370

371
372
373
374
375
376
377
378
































379
380
381

382

383
384
385
386
387
388
389
390











391
392
393
394
395
396
397
398

399
400
401
402

403
404
405
406
407
408
409
410



411
412
413
414

415
416
417
418
419
420
421
422



423
424
425
426
427
428
429
430


431
432
433
434
435
436
437
438














































































439
440
441
442


443
444
445
446
447
448
449
450
































451
452
453
454


455
456
457
458
459
460
461
462
























































































































































































463
464
465
466
467
468
469
470


471
472
473
474
475
476
477
478


479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502


503
504
505
506

507
508
509
510



511
512
513
514
515
516
517
518
519
520

521
522

523
524

525
526
527
528

529
530
531
532
533
534
535
536
537
538
539
540


541
542
543
544
545
546
547
548
549
550
551
552


553
554
555
556
557
558
559
560
561
562
563
564


565
566
567
568
569
570
571
572


573
574
575
576
577
578
579
580














581
582
583
584
585
586
587
588


589
590
591
592
593
594
595
596

597
598
599
600



601
602
603
604
605
606
607
608











609







































































































610
611
612
613
614
615
616


617
618
619
620

621
622
623
624


625
626
627
628
629
630
631


632



633
634
635
636


637
638
639
640
641
642
643
644

645
646
647
648
649
650
651
652

653
654
655
656

657
658
659
660
661
662
663
664
665
666
667
668


669
670
671
672
673
674
675
676
677
678
679
680

681
682

683
684

685
686
687
688
689
690
691
692


693
694
695
696
697
698
699
700
701
702


703
704
705
706
707
708
709
710
711
712
713
714
715
716

717
718

719
720

721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786


787
788
789
790
791

792
793
794

795
796
797
798

799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814


815
816
817
818
819

820
821
822
823
824
825
826

827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842


843
844
845
846
847

848
849
850
851
852
853
854

855
856
857
858
859
860
861
862
863
864

865
866
867
868
869
870


871
872
873
874
875

876
877
878
879
880
881
882

883
884
885
886
887
888
889
890
891
892

893
894
895
896
897
898
899
900
901
902
903
904






905
906
907
908
909
910

911
912
913
914
915
916
917
918
919
920

921
922
923
924
925
926


927
928
929
930
931

932
933
934

935
936
937
938
939
940
941
942
943
944
945
946
947
948

949
950
951
952
953
954


955
956
957
958
959
960
961
962
963
964
965
966





967
968
969
970
971
972
973
974
975
976

977
978
979
980
981
982


983
984
985
986
987

988
989
990

991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004

1005
1006
1007
1008
1009
1010


1011
1012
1013
1014
1015

1016
1017
1018

1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038


1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296

1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
999
dxflib 2.0.1.3
  0
SECTION
  2
HEADER
  9
$ACADVER
  1
AC1015
  9














































































$HANDSEED











  5
FFFF












  9
$DIMASZ
 40
2.5
  9
$DIMGAP
 40
0.625
  9
$DIMEXO
 40
0.625
  9
$INSUNITS

 70


4

















  9
$DIMTXT
 40
2.5
  9
























































































































































































































































































































































































































































































































































































































































$PLIMMAX












 10
210.0

 20
297.0

 30
0.0









  9
$PLIMMIN
 10




























0.0






































































































 20












0.0





















 30













0.0
  9




























$DIMEXE
 40







1.25











































  0
ENDSEC
  0
SECTION
  2
TABLES
  0
TABLE
  2
VPORT
  5
8


100
AcDbSymbolTable
 70
1
  0
VPORT
  5
30


100
AcDbSymbolTableRecord
100
AcDbViewportTableRecord
  2
*Active
 70
0
 10
0.0

 20
0.0

 11
1.0

 21
1.0

 12
286.3055555555554861
 22
148.5
 13
0.0

 23
0.0

 14
10.0
 24
10.0
 15
10.0
 25
10.0
 16
0.0

 26
0.0

 36
1.0

 17
0.0

 27
0.0

 37
0.0

 40
297.0
 41
1.92798353909465
 42
50.0
 43
0.0

 44
0.0

 50
0.0

 51
0.0

 71
0
 72
100
 73
1
 74
3
 75
1

 76
1
 77
0
 78
0
281
0
 65
1
110
0.0

120
0.0

130
0.0

111
1.0

121
0.0

131
0.0

112
0.0

122
1.0

132
0.0

 79
0
146


0.0
















  0
ENDTAB
  0
TABLE
  2
LTYPE
  5
5


100
AcDbSymbolTable
 70
3

  0
LTYPE
  5
14


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
ByBlock
 70
0
  3

 72
65
 73
0
 40
0.0

  0
LTYPE
  5
15


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
ByLayer
 70
0
  3

 72
65
 73
0
 40
0.0

  0
LTYPE
  5
16


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
CONTINUOUS
 70
0
  3
Solid line
 72
65
 73
0
 40
0.0

  0
LTYPE
  5
31


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DOT
 70
0









  0







LTYPE
  5
32
































100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DOT2
 70
0
















  0
LTYPE
  5

33

100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DOTX2
 70
0
















  0
LTYPE
  5
34


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHED
 70
0











  0





LTYPE
  5
35
































100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHED2
 70
0
















  0
LTYPE
  5
36


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHEDX2
 70
0
















  0
LTYPE
  5
37


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHDOT
 70
0






























































  0
LTYPE
  5
38


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHDOT2
 70
0
























  0
LTYPE
  5
39


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHDOTX2
 70
0
























  0
LTYPE
  5
3A


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DIVIDE
 70
0














































































  0
LTYPE
  5

3B

100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DIVIDE2
 70
0
































  0
LTYPE
  5

3C

100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DIVIDEX2
 70
0











  0
LTYPE
  5
3D
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord

  2
CENTER
 70
0

  0
LTYPE
  5
3E
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord



  2
CENTER2
 70
0

  0
LTYPE
  5
3F
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord



  2
CENTERX2
 70
0
  0
LTYPE
  5
40


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
BORDER
 70
0














































































  0
LTYPE
  5
41


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
BORDER2
 70
0
































  0
LTYPE
  5
42


100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
BORDERX2
 70
0
























































































































































































  0
ENDTAB
  0
TABLE
  2
LAYER
  5
2


100
AcDbSymbolTable
 70
1
  0
LAYER
  5
10


100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
  2
0
 70
0
 62
7
  6
CONTINUOUS
370
0
390
F
  0
ENDTAB
  0
TABLE
  2
STYLE
  5
3


100
AcDbSymbolTable
 70
1

  0
STYLE
  5
11



100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
  2
Standard
 70
0
 40
0.0

 41
1.0

 50
0.0

 71
0
 42
2.5

  3
txt
  4

  0
ENDTAB
  0
TABLE
  2
VIEW
  5
6


100
AcDbSymbolTable
 70
0
  0
ENDTAB
  0
TABLE
  2
UCS
  5
7


100
AcDbSymbolTable
 70
0
  0
ENDTAB
  0
TABLE
  2
APPID
  5
9


100
AcDbSymbolTable
 70
1
  0
APPID
  5
12


100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
  2
ACAD
 70
0














  0
ENDTAB
  0
TABLE
  2
DIMSTYLE
  5
A


100
AcDbSymbolTable
 70
1
100
AcDbDimStyleTable
 71
0

  0
DIMSTYLE
105
27



100
AcDbSymbolTableRecord
100
AcDbDimStyleTableRecord
  2
Standard
 70
0











  0







































































































ENDTAB
  0
TABLE
  2
BLOCK_RECORD
  5
1


100
AcDbSymbolTable
 70
1

  0
BLOCK_RECORD
  5
1F


100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
  2
*Model_Space
340


22



  0
BLOCK_RECORD
  5
1B


100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
  2
*Paper_Space
340
1E

  0
BLOCK_RECORD
  5
23
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord

  2
*Paper_Space0
340
26

  0
ENDTAB
  0
ENDSEC
  0
SECTION
  2
BLOCKS
  0
BLOCK
  5
20


100
AcDbEntity
  8
0
100
AcDbBlockBegin
  2
*Model_Space
 70
0
 10
0.0

 20
0.0

 30
0.0

  3
*Model_Space
  1

  0
ENDBLK
  5
21


100
AcDbEntity
  8
0
100
AcDbBlockEnd
  0
BLOCK
  5
1C


100
AcDbEntity
 67
1
  8
0
100
AcDbBlockBegin
  2
*Paper_Space
 70
0
 10
0.0

 20
0.0

 30
0.0

  3
*Paper_Space
  1

  0
ENDBLK
  5
1D
100
AcDbEntity
 67
1
  8
0
100
AcDbBlockEnd
  0
BLOCK
  5
24
100
AcDbEntity
  8
0
100
AcDbBlockBegin
  2
*Paper_Space0
 70
0
 10
0.0
 20
0.0
 30
0.0
  3
*Paper_Space0
  1

  0
ENDBLK
  5
25
100
AcDbEntity
  8
0
100
AcDbBlockEnd
  0
ENDSEC
  0
SECTION
  2
ENTITIES
  0
LINE
  5
43
100
AcDbEntity
100
AcDbLine
  8
0


 62
256
370
-1
  6

ByLayer
 10
0.0

 20
0.0
 30
0.0

 11
100.0
 21
100.0
 31
0.0
  0
LINE
  5
44
100
AcDbEntity
100
AcDbLine
  8
0


 62
256
370
-1
  6

ByLayer
 10
20.0
 20
0.0
 30
0.0

 11
100.0
 21
80.0
 31
0.0
  0
LINE
  5
45
100
AcDbEntity
100
AcDbLine
  8
0


 62
256
370
-1
  6

ByLayer
 10
40.0
 20
0.0
 30
0.0

 11
100.0
 21
60.0
 31
0.0
  0
LINE
  5
46

100
AcDbEntity
100
AcDbLine
  8
0


 62
256
370
-1
  6

ByLayer
 10
60.0
 20
0.0
 30
0.0

 11
100.0
 21
40.0
 31
0.0
  0
LINE
  5
47

100
AcDbEntity
100
AcDbLine
  8
0
 62
256
370
-1
  6
ByLayer






 10
80.0
 20
0.0
 30
0.0

 11
100.0
 21
20.0
 31
0.0
  0
LINE
  5
48

100
AcDbEntity
100
AcDbLine
  8
0


 62
256
370
-1
  6

ByLayer
 10
0.0

 20
20.0
 30
0.0
 11
80.0
 21
100.0
 31
0.0
  0
LINE
  5
49

100
AcDbEntity
100
AcDbLine
  8
0


 62
256
370
-1
  6
ByLayer
 10
0.0
 20
40.0
 30
0.0





 11
60.0
 21
100.0
 31
0.0
  0
LINE
  5
4A

100
AcDbEntity
100
AcDbLine
  8
0


 62
256
370
-1
  6

ByLayer
 10
0.0

 20
60.0
 30
0.0
 11
40.0
 21
100.0
 31
0.0
  0
LINE
  5
4B

100
AcDbEntity
100
AcDbLine
  8
0


 62
256
370
-1
  6

ByLayer
 10
0.0

 20
80.0
 30
0.0
 11
20.0
 21
100.0
 31
0.0
  0
ENDSEC
  0
SECTION
  2
OBJECTS
  0
DICTIONARY
  5
C


100
AcDbDictionary
280
0
281
1
  3
ACAD_GROUP
350
D
  3
ACAD_LAYOUT
350
1A
  3
ACAD_MLINESTYLE
350
17
  3
ACAD_PLOTSETTINGS
350
19
  3
ACAD_PLOTSTYLENAME
350
E
  3
AcDbVariableDictionary
350
4C
  0
DICTIONARY
  5
D
100
AcDbDictionary
280
0
281
1
  0
ACDBDICTIONARYWDFLT
  5
E
100
AcDbDictionary
281
1
  3
Normal
350
F
100
AcDbDictionaryWithDefault
340
F
  0
ACDBPLACEHOLDER
  5
F
  0
DICTIONARY
  5
17
100
AcDbDictionary
280
0
281
1
  3
Standard
350
18
  0
MLINESTYLE
  5
18
100
AcDbMlineStyle
  2
STANDARD
 70
0
  3

 62
256
 51
90.0
 52
90.0
 71
2
 49
0.5
 62
256
  6
BYLAYER
 49
-0.5
 62
256
  6
BYLAYER
  0
DICTIONARY
  5
19
100
AcDbDictionary
280
0
281
1
  0
DICTIONARY
  5
1A
100
AcDbDictionary
281
1
  3
Layout1
350
1E
  3
Layout2
350
26
  3
Model
350
22
  0
LAYOUT
  5
1E
100
AcDbPlotSettings
  1

  2
C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3
  4

  6

 40
0.0
 41
0.0
 42
0.0
 43
0.0
 44
0.0
 45
0.0
 46
0.0
 47
0.0
 48
0.0
 49
0.0
140
0.0
141
0.0
142
1.0
143
1.0
 70
688
 72
0
 73
0
 74
5
  7

 75
16
147
1.0
148
0.0
149
0.0
100
AcDbLayout
  1
Layout1
 70
1
 71
1
 10
0.0
 20
0.0
 11
420.0
 21
297.0
 12
0.0
 22
0.0
 32
0.0
 14
100000000000000000000.0
 24
100000000000000000000.0
 34
100000000000000000000.0
 15
-100000000000000000000.0
 25
-100000000000000000000.0
 35
-100000000000000000000.0
146
0.0
 13
0.0
 23
0.0
 33
0.0
 16
1.0
 26
0.0
 36
0.0
 17
0.0
 27
1.0
 37
0.0
 76
0
330
1B
  0
LAYOUT
  5
22

100
AcDbPlotSettings
  1

  2
C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3
  4

  6

 40
0.0
 41
0.0
 42
0.0
 43
0.0
 44
0.0
 45
0.0
 46
0.0
 47
0.0
 48
0.0
 49
0.0
140
0.0
141
0.0
142
1.0
143
1.0
 70
1712
 72
0
 73
0
 74
0
  7

 75
0
147
1.0
148
0.0
149
0.0
100
AcDbLayout
  1
Model
 70
1
 71
0
 10
0.0
 20
0.0
 11
12.0
 21
9.0
 12
0.0
 22
0.0
 32
0.0
 14
0.0
 24
0.0
 34
0.0
 15
0.0
 25
0.0
 35
0.0
146
0.0
 13
0.0
 23
0.0
 33
0.0
 16
1.0
 26
0.0
 36
0.0
 17
0.0
 27
1.0
 37
0.0
 76
0
330
1F
  0
LAYOUT
  5
26
100
AcDbPlotSettings
  1

  2
C:\Program Files\AutoCAD 2002\plotters\DWF ePlot (optimized for plotting).pc3
  4

  6

 40
0.0
 41
0.0
 42
0.0
 43
0.0
 44
0.0
 45
0.0
 46
0.0
 47
0.0
 48
0.0
 49
0.0
140
0.0
141
0.0
142
1.0
143
1.0
 70
688
 72
0
 73
0
 74
5
  7

 75
16
147
1.0
148
0.0
149
0.0
100
AcDbLayout
  1
Layout2
 70
1
 71
2
 10
0.0
 20
0.0
 11
12.0
 21
9.0
 12
0.0
 22
0.0
 32
0.0
 14
0.0
 24
0.0
 34
0.0
 15
0.0
 25
0.0
 35
0.0
146
0.0
 13
0.0
 23
0.0
 33
0.0
 16
1.0
 26
0.0
 36
0.0
 17
0.0
 27
1.0
 37
0.0
 76
0
330
23
  0
DICTIONARY
  5
4C
100
AcDbDictionary
281
1
  3
DIMASSOC
350
4E
  3
HIDETEXT
350
4D
  0
DICTIONARYVAR
  5
4D
100
DictionaryVariables
280
0
  1
2
  0
DICTIONARYVAR
  5
4E
100
DictionaryVariables
280
0
  1
1
  0
ENDSEC
  0
EOF

|







|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
<
>
>
>
>
>
>
>
>
>
>
>
>





<
<
<
<




|
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>

<
>

<
>

<
>
>
>
>
>
>
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>












>
>



|



|
>
>





|

|

<
>

<
>

<
>

<
>

|

|

<
>

<
>

|

|

|

|

<
>

<
>

<
>

<
>

<
>

<
>

|

|

|

<
>

<
>

<
>

<
>

|

|

|

|

<
>

|

|

|

|

|

<
>

<
>

<
>

<
>

<
>

<
>

<
>

<
>

<
>

|

>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








>
>



<
>




>
>







|



|

|

<
>




>
>







|



|

|

<
>




>
>





|

|



|

|

<
>



|
>
>







|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>


|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
|
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>


|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
|
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
|
>







|
>
>
>
>
>
>
>
>
>
>
>
|
<
<
<
<
<
<
<
>
|
<
|
|
>
|
<
<
<
<
<
<
<
>
>
>
|
<
|
|
>
|
<
<
<
<
<
<
<
>
>
>
|
<
|
|



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








>
>



|




>
>







|

|



|










>
>



<
>



<
>
>
>







|

<
>

<
>

<
>

|

<
>












>
>



|








>
>



|








>
>



|




>
>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>








>
>



|



<
>



<
>
>
>







|
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







>
>



<
>




>
>






<
>
>
|
>
>
>



|
>
>






<
<
>
|
<
<
|
<
<
<
<
>
|
<
<
<
>












>
>









|

<
>

<
>

<
>








>
>










>
>


<
<







|

<
>

<
>

<
>








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
|
<
<
<
<
<















|


<
<


>
>

|

|
<
>
|

<
>

<
<
<
>

|

|
<
<



|
<
<

|


>
>

|

|
<
>
|

|

<
<
<
>

|

|
<
<



|


<
<


>
>

|

|
<
>
|

|

<
<
<
>

|

|
<
<



<
>


<
<


>
>

|

|
<
>
|

|

<
<
<
>

|

|
<
<



<
>


<
<


<
<
<
<


>
>
>
>
>
>

|

<
<
<
>

|

|
<
<



<
>


<
<


>
>

|

|
<
>
|

<
>

|
<
<

|

|
<
<



<
>


<
<


>
>

|

|
<
<
<
<
<
<
<
|
>
>
>
>
>

|

|
<
<



<
>


<
<


>
>

|

|
<
>
|

<
>

|
<
<

|

|
<
<



<
>


<
<


>
>

|

|
<
>
|

<
>

|
<
<

|

|
<
<










>
>


<
<

|




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
|

<
>


<
|
<
<
<
|
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<

<
<
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119




120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797

798
799

800
801

802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109

1110
1111

1112
1113

1114
1115

1116
1117
1118
1119
1120
1121

1122
1123

1124
1125
1126
1127
1128
1129
1130
1131
1132
1133

1134
1135

1136
1137

1138
1139

1140
1141

1142
1143

1144
1145
1146
1147
1148
1149
1150
1151

1152
1153

1154
1155

1156
1157

1158
1159
1160
1161
1162
1163
1164
1165
1166
1167

1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179

1180
1181

1182
1183

1184
1185

1186
1187

1188
1189

1190
1191

1192
1193

1194
1195

1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231

1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253

1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275

1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297

1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854







1855
1856

1857
1858
1859
1860







1861
1862
1863
1864

1865
1866
1867
1868







1869
1870
1871
1872

1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259

2260
2261
2262
2263

2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275

2276
2277

2278
2279

2280
2281
2282
2283

2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375

2376
2377
2378
2379

2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517

2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530

2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548


2549
2550


2551




2552
2553



2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579

2580
2581

2582
2583

2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608


2609
2610
2611
2612
2613
2614
2615
2616
2617

2618
2619

2620
2621

2622
2623
2624
2625
2626
2627
2628
2629
2630


























2631



2632





2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650


2651
2652
2653
2654
2655
2656
2657
2658

2659
2660
2661

2662
2663



2664
2665
2666
2667
2668


2669
2670
2671
2672


2673
2674
2675
2676
2677
2678
2679
2680
2681
2682

2683
2684
2685
2686
2687



2688
2689
2690
2691
2692


2693
2694
2695
2696
2697
2698


2699
2700
2701
2702
2703
2704
2705
2706

2707
2708
2709
2710
2711



2712
2713
2714
2715
2716


2717
2718
2719

2720
2721
2722


2723
2724
2725
2726
2727
2728
2729
2730

2731
2732
2733
2734
2735



2736
2737
2738
2739
2740


2741
2742
2743

2744
2745
2746


2747
2748




2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759



2760
2761
2762
2763
2764


2765
2766
2767

2768
2769
2770


2771
2772
2773
2774
2775
2776
2777
2778

2779
2780
2781

2782
2783
2784


2785
2786
2787
2788


2789
2790
2791

2792
2793
2794


2795
2796
2797
2798
2799
2800
2801
2802







2803
2804
2805
2806
2807
2808
2809
2810
2811
2812


2813
2814
2815

2816
2817
2818


2819
2820
2821
2822
2823
2824
2825
2826

2827
2828
2829

2830
2831
2832


2833
2834
2835
2836


2837
2838
2839

2840
2841
2842


2843
2844
2845
2846
2847
2848
2849
2850

2851
2852
2853

2854
2855
2856


2857
2858
2859
2860


2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874


2875
2876
2877
2878
2879
2880




















2881
2882
2883
2884














2885




































2886






















































2887


2888
2889


























































2890















































2891



2892
2893

2894
2895
2896

2897



2898


2899






























2900


















































































2901
2902


























2903






2904


2905


2906






































































































2907
2908
2909
2910
999
dxfrw 0.6.3
  0
SECTION
  2
HEADER
  9
$ACADVER
  1
AC1021
  9
$DWGCODEPAGE
  3
ANSI_1252
  9
$INSBASE
 10
0
 20
0
 30
0
  9
$EXTMIN
 10
0
 20
0
 30
0
  9
$EXTMAX
 10
100
 20
100
 30
0
  9
$LIMMIN
 10
0
 20
0
  9
$LIMMAX
 10
420
 20
297
  9
$ORTHOMODE
 70
    0
  9
$REGENMODE
 70
    1
  9
$FILLMODE
 70
    1
  9
$QTEXTMODE
 70
    0
  9
$MIRRTEXT
 70
    0
  9
$LTSCALE
 40
1
  9
$ATTMODE
 70
    0
  9
$TEXTSIZE
 40
2.5
  9
$TRACEWID
 40
15.68
  9
$TEXTSTYLE
  7
STANDARD
  9
$CLAYER
  8
0
  9
$CELTYPE
  6
BYLAYER
  9
$CECOLOR
 62
  256

  9
$CELTSCALE
 40
1
  9
$DISPSILH
 70
    0
  9
$DIMSCALE
 40
2.5
  9
$DIMASZ
 40
2.5
  9




$DIMEXO
 40
0.625
  9
$DIMDLI
 40
3.75
  9
$DIMRND
 40
0
  9
$DIMDLE
 40
0
  9
$DIMEXE
 40
1.25
  9
$DIMTP
 40
0
  9
$DIMTM
 40
0
  9
$DIMTXT
 40
2.5
  9
$DIMCEN
 40
2.5
  9
$DIMTSZ
 40
0
  9
$DIMTOL
 70
    0
  9
$DIMLIM
 70
    0
  9
$DIMTIH
 70
    0
  9
$DIMTOH
 70
    0
  9
$DIMSE1
 70
    0
  9
$DIMSE2
 70
    0
  9
$DIMTAD
 70
    1
  9
$DIMZIN
 70
    8
  9
$DIMBLK
  1

  9
$DIMASO
 70
    1
  9
$DIMSHO
 70
    1
  9
$DIMPOST
  1

  9
$DIMAPOST
  1

  9
$DIMALT
 70
    0
  9
$DIMALTD
 70
    3
  9
$DIMALTF
 40
0.03937
  9
$DIMLFAC
 40
1
  9
$DIMTOFL
 70
    1
  9
$DIMTVP
 40
0
  9
$DIMTIX
 70
    0
  9
$DIMSOXD
 70
    0
  9
$DIMSAH
 70
    0
  9
$DIMBLK1
  1

  9
$DIMBLK2
  1

  9
$DIMSTYLE
  2
Standard
  9
$DIMCLRD
 70
    0
  9
$DIMCLRE
 70
    0
  9
$DIMCLRT
 70
    0
  9
$DIMTFAC
 40
1
  9
$DIMGAP
 40
0.625
  9
$DIMJUST
 70
    0
  9
$DIMSD1
 70
    0
  9
$DIMSD2
 70
    0
  9
$DIMTOLJ
 70
    0
  9
$DIMTZIN
 70
    8
  9
$DIMALTZ
 70
    0
  9
$DIMALTTZ
 70
    0
  9
$DIMUPT
 70
    0
  9
$DIMDEC
 70
    4
  9
$DIMTDEC
 70
    2
  9
$DIMALTU
 70
    2
  9
$DIMALTTD
 70
    3
  9
$DIMTXSTY
  7
STANDARD
  9
$DIMAUNIT
 70
    0
  9
$DIMADEC
 70
    0
  9
$DIMALTRND
 40
0
  9
$DIMAZIN
 70
    0
  9
$DIMDSEP
 70
   44
  9
$DIMATFIT
 70
    3
  9
$DIMFRAC
 70
    0
  9
$DIMLDRBLK
  1
STANDARD
  9
$DIMLUNIT
 70
    2
  9
$DIMLWD
 70
   -2
  9
$DIMLWE
 70
   -2
  9
$DIMTMOVE
 70
    0
  9
$DIMFXL
 40
1
  9
$DIMFXLON
 70
    0
  9
$DIMJOGANG
 40
0.7854
  9
$DIMTFILL
 70
    0
  9
$DIMTFILLCLR
 70
    0
  9
$DIMARCSYM
 70
    0
  9
$DIMLTYPE
  6

  9
$DIMLTEX1
  6

  9
$DIMLTEX2
  6

  9
$LUNITS
 70
    2
  9
$LUPREC
 70
    4
  9
$SKETCHINC
 40
1
  9
$FILLETRAD
 40
0
  9
$AUNITS
 70
    0
  9
$AUPREC
 70
    2
  9
$MENU
  1
.
  9
$ELEVATION
 40
0
  9
$PELEVATION
 40
0
  9
$THICKNESS
 40
0
  9
$LIMCHECK
 70
    0
  9
$CHAMFERA
 40
0
  9
$CHAMFERB
 40
0
  9
$CHAMFERC
 40
0
  9
$CHAMFERD
 40
0
  9
$SKPOLY
 70
    0
  9
$USRTIMER
 70
    1
  9
$ANGBASE
 50
0
  9
$ANGDIR
 70
    0
  9
$PDMODE
 70
   96
  9
$PDSIZE
 40
-2
  9
$PLINEWID
 40
0
  9
$SPLFRAME
 70
    0
  9
$SPLINETYPE
 70
    2
  9
$SPLINESEGS
 70
    8
  9
$HANDSEED
  5
20000
  9
$SURFTAB1
 70
    6
  9
$SURFTAB2
 70
    6
  9
$SURFTYPE
 70
    6
  9
$SURFU
 70
    6
  9
$SURFV
 70
    6
  9
$UCSBASE
  2

  9
$UCSNAME
  2

  9
$UCSORG
 10
0
 20
0
 30
0
  9
$UCSXDIR
 10
1
 20
0
 30
0
  9
$UCSYDIR
 10
0
 20
1
 30
0
  9
$UCSORTHOREF
  2

  9
$UCSORTHOVIEW
 70
    0
  9
$UCSORGTOP
 10
0
 20
0
 30
0
  9
$UCSORGBOTTOM
 10
0
 20
0
 30
0
  9
$UCSORGLEFT
 10
0
 20
0
 30
0
  9
$UCSORGRIGHT
 10
0
 20
0
 30
0
  9
$UCSORGFRONT
 10
0
 20
0
 30
0
  9
$UCSORGBACK
 10
0
 20
0
 30
0
  9
$PUCSBASE
  2

  9
$PUCSNAME
  2

  9
$PUCSORG
 10
0
 20
0
 30
0
  9
$PUCSXDIR
 10
1
 20
0
 30
0
  9
$PUCSYDIR
 10
0
 20
1
 30
0
  9
$PUCSORTHOREF
  2

  9
$PUCSORTHOVIEW
 70
    0
  9
$PUCSORGTOP
 10
0
 20
0
 30
0
  9
$PUCSORGBOTTOM
 10
0
 20
0
 30
0
  9
$PUCSORGLEFT
 10
0
 20
0
 30
0
  9
$PUCSORGRIGHT
 10
0
 20
0
 30
0
  9
$PUCSORGFRONT
 10
0
 20
0
 30
0
  9
$PUCSORGBACK
 10
0
 20
0
 30
0
  9
$USERI1
 70
    0
  9
$USERI2
 70
    0
  9
$USERI3
 70
    0
  9
$USERI4
 70
    0
  9
$USERI5
 70
    0
  9
$USERR1
 40
0
  9
$USERR2
 40
0
  9
$USERR3
 40
0
  9
$USERR4
 40
0
  9
$USERR5
 40
0
  9
$WORLDVIEW
 70
    1
  9
$SHADEDGE
 70
    3
  9
$SHADEDIF
 70
   70
  9
$TILEMODE
 70
    1
  9
$MAXACTVP
 70
   64
  9
$PINSBASE
 10
0
 20
0
 30
0
  9
$PLIMCHECK
 70
    0
  9
$PEXTMIN
 10
0
 20
0
 30
0
  9
$PEXTMAX
 10

0
 20

0
 30

0
  9
$GRIDMODE
 70
    1
  9
$SNAPSTYLE
 70
    0
  9
$PLIMMIN
 10
0
 20
0
  9
$PLIMMAX
 10
210
 20
297
  9
$UNITMODE
 70
    0
  9
$VISRETAIN
 70
    1
  9
$PLINEGEN
 70
    0
  9
$PSLTSCALE
 70
    1
  9
$TREEDEPTH
 70
 3020
  9
$CMLSTYLE
  2
Standard
  9
$CMLJUST
 70
    0
  9
$CMLSCALE
 40
20
  9
$PROXYGRAPHICS
 70
    1
  9
$MEASUREMENT
 70
    1
  9
$CELWEIGHT
370
   -1
  9
$ENDCAPS
280
    1
  9
$JOINSTYLE
280
    1
  9
$LWDISPLAY
290
    0
  9
$INSUNITS
 70
    4
  9
$HYPERLINKBASE
  1

  9
$STYLESHEET
  1

  9
$XEDIT
290
    1
  9
$CEPSNTYPE
380
    0
  9
$PSTYLEMODE
290
    1
  9
$EXTNAMES
290
    1
  9
$PSVPSCALE
 40
1
  9
$OLESTARTUP
290
    0
  9
$SORTENTS
280
  127
  9
$INDEXCTL
280
    0
  9
$HIDETEXT
280
    1
  9
$XCLIPFRAME
290
    0
  9
$HALOGAP
280
    0
  9
$OBSCOLOR
 70
  257
  9
$OBSLTYPE
280
    0
  9
$INTERSECTIONDISPLAY
280
    0
  9
$INTERSECTIONCOLOR
 70
  257
  9
$DIMASSOC
280
    1
  9
$PROJECTNAME
  1

  9
$CAMERADISPLAY
290
    0
  9
$LENSLENGTH
 40
50
  9
$CAMERAHEIGHT
 40
0
  9
$STEPSPERSEC
 40
2
  9
$STEPSIZE
 40
50
  9
$3DDWFPREC
 40
2
  9
$PSOLWIDTH
 40
5
  9
$PSOLHEIGHT
 40
80
  9
$LOFTANG1
 40
1.570796326794897
  9
$LOFTANG2
 40
1.570796326794897
  9
$LOFTMAG1
 40
0
  9
$LOFTMAG2
 40
0
  9
$LOFTPARAM
 70
    7
  9
$LOFTNORMALS
280
    1
  9
$LATITUDE
 40
1
  9
$LONGITUDE
 40
1
  9
$NORTHDIRECTION
 40
0
  9
$TIMEZONE
 70
-8000
  9
$LIGHTGLYPHDISPLAY
280
    1
  9
$TILEMODELIGHTSYNCH
280
    1
  9
$SOLIDHIST
280
    1
  9
$SHOWHIST
280
    1
  9
$DWFFRAME
280
    2
  9
$DGNFRAME
280
    0
  9
$REALWORLDSCALE
290
    1
  9
$INTERFERECOLOR
 62
    1
  9
$CSHADOW
280
    0
  9
$SHADOWPLANELOCATION
 40
0
  0
ENDSEC
  0
SECTION
  2
CLASSES
  0
ENDSEC
  0
SECTION
  2
TABLES
  0
TABLE
  2
VPORT
  5
8
330
0
100
AcDbSymbolTable
 70
    1
  0
VPORT
  5
31
330
2
100
AcDbSymbolTableRecord
100
AcDbViewportTableRecord
  2
*ACTIVE
 70
    0
 10

0
 20

0
 11

1
 21

1
 12
140.688488958444
 22
93.0455717846185
 13

0
 23

0
 14
10
 24
10
 15
10
 25
10
 16

0
 26

0
 36

1
 17

0
 27

0
 37

0
 40
276.0003477656099
 41
1.54978354978355
 42
50
 43

0
 44

0
 50

0
 51

0
 71
    0
 72
  100
 73
    1
 74
    3
 75

    0
 76
    1
 77
    0
 78
    0
281
    0
 65
    1
110

0
120

0
130

0
111

1
121

0
131

0
112

0
122

1
132

0
 79
    0
146
0
348
10020
 60
    7
 61
    5
292
1
282
    1
141
0
142
0
 63
  250
421
3358443
  0
ENDTAB
  0
TABLE
  2
LTYPE
  5
5
330
0
100
AcDbSymbolTable
 70

    4
  0
LTYPE
  5
14
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
ByBlock
 70
    0
  3

 72
   65
 73
    0
 40

0
  0
LTYPE
  5
15
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
ByLayer
 70
    0
  3

 72
   65
 73
    0
 40

0
  0
LTYPE
  5
16
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
Continuous
 70
    0
  3
Solid line
 72
   65
 73
    0
 40

0
  0
LTYPE
  5
32
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DOT
 70
    0
  3
Dot . . . . . . . . . . . . . . . . . . . . . .
 72
   65
 73
    2
 40
6.35
 49
0
 74
    0
 49
-6.35
 74
    0
  0
LTYPE
  5
33
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DOTTINY
 70
    0
  3
Dot (.15x) .....................................
 72
   65
 73
    2
 40
0.9525
 49
0
 74
    0
 49
-0.9525
 74
    0
  0
LTYPE
  5
34
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DOT2
 70
    0
  3
Dot (.5x) .....................................
 72
   65
 73
    2
 40
3.175
 49
0
 74
    0
 49
-3.175
 74
    0
  0
LTYPE
  5
35
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DOTX2
 70
    0
  3
Dot (2x) .  .  .  .  .  .  .  .  .  .  .  .  .
 72
   65
 73
    2
 40
12.7
 49
0
 74
    0
 49
-12.7
 74
    0
  0
LTYPE
  5
36
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHED
 70
    0
  3
Dashed _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 72
   65
 73
    2
 40
19.05
 49
12.7
 74
    0
 49
-6.35
 74
    0
  0
LTYPE
  5
37
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHEDTINY
 70
    0
  3
Dashed (.15x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 72
   65
 73
    2
 40
2.8575
 49
1.905
 74
    0
 49
-0.9525
 74
    0
  0
LTYPE
  5
38
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHED2
 70
    0
  3
Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 72
   65
 73
    2
 40
9.524999999999999
 49
6.35
 74
    0
 49
-3.175
 74
    0
  0
LTYPE
  5
39
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHEDX2
 70
    0
  3
Dashed (2x) ____  ____  ____  ____  ____  ___
 72
   65
 73
    2
 40
38.09999999999999
 49
25.4
 74
    0
 49
-12.7
 74
    0
  0
LTYPE
  5
3A
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHDOT
 70
    0
  3
Dash dot __ . __ . __ . __ . __ . __ . __ . __
 72
   65
 73
    4
 40
25.4
 49
12.7
 74
    0
 49
-6.35
 74
    0
 49
0
 74
    0
 49
-6.35
 74
    0
  0
LTYPE
  5
3B
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHDOTTINY
 70
    0
  3
Dash dot (.15x) _._._._._._._._._._._._._._._.
 72
   65
 73
    4
 40
3.81
 49
1.905
 74
    0
 49
-0.9525
 74
    0
 49
0
 74
    0
 49
-0.9525
 74
    0
  0
LTYPE
  5
3C
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHDOT2
 70
    0
  3
Dash dot (.5x) _._._._._._._._._._._._._._._.
 72
   65
 73
    4
 40
12.7
 49
6.35
 74
    0
 49
-3.175
 74
    0
 49
0
 74
    0
 49
-3.175
 74
    0
  0
LTYPE
  5
3D
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DASHDOTX2
 70
    0
  3
Dash dot (2x) ____  .  ____  .  ____  .  ___
 72
   65
 73
    4
 40
50.8
 49
25.4
 74
    0
 49
-12.7
 74
    0
 49
0
 74
    0
 49
-12.7
 74
    0
  0
LTYPE
  5
3E
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DIVIDE
 70
    0
  3
Divide ____ . . ____ . . ____ . . ____ . . ____
 72
   65
 73
    6
 40
31.75
 49
12.7
 74
    0
 49
-6.35
 74
    0
 49
0
 74
    0
 49
-6.35
 74
    0
 49
0
 74
    0
 49
-6.35
 74
    0
  0
LTYPE
  5
3F
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DIVIDETINY
 70
    0
  3
Divide (.15x) __..__..__..__..__..__..__..__.._
 72
   65
 73
    6
 40
4.7625
 49
1.905
 74
    0
 49
-0.9525
 74
    0
 49
0
 74
    0
 49
-0.9525
 74
    0
 49
0
 74
    0
 49
-0.9525
 74
    0
  0
LTYPE
  5
40
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DIVIDE2
 70
    0
  3
Divide (.5x) __..__..__..__..__..__..__..__.._
 72
   65
 73
    6
 40
15.875
 49
6.35
 74
    0
 49
-3.175
 74
    0
 49
0
 74
    0
 49
-3.175
 74
    0
 49
0
 74
    0
 49
-3.175
 74
    0
  0
LTYPE
  5
41
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
DIVIDEX2
 70
    0
  3
Divide (2x) ________  .  .  ________  .  .  _
 72
   65
 73
    6
 40
63.5
 49
25.4
 74
    0







 49
-12.7

 74
    0
 49
0







 74
    0
 49
-12.7

 74
    0
 49
0







 74
    0
 49
-12.7

 74
    0
  0
LTYPE
  5
42
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
BORDER
 70
    0
  3
Border __ __ . __ __ . __ __ . __ __ . __ __ .
 72
   65
 73
    6
 40
44.45
 49
12.7
 74
    0
 49
-6.35
 74
    0
 49
12.7
 74
    0
 49
-6.35
 74
    0
 49
0
 74
    0
 49
-6.35
 74
    0
  0
LTYPE
  5
43
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
BORDERTINY
 70
    0
  3
Border (.15x) __.__.__.__.__.__.__.__.__.__.__.
 72
   65
 73
    6
 40
6.6675
 49
1.905
 74
    0
 49
-0.9525
 74
    0
 49
1.905
 74
    0
 49
-0.9525
 74
    0
 49
0
 74
    0
 49
-0.9525
 74
    0
  0
LTYPE
  5
44
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
BORDER2
 70
    0
  3
Border (.5x) __.__.__.__.__.__.__.__.__.__.__.
 72
   65
 73
    6
 40
22.225
 49
6.35
 74
    0
 49
-3.175
 74
    0
 49
6.35
 74
    0
 49
-3.175
 74
    0
 49
0
 74
    0
 49
-3.175
 74
    0
  0
LTYPE
  5
45
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
BORDERX2
 70
    0
  3
Border (2x) ____  ____  .  ____  ____  .  ___
 72
   65
 73
    6
 40
88.89999999999999
 49
25.4
 74
    0
 49
-12.7
 74
    0
 49
25.4
 74
    0
 49
-12.7
 74
    0
 49
0
 74
    0
 49
-12.7
 74
    0
  0
LTYPE
  5
46
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
CENTER
 70
    0
  3
Center ____ _ ____ _ ____ _ ____ _ ____ _ ____
 72
   65
 73
    4
 40
50.8
 49
31.75
 74
    0
 49
-6.35
 74
    0
 49
6.35
 74
    0
 49
-6.35
 74
    0
  0
LTYPE
  5
47
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
CENTERTINY
 70
    0
  3
Center (.15x) ___ _ ___ _ ___ _ ___ _ ___ _ ___
 72
   65
 73
    4
 40
7.619999999999999
 49
4.7625
 74
    0
 49
-0.9525
 74
    0
 49
0.9525
 74
    0
 49
-0.9525
 74
    0
  0
LTYPE
  5
48
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
CENTER2
 70
    0
  3
Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___
 72
   65
 73
    4
 40
28.575
 49
19.05
 74
    0
 49
-3.175
 74
    0
 49
3.175
 74
    0
 49
-3.175
 74
    0
  0
LTYPE
  5
49
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
  2
CENTERX2
 70
    0
  3
Center (2x) ________  __  ________  __  _____
 72
   65
 73
    4
 40
101.6
 49
63.5
 74
    0
 49
-12.7
 74
    0
 49
12.7
 74
    0
 49
-12.7
 74
    0
  0
ENDTAB
  0
TABLE
  2
LAYER
  5
2
330
0
100
AcDbSymbolTable
 70
    1
  0
LAYER
  5
10
330
2
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
  2
0
 70
    0
 62
    7
  6
CONTINUOUS
370
    0
390
F
  0
ENDTAB
  0
TABLE
  2
STYLE
  5
3
330
0
100
AcDbSymbolTable
 70

    3
  0
STYLE
  5

4A
330
2
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
  2
Standard
 70
    0
 40

0
 41

1
 50

0
 71
    0
 42

1
  3
txt
  4

  0
ENDTAB
  0
TABLE
  2
VIEW
  5
6
330
0
100
AcDbSymbolTable
 70
    0
  0
ENDTAB
  0
TABLE
  2
UCS
  5
7
330
0
100
AcDbSymbolTable
 70
    0
  0
ENDTAB
  0
TABLE
  2
APPID
  5
9
330
0
100
AcDbSymbolTable
 70
    1
  0
APPID
  5
12
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
  2
ACAD
 70
    0
  0
APPID
  5
4B
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
  2
LibreCad
 70
    0
  0
ENDTAB
  0
TABLE
  2
DIMSTYLE
  5
A
330
0
100
AcDbSymbolTable
 70
    1
100
AcDbDimStyleTable
 71

    1
  0
DIMSTYLE
105

4C
330
A
100
AcDbSymbolTableRecord
100
AcDbDimStyleTableRecord
  2
Standard
 70
    0
 40
1
 41
2.5
 42
0.625
 43
0.38
 44
1.25
 45
0
 46
0
 47
0
 48
0
 49
1
140
2.5
141
0.09
142
2.5
143
25.4
144
1
145
0
146
1
147
0.625
148
0
 71
    0
 72
    0
 73
    0
 74
    1
 75
    0
 76
    0
 77
    0
 78
    1
 79
    0
170
    0
171
    2
172
    0
173
    0
174
    0
175
    0
176
    0
177
    0
178
    0
179
    0
271
    4
272
    4
273
    2
274
    2
275
    0
276
    0
277
    2
278
    0
279
    0
280
    0
281
    0
282
    0
283
    1
284
    0
285
    0
286
    0
288
    0
289
    3
340
4A
  0
ENDTAB
  0
TABLE
  2
BLOCK_RECORD
  5
1
330
0
100
AcDbSymbolTable
 70

    2
  0
BLOCK_RECORD
  5
1F
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
  2
*Model_Space

 70
    0
280
    1
281
    0
  0
BLOCK_RECORD
  5
1E
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
  2
*Paper_Space


 70
    0


280




    1
281



    0
  0
ENDTAB
  0
ENDSEC
  0
SECTION
  2
BLOCKS
  0
BLOCK
  5
20
330
1F
100
AcDbEntity
  8
0
100
AcDbBlockBegin
  2
*Model_Space
 70
    0
 10

0
 20

0
 30

0
  3
*Model_Space
  1

  0
ENDBLK
  5
21
330
1F
100
AcDbEntity
  8
0
100
AcDbBlockEnd
  0
BLOCK
  5
1C
330
1B
100
AcDbEntity


  8
0
100
AcDbBlockBegin
  2
*Paper_Space
 70
    0
 10

0
 20

0
 30

0
  3
*Paper_Space
  1

  0
ENDBLK
  5
1D


























330



1F





100
AcDbEntity
  8
0
100
AcDbBlockEnd
  0
ENDSEC
  0
SECTION
  2
ENTITIES
  0
LINE
  5
4D
100
AcDbEntity


  8
0
  6
ByLayer
 62
  256
370
   -3

100
AcDbLine
 10

0
 20



0
 11
100
 21
100


  0
LINE
  5
4E


100
AcDbEntity
  8
0
  6
ByLayer
 62
  256
370
   -3

100
AcDbLine
 10
20
 20



0
 11
100
 21
80


  0
LINE
  5
4F
100
AcDbEntity


  8
0
  6
ByLayer
 62
  256
370
   -3

100
AcDbLine
 10
40
 20



0
 11
100
 21
60


  0
LINE
  5

50
100
AcDbEntity


  8
0
  6
ByLayer
 62
  256
370
   -3

100
AcDbLine
 10
60
 20



0
 11
100
 21
40


  0
LINE
  5

51
100
AcDbEntity


  8
0




  6
ByLayer
 62
  256
370
   -3
100
AcDbLine
 10
80
 20



0
 11
100
 21
20


  0
LINE
  5

52
100
AcDbEntity


  8
0
  6
ByLayer
 62
  256
370
   -3

100
AcDbLine
 10

0
 20
20


 11
80
 21
100


  0
LINE
  5

53
100
AcDbEntity


  8
0
  6
ByLayer
 62
  256
370
   -3







100
AcDbLine
 10
0
 20
40
 11
60
 21
100


  0
LINE
  5

54
100
AcDbEntity


  8
0
  6
ByLayer
 62
  256
370
   -3

100
AcDbLine
 10

0
 20
60


 11
40
 21
100


  0
LINE
  5

55
100
AcDbEntity


  8
0
  6
ByLayer
 62
  256
370
   -3

100
AcDbLine
 10

0
 20
80


 11
20
 21
100


  0
ENDSEC
  0
SECTION
  2
OBJECTS
  0
DICTIONARY
  5
C
330
0
100
AcDbDictionary


281
    1
  3
ACAD_GROUP
350
D




















  0
DICTIONARY
  5
D














330




































C






















































100


AcDbDictionary
281


























































    1















































  0



PLOTSETTINGS
  5

56
100
AcDbPlotSettings

  6



1x1


 40






























0


















































































 41
0


























 42






0


 43


0






































































































  0
ENDSEC
  0
EOF

Added plugins/iso_fittings/iso_fittings.cpp.









































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
#include <QSettings>
#include <QMessageBox>
#include <QDoubleValidator>
#include <cmath>
#include <csignal>
#include <qabstractitemview.h>
#include <qboxlayout.h>
#include <qcontainerfwd.h>
#include <qdialog.h>
#include <qdockwidget.h>
#include <qforeach.h>
#include <qgridlayout.h>
#include <qhashfunctions.h>
#include <qmainwindow.h>
#include <qmessagebox.h>
#include <qnamespace.h>
#include <qtablewidget.h>
#include <qtextedit.h>
#include <qtoolbutton.h>
#include <qwidget.h>

#include "document_interface.h"

#include "iso_tables.h"
#include "iso_fittings.h"

#include "../../librecad/src/ui/components/layouts/lc_flexlayout.h"
#include "../../librecad/src/ui/components/layouts/lc_flexlayout.cpp"
#include "ui_iso_form.h"


lc_iso_fittings_dlg* plugin_form;


QString LC_iso_fittings::name() const
 {
     return (tr("ISO tolerances plugin"));
 }

PluginCapabilities LC_iso_fittings::getCapabilities() const
{
    PluginCapabilities pluginCapabilities;
    pluginCapabilities.menuEntryPoints
      << PluginMenuLocation("plugins_menu", tr("ISO tolerances table"),"table", "Ctrl+Shift+T")
      << PluginMenuLocation("plugins_menu",  tr("Fix tolerances"), "fix", "Ctrl+Shift+F")
      << PluginMenuLocation("plugins_menu",  tr("Clear tolerances"), "clr", "Ctrl+Shift+G");
    return pluginCapabilities;
}


Ui::dlgFittings formFittings;


void LC_iso_fittings::execComm([[maybe_unused]] Document_Interface *doc,
                             QWidget *parent, [[maybe_unused]] QString cmd)
{
    QHash<int, QVariant> data;
    QList<Plug_Entity*> eList;
    Plug_Entity* ent;

    if (cmd == "fix" || cmd == "clr") {

        uint total = 0;

        if (doc->getAllEntities(&eList, true)) {

            for (int i=0; i<eList.size(); i++) {
                ent = eList.at(i);
                ent->getData(&data);

                if (data.value(DPI::VISIBLE) == 1) {

                    int tp = data.value(DPI::ETYPE).toInt();

                    switch (tp) {
                    case DPI::DIMLINEAR:
                    case DPI::DIMALIGNED:
                    case DPI::DIMDIAMETRIC:
                    case DPI::DIMRADIAL:
                        QString txt = data.value(DPI::TEXTCONTENT).toString();
                        double sz = data.value(DPI::SIZEU).toDouble();

                        QStringList lst1 = txt.split("<>");

                        if (lst1.size() < 2) continue;
                        txt = lst1[0];

                        QStringList lst2 = lst1[1].split("\\S");

                        if (lst2.size() == 0) continue;

                        int i;
                        int j;

                        for (i = 0; i<lst2[0].length(); i++) if ((lst2[0][i] >= 'a' && lst2[0][i] <= 'z') || (lst2[0][i] >= 'A' && lst2[0][i] <= 'Z')) break;

                        if (i>=lst2[0].length()) continue;

                        QString pr = lst2[0].left(i);

                        for (j = i; j < lst2[0].length(); j++) if (lst2[0][j] >= '0' && lst2[0][j] <= '9') break;

                        if (j >= lst2[0].length()) continue;

                        QString tc = lst2[0].mid(i, j-i);

                        i = j;
                        for (j = i; j < lst2[0].length(); j++) if (!(lst2[0][j] >= '0' && lst2[0][j] <= '9')) break;

                        QString gr = lst2[0].mid(i, j-i);
                        QString sx = lst2[0].right(lst2[0].length()-j);

                        toleranceIT tol = getTolerance(sz, tc, gr);

                        QString tsu = (tol.upper < 0.0) ? QString::number(tol.upper/1000.0) : "+" + QString::number(tol.upper/1000.0);
                        QString tsl = (tol.lower > 0.0) ? "+" + QString::number(tol.lower/1000.0) : (tol.lower < 0) ? QString::number(tol.lower/1000.0) : "-" + QString::number(tol.lower/1000.0);

                        if (cmd == "fix") {
                            data.insert(DPI::TEXTCONTENT, txt + "<>" + pr + tc + gr + sx + "\\S" + tsu + "^" + tsl + ";");
                        } else {
                            data.insert(DPI::TEXTCONTENT, txt + "<>" + pr + tc + gr + sx);
                        }
                        ent->updateData(&data);

                        total++;
                        break;
                    }
                }
                data.clear();
            }

const QString help = tr(R"""(
There is no dimensions with ISO tolerances in your drawing.

In order to use this function, format your dimensions to include some
ISO tolerance codes.

Example for such dimension: "⌀<> JS8" - here JS8 means "hole, class JS, grade 8".

All custom text included in the dimension is preserved.

For the possible classes and grades, see "ISO tolerance table" in the plugins menu.
)""");

            if (total == 0) {
              QMessageBox::information(parent, tr("Tolerances fix"), help);
            } else {
                QTextEdit* log = qobject_cast<QMainWindow*>(parent)->findChild<QTextEdit *>("teHistory");
                log->append(QString::number(total) + " " + tr("dimensions were fixed."));
            }

            doc->unselectEntities();
            doc->updateView();
        }
    } else {

      if (plugin_form == nullptr) plugin_form = new lc_iso_fittings_dlg(parent);
      plugin_form->show();
    }
}



lc_iso_fittings_dlg::lc_iso_fittings_dlg(QWidget *parent) :  QDockWidget(parent)
{
    formFittings.setupUi(this);
    fixLayout();
    readSettings();
}


void lc_iso_fittings_dlg::processAction([[maybe_unused]] Document_Interface *doc)
{
}


lc_iso_fittings_dlg::~lc_iso_fittings_dlg()
{
}


void lc_iso_fittings_dlg::closeEvent(QCloseEvent *event)
 {
    writeSettings();
    QWidget::closeEvent(event);
 }


void lc_iso_fittings_dlg::readSettings()
 {
    QSettings settings(QSettings::IniFormat, QSettings::UserScope, "LibreCAD", "iso_fittings_plugin");
    QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
    QSize size = settings.value("size", QSize(430,140)).toSize();

    resize(size);
    move(pos);
 }


void lc_iso_fittings_dlg::writeSettings()
 {
    QSettings settings(QSettings::IniFormat, QSettings::UserScope, "LibreCAD", "iso_fittings_plugin");
    settings.setValue("pos", pos());
    settings.setValue("size", size());
 }


void lc_iso_fittings_dlg::fixLayout() {
    QWidget* pt = findChild<QWidget *>("dockWidgetContents");

    flex_holes = new LC_FlexLayout();
    flex_shafts = new LC_FlexLayout();

    qobject_cast<QVBoxLayout*>(pt->layout())->insertLayout(0,flex_holes);
    qobject_cast<QVBoxLayout*>(pt->layout())->insertLayout(1,flex_shafts);

    flex_holes->fillFromLayout(pt->findChild<QHBoxLayout *>("layoutHoles"));
    flex_shafts->fillFromLayout(pt->findChild<QHBoxLayout *>("layoutShafts"));
}


double sizes[] = {3, 6, 10, 14, 18, 24, 30, 40, 50, 65, 80, 100,
                  120, 140, 160, 180, 200, 225, 250, 280, 315, 355, 400,
                  450, 500, 560, 630, 710, 800, 900, 1000, 1120, 1250, 1400,
                  1600, 1800, 2000, 2240, 2500, 2800, 3150};

QString grades[] = {"01", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"};


void lc_iso_fittings_dlg::UpdateTable(bool checked) {
  if (checked) {

    QToolButton* btn = qobject_cast<QToolButton*>(sender());

    QString cls = btn->text();

    for (uint i = 0; i < std::size(grades); i++) formFittings.tableTolerances->horizontalHeaderItem(i)->setText(cls+grades[i]);

    for (uint i = 0; i < std::size(grades); i++) {
      QString gr = grades[i];
      QString prev = "0";
      for (uint j = 0; j < std::size(sizes); j++) {

        QString szs = QString::number(sizes[j]);
        formFittings.tableTolerances->verticalHeaderItem(j)->setText(prev+" - "+szs);
        prev = szs;

        toleranceIT tol = getTolerance(sizes[j],cls, gr);

        QTableWidgetItem* item = formFittings.tableTolerances->item(j, i);
        if (item == nullptr) {
          item = new QTableWidgetItem;
          formFittings.tableTolerances->setItem(j,i,item);
        };

        if ( std::isnan(tol.upper) || std::isnan(tol.lower)) {
          item->setText("");
          item->setBackground(Qt::lightGray);
        } else {
          QString tsu = (tol.upper < 0.0) ? QString::number(tol.upper/1000.0) : "+" + QString::number(tol.upper/1000.0);
          QString tsl = (tol.lower > 0.0) ? "+" + QString::number(tol.lower/1000.0) : (tol.lower < 0) ? QString::number(tol.lower/1000.0) : "-" + QString::number(tol.lower/1000.0);
          item->setText(tsu + "\n" + tsl);
          item->setBackground(Qt::white);
        }
      }
    }

    formFittings.tableTolerances->resizeColumnsToContents();
    formFittings.tableTolerances->resizeRowsToContents();
    formFittings.tableTolerances->scrollToItem(formFittings.tableTolerances->currentItem(),QAbstractItemView::PositionAtCenter );
  }
}

Added plugins/iso_fittings/iso_fittings.h.



































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

#ifndef ISO_FITTINGS_H
#define ISO_FITTINGS_H

#include "../../librecad/src/ui/components/layouts/lc_flexlayout.h"
#include "qc_plugininterface.h"
#include <QDialog>
#include <qdockwidget.h>
class QLineEdit;

class LC_iso_fittings : public QObject, QC_PluginInterface
{
    Q_OBJECT
    Q_INTERFACES(QC_PluginInterface)
    Q_PLUGIN_METADATA(IID LC_DocumentInterface_iid FILE  "iso_fittings.json")

 public:
    virtual PluginCapabilities getCapabilities() const Q_DECL_OVERRIDE;
    virtual QString name() const Q_DECL_OVERRIDE;
    virtual void execComm(Document_Interface *doc,
                          QWidget *parent, QString cmd) Q_DECL_OVERRIDE;
};

class lc_iso_fittings_dlg : public QDockWidget
{
    Q_OBJECT

public:
    explicit lc_iso_fittings_dlg(QWidget *parent = 0);
    ~lc_iso_fittings_dlg() override;

public slots:
//    void processAction(QStringList *commandList);
    void processAction(Document_Interface *doc);
    void UpdateTable(bool checked);

protected:
    void closeEvent(QCloseEvent *event) override;

private:
    void readSettings();
    void writeSettings();
    void fixLayout();

    LC_FlexLayout* flex_holes;
    LC_FlexLayout* flex_shafts;
};

#endif // ISO_FITTINGS_H

Added plugins/iso_fittings/iso_fittings.json.



>
1
  { "Keys": [ ] }

Added plugins/iso_fittings/iso_fittings.pro.





















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#-------------------------------------------------
#
# Project created by QtCreator 2011-03-22T19:33:11
#
#-------------------------------------------------

QT       += widgets
TEMPLATE = lib
CONFIG += plugin
VERSION = 1.0.1
TARGET = $$qtLibraryTarget(iso_fittings)

GENERATED_DIR = ../../generated/plugin/iso_fittings
# Use common project definitions.
include(../../common.pri)

# For plugins
INCLUDEPATH    += ../../librecad/src/plugins
INCLUDEPATH    += ../../generated/librecad/ui
INCLUDEPATH    += ../../generated/plugin/iso_fittings/ui/

SOURCES += iso_tables.cpp
SOURCES += iso_fittings.cpp

HEADERS += iso_tables.h
HEADERS += iso_fittings.h
HEADERS += ../../generated/plugin/iso_fittings/ui/ui_iso_form.h

FORMS += iso_form.ui

# Installation Directory
win32 {
        DESTDIR = ../../windows/resources/plugins
}
unix {
    macx {
        DESTDIR = ../../LibreCAD.app/Contents/Resources/plugins
    }
    else {
        DESTDIR = ../../unix/resources/plugins
    }
}

Added plugins/iso_fittings/iso_form.ui.

















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <author>johnfound</author>
 <class>dlgFittings</class>
 <widget class="QDockWidget" name="dlgFittings">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>805</width>
    <height>617</height>
   </rect>
  </property>
  <property name="minimumSize">
   <size>
    <width>64</width>
    <height>64</height>
   </size>
  </property>
  <property name="floating">
   <bool>true</bool>
  </property>
  <property name="windowTitle">
   <string>ISO fittings helper</string>
  </property>
  <widget class="QWidget" name="dockWidgetContents">
   <property name="sizePolicy">
    <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1">
    <item>
     <layout class="QHBoxLayout" name="layoutShafts">
      <property name="spacing">
       <number>2</number>
      </property>
      <property name="sizeConstraint">
       <enum>QLayout::SetMinimumSize</enum>
      </property>
      <property name="rightMargin">
       <number>0</number>
      </property>
      <property name="bottomMargin">
       <number>0</number>
      </property>
      <item>
       <widget class="QToolButton" name="btnClass_a">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">a</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_b">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">b</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_c">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">c</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_cd">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">cd</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_d">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">d</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_e">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">e</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_ef">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">ef</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_f">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">f</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_fg">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">fg</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_g">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">g</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_h">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">h</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_js">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">js</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_j">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">j</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_k">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">k</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_m">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">m</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_n">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">n</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_p">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">p</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_r">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">r</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_s">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">s</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_t">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">t</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_u">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">u</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_v">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">v</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_x">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">x</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_y">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">y</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_z">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">z</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_za">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">za</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_zb">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">zb</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_zc">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Shaft tolerance</string>
        </property>
        <property name="text">
         <string notr="true">zc</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <layout class="QHBoxLayout" name="layoutHoles">
      <property name="spacing">
       <number>2</number>
      </property>
      <property name="sizeConstraint">
       <enum>QLayout::SetDefaultConstraint</enum>
      </property>
      <property name="topMargin">
       <number>0</number>
      </property>
      <property name="rightMargin">
       <number>0</number>
      </property>
      <property name="bottomMargin">
       <number>0</number>
      </property>
      <item>
       <widget class="QToolButton" name="btnClass_A">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">A</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_B">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">B</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_C">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">C</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_CD">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">CD</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_D">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">D</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_E">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">E</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_EF">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">EF</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_F">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">F</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_FG">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">FG</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_G">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">G</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_H">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">H</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_JS">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">JS</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_J">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">J</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_K">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">K</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_M">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">M</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_N">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">N</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_P">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">P</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_R">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">R</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_S">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">S</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_T">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">T</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_U">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">U</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_V">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">V</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_X">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">X</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_Y">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">Y</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_Z">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">Z</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_ZA">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">ZA</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_ZB">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">ZB</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="btnClass_ZC">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
          <width>28</width>
          <height>24</height>
         </size>
        </property>
        <property name="toolTip">
         <string>Hole tolerance</string>
        </property>
        <property name="text">
         <string notr="true">ZC</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="checked">
         <bool>false</bool>
        </property>
        <property name="autoExclusive">
         <bool>true</bool>
        </property>
        <property name="toolButtonStyle">
         <enum>Qt::ToolButtonTextOnly</enum>
        </property>
        <property name="autoRaise">
         <bool>false</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QTableWidget" name="tableTolerances">
      <property name="enabled">
       <bool>true</bool>
      </property>
      <property name="mouseTracking">
       <bool>false</bool>
      </property>
      <property name="autoFillBackground">
       <bool>false</bool>
      </property>
      <property name="frameShape">
       <enum>QFrame::Panel</enum>
      </property>
      <property name="autoScroll">
       <bool>true</bool>
      </property>
      <property name="autoScrollMargin">
       <number>1</number>
      </property>
      <property name="editTriggers">
       <set>QAbstractItemView::NoEditTriggers</set>
      </property>
      <property name="alternatingRowColors">
       <bool>true</bool>
      </property>
      <property name="selectionMode">
       <enum>QAbstractItemView::SingleSelection</enum>
      </property>
      <property name="selectionBehavior">
       <enum>QAbstractItemView::SelectItems</enum>
      </property>
      <property name="verticalScrollMode">
       <enum>QAbstractItemView::ScrollPerPixel</enum>
      </property>
      <property name="horizontalScrollMode">
       <enum>QAbstractItemView::ScrollPerPixel</enum>
      </property>
      <property name="showGrid">
       <bool>true</bool>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
      <property name="cornerButtonEnabled">
       <bool>true</bool>
      </property>
      <property name="rowCount">
       <number>41</number>
      </property>
      <attribute name="horizontalHeaderVisible">
       <bool>true</bool>
      </attribute>
      <attribute name="horizontalHeaderCascadingSectionResizes">
       <bool>false</bool>
      </attribute>
      <attribute name="horizontalHeaderStretchLastSection">
       <bool>false</bool>
      </attribute>
      <attribute name="verticalHeaderVisible">
       <bool>true</bool>
      </attribute>
      <row>
       <property name="text">
        <string>0..3</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>3..6</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>6..10</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>10..14</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>14..18</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>18..24</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>24..30</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>30..40</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>40..50</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>50..65</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>65..80</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>80..100</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>100..120</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>120..140</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>140..160</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>160..180</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>180..200</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>200..225</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>225..250</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>250..280</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>280..315</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>315..355</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>355..400</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>400..450</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>450..500</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>500..560</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>560..630</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>630..710</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>710..800</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>800..900</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>900..1000</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>1000..1120</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>1120..1250</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>1250..1400</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>1400..1600</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>1600..1800</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>1800..2000</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>2000..2240</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>2240..2500</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>2500..2800</string>
       </property>
      </row>
      <row>
       <property name="text">
        <string>2800..3150</string>
       </property>
      </row>
      <column>
       <property name="text">
        <string notr="true">01</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>0</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>1</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>2</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>3</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>4</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>5</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>6</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>7</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>8</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>9</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>10</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>11</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>12</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>13</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>14</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>15</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>16</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>17</string>
       </property>
      </column>
      <column>
       <property name="text">
        <string>18</string>
       </property>
      </column>
     </widget>
    </item>
   </layout>
  </widget>
 </widget>
 <resources/>
 <connections>
  <connection>
   <sender>btnClass_F</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>31</x>
     <y>75</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>424</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_A</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>33</x>
     <y>55</y>
    </hint>
    <hint type="destinationlabel">
     <x>237</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_M</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>42</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>174</x>
     <y>414</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_V</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>20</x>
     <y>128</y>
    </hint>
    <hint type="destinationlabel">
     <x>333</x>
     <y>438</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_B</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>69</x>
     <y>53</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>405</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_FG</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>77</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>382</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_N</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>55</x>
     <y>106</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_X</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>65</x>
     <y>130</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>430</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_zc</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>511</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>463</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_u</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>511</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_Y</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>92</x>
     <y>129</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>443</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_P</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>86</x>
     <y>100</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_G</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>100</x>
     <y>81</y>
    </hint>
    <hint type="destinationlabel">
     <x>107</x>
     <y>470</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_C</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>113</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>109</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_CD</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>120</x>
     <y>54</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>333</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_D</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>184</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>459</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_H</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>148</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>242</x>
     <y>416</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_R</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>148</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>279</x>
     <y>437</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_Z</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>148</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>282</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_JS</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>161</x>
     <y>81</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>319</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_S</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>184</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>404</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_ZA</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>154</x>
     <y>128</y>
    </hint>
    <hint type="destinationlabel">
     <x>515</x>
     <y>372</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_E</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>219</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>194</x>
     <y>376</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_J</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>202</x>
     <y>75</y>
    </hint>
    <hint type="destinationlabel">
     <x>214</x>
     <y>349</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_T</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>193</x>
     <y>108</y>
    </hint>
    <hint type="destinationlabel">
     <x>236</x>
     <y>322</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_ZB</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>219</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>370</x>
     <y>314</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_EF</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>222</x>
     <y>52</y>
    </hint>
    <hint type="destinationlabel">
     <x>421</x>
     <y>286</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_K</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>236</x>
     <y>79</y>
    </hint>
    <hint type="destinationlabel">
     <x>282</x>
     <y>277</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_ZC</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>255</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>233</x>
     <y>296</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_U</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>228</x>
     <y>105</y>
    </hint>
    <hint type="destinationlabel">
     <x>434</x>
     <y>396</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_k</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>511</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>309</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_ef</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>511</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>290</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_v</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>298</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>360</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_m</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>267</x>
     <y>103</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_f</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>298</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>478</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_a</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>298</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>499</x>
     <y>345</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_x</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>334</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>135</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_y</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>369</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>123</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_z</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>405</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>139</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_za</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>440</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>147</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_zb</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>476</x>
     <y>147</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>130</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_n</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>334</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>114</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_p</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>369</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>110</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_r</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>405</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>110</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_s</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>440</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>145</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_t</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>476</x>
     <y>122</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>101</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_fg</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>334</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>91</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_g</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>369</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>88</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_h</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>405</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>76</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_js</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>440</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>67</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_j</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>476</x>
     <y>97</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>69</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_b</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>334</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>56</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_c</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>369</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>36</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_cd</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>405</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>49</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_d</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>440</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>502</x>
     <y>83</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>btnClass_e</sender>
   <signal>toggled(bool)</signal>
   <receiver>dlgFittings</receiver>
   <slot>UpdateTable(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>476</x>
     <y>72</y>
    </hint>
    <hint type="destinationlabel">
     <x>520</x>
     <y>19</y>
    </hint>
   </hints>
  </connection>
 </connections>
 <designerdata>
  <property name="gridDeltaX">
   <number>8</number>
  </property>
  <property name="gridDeltaY">
   <number>8</number>
  </property>
  <property name="gridSnapX">
   <bool>true</bool>
  </property>
  <property name="gridSnapY">
   <bool>true</bool>
  </property>
  <property name="gridVisible">
   <bool>true</bool>
  </property>
 </designerdata>
 <slots>
  <slot>UpdateTable(bool)</slot>
 </slots>
</ui>

Added plugins/iso_fittings/iso_tables.cpp.































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
#include <algorithm>
#include <cmath>
#include <qcontainerfwd.h>
#include <sys/types.h>
#include <unistd.h>

#include "iso_tables.h"


double it[][21] = {
 //max    01    0    1    2    3   4   5    6    7    8    9   10    11    12    13    14    15     16     17    18
  {3,    0.3, 0.5, 0.8, 1.2,   2,  3,  4,   6,  10,  14,  25,  40,   60,  100,  140,  250,  400,   600,  1000,  1400},
  {6,    0.4, 0.6,   1, 1.5, 2.5,  4,  5,   8,  12,  18,  30,  48,   75,  120,  180,  300,  480,   750,  1200,  1800},
  {10,   0.4, 0.6,   1, 1.5, 2.5,  4,  6,   9,  15,  22,  36,  58,   90,  150,  220,  360,  580,   900,  1500,  2200},
  {18,   0.5, 0.8, 1.2,   2,   3,  5,  8,  11,  18,  27,  43,  70,  110,  180,  270,  430,  700,  1100,  1800,  2700},
  {30,   0.6,   1, 1.5, 2.5,   4,  6,  9,  13,  21,  33,  52,  84,  130,  210,  330,  520,  840,  1300,  2100,  3300},
  {50,   0.6,   1, 1.5, 2.5,   4,  7, 11,  16,  25,  39,  62, 100,  160,  250,  390,  620, 1000,  1600,  2500,  3900},
  {80,   0.8, 1.2,   2,   3,   5,  8, 13,  19,  30,  46,  74, 120,  190,  300,  460,  740, 1200,  1900,  3000,  4600},
  {120,    1, 1.5, 2.5,   4,   6, 10, 15,  22,  35,  54,  87, 140,  220,  350,  540,  870, 1400,  2200,  3500,  5400},
  {180,  1.2,   2, 2.5,   5,   8, 12, 18,  25,  40,  63, 100, 160,  250,  400,  630, 1000, 1600,  2500,  4000,  6300},
  {250,    2,   3, 4.5,   7,  10, 14, 20,  29,  46,  72, 115, 185,  290,  460,  720, 1150, 1850,  2900,  4600,  7200},
  {315,  2.5,   4,   6,   8,  12, 16, 23,  32,  52,  81, 130, 210,  320,  520,  810, 1300, 2100,  3200,  5200,  8100},
  {400,    3,   5,   7,   9,  13, 18, 25,  36,  57,  89, 140, 230,  360,  570,  890, 1400, 2300,  3600,  5700,  8900},
  {500,    4,   6,   8,  10,  15, 20, 27,  40,  63,  97, 155, 250,  400,  630,  970, 1550, 2500,  4000,  6300,  9700},
  {630,  4.5,   6,   9,  11,  16, 22, 30,  44,  70, 110, 175, 280,  440,  700, 1100, 1750, 2800,  4400,  7000, 11000},
  {800,    5,   7,  10,  13,  18, 25, 35,  50,  80, 125, 200, 320,  500,  800, 1250, 2000, 3200,  5000,  8000, 12500},
  {1000, 5.5,   8,  11,  15,  21, 29, 40,  56,  90, 140, 230, 360,  560,  900, 1400, 2300, 3600,  5600,  9000, 14000},
  {1250, 6.5,   9,  13,  18,  24, 34, 46,  66, 105, 165, 260, 420,  660, 1050, 1650, 2600, 4200,  6600, 10500, 16500},
  {1600,   8,  11,  15,  21,  29, 40, 54,  78, 125, 295, 320, 500,  780, 1250, 1950, 3100, 5000,  7800, 12500, 19500},
  {2000,   9,  13,  18,  25,  35, 48, 65,  92, 150, 230, 370, 600,  920, 1500, 2300, 3700, 6000,  9200, 15000, 23000},
  {2500,  11,  15,  22,  30,  41, 57, 77, 110, 175, 280, 440, 700, 1100, 1750, 2800, 4400, 7000, 11000, 17500, 28000},
  {3150,  13,  18,  26,  36,  50, 69, 93, 135, 210, 330, 540, 860, 1350, 2100, 3300, 5400, 8600, 13500, 21000, 33000}
};


double offs_es[][23] = {
  //max          a,     b,     c,    cd,     d,    e,   ef,   f,  fg,    g,   p,   r,    s,    t,    u,    v,    x,    y,    z,   za,   zb,   zc
    {3,       -270,  -140,   -60,   -34,   -20,  -14,  -10,  -6,  -4,   -2,   6,  10,   14,  NAN,   18,  NAN,   20,  NAN,   26,   32,   40,   60},
    {6,       -270,  -140,   -70,   -46,   -30,  -20,  -14, -10,  -6,   -4,  12,  15,   19,  NAN,   23,  NAN,   28,  NAN,   35,   42,   50,   80},
    {10,      -280,  -150,   -80,   -56,   -40,  -25,  -18, -13,  -8,   -5,  15,  19,   23,  NAN,   28,  NAN,   34,  NAN,   42,   52,   67,   97},
    {14,      -290,  -150,   -95,   NAN,   -50,  -32,  NAN, -16,  NAN,  -6,  18,  23,   28,  NAN,   33,  NAN,   40,  NAN,   50,   64,   90,  130},
    {18,      -290,  -150,   -95,   NAN,   -50,  -32,  NAN, -16,  NAN,  -6,  18,  23,   28,  NAN,   33,   39,   45,  NAN,   60,   77,  108,  150},
    {24,      -300,  -160,  -110,   NAN,   -65,  -40,  NAN, -20,  NAN,  -7,  22,  28,   35,  NAN,   41,   47,   54,   63,   73,   98,  136,  188},
    {30,      -300,  -160,  -110,   NAN,   -65,  -40,  NAN, -20,  NAN,  -7,  22,  28,   35,   41,   48,   55,   64,   75,   88,  118,  160,  218},
    {40,      -310,  -170,  -120,   NAN,   -80,  -50,  NAN, -25,  NAN,  -9,  26,  34,   43,   48,   60,   68,   80,   94,  112,  148,  200,  274},
    {50,      -320,  -180,  -130,   NAN,   -80,  -50,  NAN, -25,  NAN,  -9,  26,  34,   43,   54,   70,   81,   97,  114,  136,  180,  242,  325},
    {65,      -340,  -190,  -140,   NAN,  -100,  -60,  NAN, -30,  NAN, -10,  32,  41,   53,   66,   87,  102,  122,  144,  172,  226,  300,  405},
    {80,      -360,  -200,  -150,   NAN,  -100,  -60,  NAN, -30,  NAN, -10,  32,  43,   59,   75,  102,  120,  146,  174,  210,  274,  360,  480},
    {100,     -380,  -220,  -170,   NAN,  -120,  -72,  NAN, -36,  NAN, -12,  37,  51,   71,   91,  124,  146,  178,  214,  258,  335,  445,  585},
    {120,     -410,  -240,  -180,   NAN,  -120,  -72,  NAN, -36,  NAN, -12,  37,  54,   79,  104,  144,  172,  210,  254,  310,  400,  525,  690},
    {140,     -460,  -260,  -200,   NAN,  -145,  -85,  NAN, -43,  NAN, -14,  43,  63,   92,  122,  170,  202,  248,  300,  365,  470,  620,  800},
    {160,     -520,  -280,  -210,   NAN,  -145,  -85,  NAN, -43,  NAN, -14,  43,  65,  100,  134,  190,  228,  280,  340,  415,  535,  700,  900},
    {180,     -580,  -310,  -230,   NAN,  -145,  -85,  NAN, -43,  NAN, -14,  43,  68,  108,  146,  210,  252,  310,  380,  465,  600,  780, 1000},
    {200,     -660,  -340,  -240,   NAN,  -170, -100,  NAN, -50,  NAN, -15,  50,  77,  122,  166,  236,  284,  350,  425,  520,  670,  880, 1150},
    {225,     -740,  -380,  -260,   NAN,  -170, -100,  NAN, -50,  NAN, -15,  50,  80,  130,  180,  258,  310,  385,  470,  575,  740,  960, 1250},
    {250,     -820,  -420,  -280,   NAN,  -170, -100,  NAN, -50,  NAN, -15,  50,  84,  140,  196,  284,  340,  425,  520,  640,  820, 1050, 1350},
    {280,     -920,  -480,  -300,   NAN,  -190, -110,  NAN, -56,  NAN, -17,  56,  94,  158,  218,  315,  385,  475,  580,  710,  920, 1200, 1550},
    {315,    -1050,  -540,  -330,   NAN,  -190, -110,  NAN, -56,  NAN, -17,  56,  98,  170,  240,  350,  425,  525,  650,  790, 1000, 1300, 1700},
    {355,    -1200,  -600,  -360,   NAN,  -210, -125,  NAN, -62,  NAN, -18,  62, 108,  190,  268,  390,  475,  590,  730,  900, 1150, 1500, 1900},
    {400,    -1350,  -680,  -400,   NAN,  -210, -125,  NAN, -62,  NAN, -18,  62, 114,  208,  294,  435,  530,  660,  820, 1000, 1300, 1650, 2100},
    {450,    -1500,  -760,  -440,   NAN,  -230, -135,  NAN, -68,  NAN, -20,  68, 126,  232,  330,  490,  595,  740,  920, 1100, 1450, 1850, 2400},
    {500,    -1650,  -840,  -480,   NAN,  -230, -135,  NAN, -68,  NAN, -20,  68, 132,  252,  360,  540,  660,  820, 1000, 1250, 1600, 2100, 2600},
    {560,      NAN,   NAN,  -520,  -370,  -260, -145,  NAN, -76,  NAN, -22,  78, 150,  280,  400,  600,  740,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {630,      NAN,   NAN,  -580,  -390,  -260, -145,  NAN, -76,  NAN, -22,  78, 155,  310,  450,  660,  820,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {710,      NAN,   NAN,  -640,  -430,  -290, -160,  NAN, -80,  NAN, -24,  88, 175,  340,  500,  740,  920,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {800,      NAN,   NAN,  -700,  -450,  -290, -160,  NAN, -80,  NAN, -24,  88, 185,  380,  560,  840, 1000,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {900,      NAN,   NAN,  -780,  -500,  -320, -170,  NAN, -86,  NAN, -26, 100, 210,  430,  620,  940, 1150,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {1000,     NAN,   NAN,  -860,  -520,  -320, -170,  NAN, -86,  NAN, -26, 100, 220,  470,  680, 1050, 1300,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {1120,     NAN,   NAN,  -940,  -580,  -350, -195,  NAN, -98,  NAN, -28, 120, 250,  520,  780, 1150, 1450,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {1250,     NAN,   NAN, -1050,  -600,  -350, -195,  NAN, -98,  NAN, -28, 120, 260,  580,  840, 1300, 1600,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {1400,     NAN,   NAN, -1150,  -660,  -390, -220,  NAN,-110,  NAN, -30, 140, 300,  640,  960, 1450, 1800,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {1600,     NAN,   NAN, -1300,  -720,  -390, -220,  NAN,-110,  NAN, -30, 140, 330,  720, 1050, 1600, 2000,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {1800,     NAN,   NAN, -1450,  -780,  -430, -240,  NAN,-120,  NAN, -32, 170, 370,  820, 1200, 1850, 2300,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {2000,     NAN,   NAN, -1600,  -820,  -430, -240,  NAN,-120,  NAN, -32, 170, 400,  920, 1350, 2000, 2500,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {2240,     NAN,   NAN, -1800,  -920,  -480, -260,  NAN,-130,  NAN, -34, 195, 440, 1000, 1500, 2300, 2800,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {2500,     NAN,   NAN, -2000,  -980,  -480, -260,  NAN,-130,  NAN, -34, 195, 460, 1100, 1650, 2500, 3100,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {2800,     NAN,   NAN, -2200, -1050,  -520, -290,  NAN,-145,  NAN, -38, 240, 550, 1250, 1900, 2900, 3500,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN},
    {3150,     NAN,   NAN, -2500, -1150,  -520, -290,  NAN,-145,  NAN, -38, 240, 580, 1400, 2100, 3200, 3900,  NAN,  NAN,  NAN,  NAN,  NAN,  NAN}
};


double offs_ei[][8] = {
   //      j5,  j6,  j7,  j8, k47,  m,    n
   {3,     -2,  -2,  -4,  -6,   0,  2,    4},
   {6,     -2,  -2,  -4, NAN,   1,  4,    8},
   {10,    -2,  -2,  -4, NAN,   1,  6,   10},
   {14,    -3,  -3,  -6, NAN,   1,  7,   12},
   {18,    -3,  -3,  -6, NAN,   1,  7,   12},
   {24,    -4,  -4,  -8, NAN,   2,  8,   15},
   {30,    -4,  -4,  -8, NAN,   2,  8,   15},
   {40,    -5,  -5, -10, NAN,   2,  9,   17},
   {50,    -5,  -5, -10, NAN,   2,  9,   17},
   {65,    -7,  -7, -12, NAN,   2,  11,  20},
   {80,    -7,  -7, -12, NAN,   2,  11,  20},
   {100,   -9,  -9, -15, NAN,   3,  13,  23},
   {120,   -9,  -9, -15, NAN,   3,  13,  23},
   {140,  -11, -11, -18, NAN,   3,  15,  27},
   {160,  -11, -11, -18, NAN,   3,  15,  27},
   {180,  -11, -11, -18, NAN,   3,  15,  27},
   {200,  -13, -13, -21, NAN,   4,  17,  31},
   {225,  -13, -13, -21, NAN,   4,  17,  31},
   {250,  -13, -13, -21, NAN,   4,  17,  31},
   {280,  -16, -16, -26, NAN,   4,  20,  34},
   {315,  -16, -16, -26, NAN,   4,  20,  34},
   {355,  -18, -18, -28, NAN,   4,  21,  37},
   {400,  -18, -18, -28, NAN,   4,  21,  37},
   {450,  -20, -20, -32, NAN,   5,  23,  40},
   {500,  -20, -20, -32, NAN,   5,  23,  40},
   {560,  NAN, NAN, NAN, NAN,   0,  26,  44},
   {630,  NAN, NAN, NAN, NAN,   0,  26,  44},
   {710,  NAN, NAN, NAN, NAN,   0,  30,  50},
   {800,  NAN, NAN, NAN, NAN,   0,  30,  50},
   {900,  NAN, NAN, NAN, NAN,   0,  34,  56},
   {1000, NAN, NAN, NAN, NAN,   0,  34,  56},
   {1120, NAN, NAN, NAN, NAN,   0,  40,  66},
   {1250, NAN, NAN, NAN, NAN,   0,  40,  66},
   {1400, NAN, NAN, NAN, NAN,   0,  48,  78},
   {1600, NAN, NAN, NAN, NAN,   0,  48,  78},
   {1800, NAN, NAN, NAN, NAN,   0,  58,  92},
   {2000, NAN, NAN, NAN, NAN,   0,  58,  92},
   {2240, NAN, NAN, NAN, NAN,   0,  68, 110},
   {2500, NAN, NAN, NAN, NAN,   0,  68, 110},
   {2800, NAN, NAN, NAN, NAN,   0,  76, 135},
   {3150, NAN, NAN, NAN, NAN,   0,  76, 135}
};

// for the holes J, K, M and N
double offs_es2[][9] {
  // max    J6,  J7,  J8,  K1,  K2,   M,   N1,  N2
  {3,        2,   4,   6,   0,   0,  -2,   -4,  -4},
  {6,        5,   6,  10,  -1, NAN,  -4,   -8,   0},
  {10,       5,   8,  12,  -1, NAN,  -6,  -10,   0},
  {18,       6,  10,  15,  -1, NAN,  -7,  -12,   0},
  {30,       8,  12,  20,  -2, NAN,  -8,  -15,   0},
  {50,      10,  14,  24,  -2, NAN,  -9,  -17,   0},
  {80,      13,  18,  28,  -2, NAN, -11,  -20,   0},
  {120,     16,  22,  34,  -3, NAN, -13,  -23,   0},
  {180,     18,  26,  41,  -3, NAN, -15,  -27,   0},
  {250,     22,  30,  47,  -4, NAN, -17,  -31,   0},
  {315,     25,  36,  55,  -4, NAN, -20,  -34,   0},
  {400,     29,  39,  60,  -4, NAN, -21,  -37,   0},
  {500,     33,  43,  66,  -5, NAN, -23,  -40,   0},
  {630,    NAN, NAN, NAN,   0, NAN, -26,  -44,   0},
  {800,    NAN, NAN, NAN,   0, NAN, -30,  -50,   0},
  {1000,   NAN, NAN, NAN,   0, NAN, -34,  -56,   0},
  {1250,   NAN, NAN, NAN,   0, NAN, -40,  -66,   0},
  {1600,   NAN, NAN, NAN,   0, NAN, -48,  -78,   0},
  {2000,   NAN, NAN, NAN,   0, NAN, -58,  -92,   0},
  {2500,   NAN, NAN, NAN,   0, NAN, -68, -110,   0},
  {3150,   NAN, NAN, NAN,   0, NAN, -76, -135,   0}
};

double Deltas[][7] {
 //max     3    4    5    6    7   8
  {3,      0,   0,   0,   0,   0,  0 },
  {6,      1, 1.5,   1,   3,   4,  6 },
  {10,     1, 1.5,   2,   3,   6,  7 },
  {18,     1,   2,   3,   3,   7,  9 },
  {30,   1.5,   2,   3,   4,   8, 12 },
  {50,   1.5,   3,   4,   5,   9, 14 },
  {80,     2,   3,   5,   6,  11, 16 },
  {120,    2,   4,   5,   7,  13, 19 },
  {180,    3,   4,   6,   7,  15, 23 },
  {250,    3,   4,   6,   9,  17, 26 },
  {315,    4,   4,   7,   9,  20, 29 },
  {400,    4,   5,   7,  11,  21, 32 },
  {500,    5,   5,   7,  13,  23, 34 }
};

QString tolClasses1[] = {"a", "b", "c", "cd" ,"d", "e", "ef", "f", "fg", "g", "p", "r", "s", "t", "u", "v", "x", "y", "z", "za", "zb", "zc"};
QString tolClasses2[] = {"j", "k", "m", "n"};

                                           


toleranceIT getTolerance(double nominalSize, QString tClass, QString grade) {
  int idxGrade, g;
  g = grade.toInt();

// Check the arguments.

  if ((g < 0) || (g>18)) return {NAN, NAN};

  if ((nominalSize < 1.0) || (nominalSize > 3150.0)) return {NAN, NAN};

  if (tClass.length() > 2) return {NAN,NAN};

// index in the it[][] table.
  if (grade == "01") {
    idxGrade = -1;
  } else {
    idxGrade = g;
  }

// compare the nominal size
  int i;
  for (i=0; nominalSize > it[i][0]; i++);

// This is the tolerance
  double tol = it[i][idxGrade+2];

// Now the offset. It is somehow tricky.

  int idxClass = -1;
  double facClass = 0.0;
  double facTol = 1.0;
  double offset = NAN;
  double delta = 0.0;

  if (idxGrade >= 3 && idxGrade < 9 && nominalSize <= 500.0) {
    for (i=0; nominalSize > Deltas[i][0]; i++);
    delta = Deltas[i][idxGrade-2];
  }

  if (tClass.toLower() == "h") {

    offset = 0.0;
    facClass = 1.0;
    if (tClass == "h") facClass *= -1.0;
    return {std::max(0.0, tol*facClass), std::min(0.0, tol*facClass)};

  } else {

    if (tClass.toLower() == "js") {
      return {tol/2, -tol/2};
    } else {

      for (i=0; i < (int) std::size(tolClasses1); i++) {
          if (tClass == tolClasses1[i]) {
              idxClass = i;
              facClass = 1.0;
              break;
          } else {
              if (tClass.toLower() == tolClasses1[i]) {
                  idxClass = i;
                  facClass = -1.0;
                  break;
              }
          }
      }

      if (idxClass >= 0) {
        for (i=0; nominalSize > offs_es[i][0]; i++);
        offset = facClass*offs_es[i][idxClass+1];

        if (facClass < 0.0 && idxClass > 10 && idxGrade < 8) offset += delta;    // for holes, from P..ZC, small grades, add additional delta.

        if (idxClass > 9) facTol = -1.0;

        return {std::max(offset, offset-facTol*facClass*tol), std::min(offset, offset-facTol*facClass*tol)};

      } else {
        // special classes j, k, m and n

        if (tClass == "j") {
          if (idxGrade < 5 || idxGrade > 8) return {NAN,NAN};

          idxClass = idxGrade -4;   // 1..4 for grades 5..8

          for (i=0; nominalSize > offs_ei[i][0]; i++);
          offset = offs_ei[i][idxClass];

          return {std::max(offset, offset+tol), std::min(offset, offset+tol)};     // ?????????????????
        } else {
          if (tClass == "k") {

            if (idxGrade < 4 || idxGrade > 7) {
              offset = 0.0;
            } else {
              for (i=0; nominalSize > offs_ei[i][0]; i++);
              offset = offs_ei[i][5];
            }
            return {std::max(offset, offset+tol), std::min(offset, offset+tol)};     // ?????????????????

          } else {

            if (tClass == "m" || tClass == "n") {

              idxClass = (tClass == "m") ? 6 : 7;
              for (i=0; nominalSize > offs_ei[i][0]; i++);
              offset = offs_ei[i][idxClass];
              return {std::max(offset, offset+tol), std::min(offset, offset+tol)};     // ?????????????????

            } else {

              // For the holes here.
              if (tClass == "J") {

                  if (idxGrade < 6 || idxGrade > 8) return {NAN, NAN};
                idxClass = idxGrade - 5;  // 1..3 for grades 6, 7 and 8
                for (i=0; nominalSize > offs_es2[i][0]; i++);
                offset = offs_es2[i][idxClass];
                return {std::max(offset, offset-tol), std::min(offset, offset-tol)};     // ?????????????????

              } else {

                  if (tClass == "K") idxClass = (idxGrade < 9) ? 4 : 5;
                  if (tClass == "M") idxClass = 6;
                  if (tClass == "N") idxClass = (idxGrade < 9) ? 7 : 8;

                  if (idxClass == -1) return {NAN,NAN};

                  for (i=0; nominalSize > offs_es2[i][0]; i++);
                  offset = offs_es2[i][idxClass];

                  if (nominalSize > 3.0 && nominalSize <= 500.0) offset += delta;

                  return {std::max(offset, offset-tol), std::min(offset, offset-tol)};     // ?????????????????

              }
            }
          }
        }
      }
    }
  }

  return {NAN, NAN};
}

Added plugins/iso_fittings/iso_tables.h.























>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11


#include <qobject.h>


struct toleranceIT {
    double upper;
    double lower;
};

toleranceIT getTolerance(double nominalSize, QString tClass, QString grade);

Changes to plugins/plugins.pro.

15
16
17
18
19
20
21

22
23
24
25
26
27
28
        divide \
        list \
        sameprop \
        sample \
        picfile \
        plotequation \
        pointstocsv \

        gear

TRANSLATIONS = ./ts/plugins_ar.ts \
    ./ts/plugins_ca.ts \
    ./ts/plugins_cs.ts \
    ./ts/plugins_en.ts \
    ./ts/plugins_en_au.ts \







>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
        divide \
        list \
        sameprop \
        sample \
        picfile \
        plotequation \
        pointstocsv \
        iso_fittings \
        gear

TRANSLATIONS = ./ts/plugins_ar.ts \
    ./ts/plugins_ca.ts \
    ./ts/plugins_cs.ts \
    ./ts/plugins_en.ts \
    ./ts/plugins_en_au.ts \

Added uninstall.

























>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

rm /usr/local/bin/librecad
rm /usr/local/bin/ttf2lff

rm -rf /usr/local/lib/librecad/

rm /usr/local/share/applications/librecad.desktop

rm -rf /usr/local/share/librecad/

rm /usr/local/share/icons/hicolor/scalable/apps/librecad.svg

Added update.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
#!/bin/sh

cp unix/librecad /usr/local/bin/
rm /usr/local/lib/librecad/plugins/*
cp unix/resources/plugins/* /usr/local/lib/librecad/plugins/

strip -s /usr/local/bin/librecad
strip -s /usr/local/lib/librecad/plugins/*