Changeset fc43dda in git for src/gfxcore.cc


Ignore:
Timestamp:
29/08/19 07:08:47 (7 weeks ago)
Author:
Olly Betts <olly@…>
Branches:
master
Children:
72fac59
Parents:
b0908ea
Message:

Allow colouring by horizontal or vertical error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gfxcore.cc

    rb0908ea rfc43dda  
    10541054    key_lowerleft[m_ColourBy].x = left - KEY_EXTRA_LEFT_MARGIN;
    10551055    key_lowerleft[m_ColourBy].y = bottom;
     1056    switch (m_ColourBy) {
     1057        case COLOUR_BY_ERROR:
     1058        case COLOUR_BY_H_ERROR:
     1059        case COLOUR_BY_V_ERROR:
     1060            key_lowerleft[COLOUR_BY_ERROR] = key_lowerleft[m_ColourBy];
     1061            key_lowerleft[COLOUR_BY_H_ERROR] = key_lowerleft[m_ColourBy];
     1062            key_lowerleft[COLOUR_BY_V_ERROR] = key_lowerleft[m_ColourBy];
     1063    }
    10561064
    10571065    int y = bottom;
     
    26092617        void (GfxCore::* add_poly)(const traverse&);
    26102618        if (surface) {
    2611             if (m_ColourBy == COLOUR_BY_ERROR) {
    2612                 add_poly = &GfxCore::AddPolylineError;
    2613             } else {
    2614                 add_poly = &GfxCore::AddPolyline;
     2619            switch (m_ColourBy) {
     2620                case COLOUR_BY_ERROR:
     2621                case COLOUR_BY_H_ERROR:
     2622                case COLOUR_BY_V_ERROR:
     2623                    add_poly = &GfxCore::AddPolylineError;
     2624                    break;
     2625                default:
     2626                    add_poly = &GfxCore::AddPolyline;
    26152627            }
    26162628        } else {
     
    31593171                key_list = LIST_DATE_KEY; break;
    31603172            case COLOUR_BY_ERROR:
     3173            case COLOUR_BY_H_ERROR:
     3174            case COLOUR_BY_V_ERROR:
    31613175                key_list = LIST_ERROR_KEY; break;
    31623176            case COLOUR_BY_GRADIENT:
     
    35613575{
    35623576    BeginPolyline();
    3563     SetColourFromError(centreline.E, 1.0);
     3577    SetColourFromError(centreline.errors[error_type], 1.0);
    35643578    vector<PointInfo>::const_iterator i;
    35653579    for(i = centreline.begin(); i != centreline.end(); ++i) {
     
    40484062            break;
    40494063        case COLOUR_BY_ERROR:
     4064        case COLOUR_BY_H_ERROR:
     4065        case COLOUR_BY_V_ERROR:
    40504066            AddQuad = &GfxCore::AddQuadrilateralError;
    40514067            AddPoly = &GfxCore::AddPolylineError;
     
    40664082            AddQuad = &GfxCore::AddQuadrilateral;
    40674083            AddPoly = &GfxCore::AddPolyline;
     4084            break;
     4085    }
     4086
     4087    switch (colour_by) {
     4088        case COLOUR_BY_ERROR:
     4089            error_type = traverse::ERROR_3D;
     4090            break;
     4091        case COLOUR_BY_H_ERROR:
     4092            error_type = traverse::ERROR_H;
     4093            break;
     4094        case COLOUR_BY_V_ERROR:
     4095            error_type = traverse::ERROR_V;
    40684096            break;
    40694097    }
     
    43134341        menu.AppendCheckItem(menu_COLOUR_BY_DATE, wmsg(/*Colour by D&ate*/293));
    43144342        menu.AppendCheckItem(menu_COLOUR_BY_ERROR, wmsg(/*Colour by &Error*/289));
     4343        menu.AppendCheckItem(menu_COLOUR_BY_H_ERROR, wmsg(/*Colour by &Horizontal Error*/480));
     4344        menu.AppendCheckItem(menu_COLOUR_BY_V_ERROR, wmsg(/*Colour by &Vertical Error*/481));
    43154345        menu.AppendCheckItem(menu_COLOUR_BY_GRADIENT, wmsg(/*Colour by &Gradient*/85));
    43164346        menu.AppendCheckItem(menu_COLOUR_BY_LENGTH, wmsg(/*Colour by &Length*/82));
Note: See TracChangeset for help on using the changeset viewer.