Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

DnpGui Class Reference

The visual appearance of a DnpData. More...

#include <featuregui.h>

Inheritance diagram for DnpGui:

Inheritance graph
[legend]
Collaboration diagram for DnpGui:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DnpGui (FeatureData *data)
void paintMe (QPainter *p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna, double width, int height, int center)
DnpDatadnpData ()

Detailed Description

The visual appearance of a DnpData.

Definition at line 66 of file featuregui.h.


Constructor & Destructor Documentation

DnpGui::DnpGui FeatureData data  )  [inline]
 

Definition at line 69 of file featuregui.h.

00069                                  : FeatureGui( data )
00070     {
00071 //         cerr << "in dnpgui ctor" << endl;
00072     }


Member Function Documentation

DnpData * DnpGui::dnpData  ) 
 

Definition at line 104 of file featuregui.cpp.

References FeatureGui::m_data.

Referenced by paintMe().

00105 {
00106     return dynamic_cast<DnpData *>( m_data );
00107 }

void DnpGui::paintMe QPainter *  p,
TR_PIX  x_pix,
TR_PIX  y_pix,
TR_DNA  x1_dna,
TR_DNA  x2_dna,
double  width,
int  height,
int  center
[virtual]
 

Paints the visual appearance of a feature.

Parameters:
p the QPainter to paint to
x_pix the pixel coordinate of the upper left corner of the rectangle where the feature should be painted
y_pix the pixel coordinate of the upper left corner of the rectangle where the feature should be painted
x1_dna the left most position that should be painted given as a dna coordinate relative the left side of the read.
x2_dna the right most position that should be painted given as a dna coordinate relative the left side of the read.

Implements FeatureGui.

Definition at line 63 of file featuregui.cpp.

References dnpData().

00065 {
00066   static QColor dnpcolors[] = 
00067     {
00068       Qt::red.light(110),
00069       Qt::green.light(110),
00070       Qt::blue.light(110),
00071       Qt::cyan.light(110),
00072       Qt::magenta.light(110),
00073       Qt::yellow.light(110),
00074       Qt::darkRed.light(140),
00075       Qt::darkGreen.light(140),
00076       Qt::darkBlue.light(140),
00077       Qt::darkCyan.light(140),
00078       Qt::darkMagenta.light(140),
00079       Qt::darkYellow.light(140)
00080     };
00081   
00082   static int num_colors = sizeof(dnpcolors)/sizeof(QColor);
00083   
00084   QString str;
00085 
00086   QBrush brush;
00087   brush.setStyle( Qt::SolidPattern );
00088 
00089 //   assert( dnpData()->get_dnpID() > -1 );
00090 //   brush.setColor( dnpcolors[ dnpData()->get_dnpID() % num_colors ] );
00091   assert( dnpData()->get_dnp_type() > -1 );
00092   brush.setColor( dnpcolors[ dnpData()->get_dnp_type() % num_colors ] );
00093 
00094   
00095   long long int min_width(8);
00096   
00097   int used_width = max( min_width, static_cast<long long>((x2_dna - x1_dna + 1 )* width) );
00098   
00099   //     p->fillRect( x_pix, y_pix, (x2_dna - x1_dna + 1 )* width , height , brush) ;
00100   p->fillRect( x_pix, y_pix, used_width , height , brush) ;
00101   return;
00102 }


The documentation for this class was generated from the following files:
Generated on Fri Mar 17 17:44:58 2006 for trapper by  doxygen 1.4.4