Changeset 789


Ignore:
Timestamp:
05/29/18 15:40:49 (6 years ago)
Author:
Maciej Komosinski
Message:

Code formatting

Location:
cpp/frams/canvas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/canvas/canvasutil.cpp

    r286 r789  
    55#include "canvasutil.h"
    66
    7 static int std_unknown_symbol[]={12, 1,4, 25,25, 75,25, 75,75, 25,75, 25,25};
    8 static int std_neuron_symbol[]={12, 1,4, 75,50, 25,0, 25,99, 75,50, 100,50};
    9 static int std_inputonly_symbol[]={14, 1,5, 25,40, 35,40, 45,50, 35,60, 25,60, 25,40};
    10 static int std_outputonly_symbol[]={18, 1,7, 75,50, 75,60, 55,60, 65,50, 55,40, 75,40, 75,50, 100,50};
     7static int std_unknown_symbol[] = { 12, 1, 4, 25, 25, 75, 25, 75, 75, 25, 75, 25, 25 };
     8static int std_neuron_symbol[] = { 12, 1, 4, 75, 50, 25, 0, 25, 99, 75, 50, 100, 50 };
     9static int std_inputonly_symbol[] = { 14, 1, 5, 25, 40, 35, 40, 45, 50, 35, 60, 25, 60, 25, 40 };
     10static int std_outputonly_symbol[] = { 18, 1, 7, 75, 50, 75, 60, 55, 60, 65, 50, 55, 40, 75, 40, 75, 50, 100, 50 };
    1111
    12 int* drawNeuroSymbol(CanvasDrawing* c,NeuroClass* cl,int x,int y,int w,int h)
     12int* drawNeuroSymbol(CanvasDrawing* c, NeuroClass* cl, int x, int y, int w, int h)
    1313{
    14 int *data=std_unknown_symbol;
    15 if (cl)
     14        int *data = std_unknown_symbol;
     15        if (cl)
    1616        {
    17         data=cl->getSymbolGlyph();
    18         if (!data)
     17                data = cl->getSymbolGlyph();
     18                if (!data)
    1919                {
    20                 if (cl->getPreferredInputs()==0)
    21                         data=std_outputonly_symbol;
    22                 else if (cl->getPreferredOutput()==0)
    23                         data=std_inputonly_symbol;
    24                 else data=std_neuron_symbol;
     20                        if (cl->getPreferredInputs() == 0)
     21                                data = std_outputonly_symbol;
     22                        else if (cl->getPreferredOutput() == 0)
     23                                data = std_inputonly_symbol;
     24                        else data = std_neuron_symbol;
    2525                }
    2626        }
    27 drawVector(c,data,x,y,w,h);
    28 return data;
     27        drawVector(c, data, x, y, w, h);
     28        return data;
    2929}
    3030
    31 void drawVector(CanvasDrawing* c,int data[],int x,int y,int w,int h)
     31void drawVector(CanvasDrawing* c, int data[], int x, int y, int w, int h)
    3232{
    33 if (!data) return;
    34 Pixel p;
    35 data++;
    36 for (int NL=*(data++);NL>0;NL--)
     33        if (!data) return;
     34        Pixel p;
     35        data++;
     36        for (int NL = *(data++); NL > 0; NL--)
    3737        {
    38         int NS=*(data++);
    39         p.x=x+(*(data++)*w)/100;
    40         p.y=y+(*(data++)*h)/100;
    41         c->moveTo(p);
    42         for (;NS>0;NS--)
     38                int NS = *(data++);
     39                p.x = x + (*(data++)*w) / 100;
     40                p.y = y + (*(data++)*h) / 100;
     41                c->moveTo(p);
     42                for (; NS > 0; NS--)
    4343                {
    44                 p.x=x+(*(data++)*w)/100;
    45                 p.y=y+(*(data++)*h)/100;
    46                 c->lineTo(p);
     44                        p.x = x + (*(data++)*w) / 100;
     45                        p.y = y + (*(data++)*h) / 100;
     46                        c->lineTo(p);
    4747                }
    4848        }
  • cpp/frams/canvas/nn_simple_layout.cpp

    r286 r789  
    3838                for (i = 0; i < a; i++)
    3939                {
    40                         if (e >= N) return;
    41                         nn->SetXYWH(e, 70 * i + ((i + j) & 3) * 4, 70 * j + ((2 + i + j) & 3) * 4, 50, 50);
    42                         e++;
     40                if (e >= N) return;
     41                nn->SetXYWH(e, 70 * i + ((i + j) & 3) * 4, 70 * j + ((2 + i + j) & 3) * 4, 50, 50);
     42                e++;
    4343                }
    4444}
Note: See TracChangeset for help on using the changeset viewer.