File: CoolCanvas.cpp

package info (click to toggle)
gentle 1.9+cvs20100605+dfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze
  • size: 12,264 kB
  • ctags: 5,235
  • sloc: cpp: 41,571; ansic: 3,978; sh: 1,420; makefile: 291
file content (53 lines) | stat: -rwxr-xr-x 1,219 bytes parent folder | download | duplicates (6)
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
#include "CoolCanvas.h"
/*
CoolCanvas::CoolCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size)
    : PlasmidCanvas ( parent , pos , size )
    {
    
    }
    
int CoolCanvas::x2D ( int x , int y , int z )
    {
    return x + z + w/2 ;
    }
    
int CoolCanvas::y2D ( int x , int y , int z )
    {
    return y + z + h/2 ;
    }
    
wxPoint CoolCanvas::xy2D ( int x , int y , int z )
    {
    return wxPoint ( x2D ( x , y , z ) , y2D ( x , y , z ) ) ;
    }
    
void CoolCanvas::OnDrawCircular(wxDC& dc)
    {
    int mwh = w<h?w:h ;
    if ( printing ) mwh -= mwh / 5 ;
    int w2 = w * 4 / 10 ;
    int h2 = h * 3 / 10 ;
    string s = p->vec->getSequence() ;
    
    int a ;
    for ( a = 0 ; a < s.length() ; a++ )
        {
        float deg = a * 360 ;
        deg /= s.length() ;
        int x = deg2x ( deg , w2 ) ;
        int y = deg2y ( deg , h2 ) ;
        
        if ( y > h2*2/3 )
           {
           wxString text ;
           text += s[a] ;
           dc.DrawText ( text , xy2D ( x , 0 , y ) ) ;
           }
        else
           {
           dc.DrawPoint ( xy2D ( x , 0 , y ) ) ;
           }
        
        }
    }
*/