root/trunk/FRII/gui/_PairMapCanvas.hh

Revision 10, 2.0 kB (checked in by t, 3 years ago)

Tailorization
Import of the upstream sources from

Repository: :pserver:anonymous@cvs.sf.net:/cvsroot/familyjewels

Kind: cvs

Module: FRII

Revision: 2005-12-09 09:00:54 by titus

Original author: tailor@vallista.idyll.org
Date: 2005-12-09 09:00:54

Line 
1 /*
2  * This file is part of the FamilyRelations II source distribution.
3  *
4  * FamilyRelations II is part of the FamilyJewels package for comparative
5  * sequence analysis: http://family.caltech.edu/.
6  *
7  * Contact author: C. Titus Brown, titus@caltech.edu.
8  *
9  * This program and all associated source code files are Copyright (C) 2003,
10  * 2004 the California Institute of Technology, Pasadena, CA, 91125 USA.  It
11  * is under the Lesser GNU Public License; please see the included
12  * LICENSE.txt file for more information, or contact Titus directly.
13  *
14  */
15
16 // A subclass of _Canvas used by PairMappingView.  See PairMappingView.* for
17 // more information.
18
19 #ifndef _PAIRMAPCANVAS_HH
20 #define _PAIRMAPCANVAS_HH
21
22 #include "_Canvas.hh"
23
24 namespace gui {
25   class _PairMapCanvas : public _Canvas {
26   private:
27     int _top_x, _top_w, _top_y;
28     int _bot_x, _bot_w, _bot_y;
29
30     int _top_start, _top_end;
31     int _bot_start, _bot_end;
32
33     // Scale factors, computed by 'recompute'.
34     float _top_scale, _bot_scale;
35    
36     // Calculate scale factors.
37     void recompute();
38   public:
39     _PairMapCanvas() {
40       _top_x = _top_w = _top_y = _top_start = _top_end = -1;
41       _bot_x = _bot_w = _bot_y = _bot_start = _bot_end = -1;
42     }
43
44     // Set top/bot canvas coordinates.
45     void set_top_canvas_coords(int x_start, int width, int y);
46     void set_bot_canvas_coords(int x_start, int width, int y);
47
48     // Set top/bot sequence coordinates.
49     void set_top_sequence_coords(int start, int end);
50     void set_bot_sequence_coords(int start, int end);
51
52     // Get sequence coords.
53     const int get_top_start() const { return _top_start; }
54     const int get_bot_start() const { return _bot_start; }
55     const int get_top_end() const { return _top_end; }
56     const int get_bot_end() const { return _bot_end; }
57
58     // draw a feature between positions on top and bottom, with or without
59     // a width.
60     void draw_feature(int top_pos, int bot_pos, unsigned int width,
61                       int orientation);
62     void draw_feature(int top_pos, int bot_pos);
63
64     void push_clip();
65   };
66 }
67
68 #endif // _PAIRMAPCANVAS_HH
69
Note: See TracBrowser for help on using the browser.