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 (SpatialFeatureData *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 68 of file featuregui.h.


Constructor & Destructor Documentation

DnpGui::DnpGui ( SpatialFeatureData data  )  [inline]

Definition at line 71 of file featuregui.h.

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


Member Function Documentation

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 62 of file featuregui.cpp.

References dnpData(), QPainter::fillRect(), QBrush::setColor(), and QBrush::setStyle().

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

DnpData * DnpGui::dnpData (  ) 

Definition at line 105 of file featuregui.cpp.

References FeatureGui::m_data.

Referenced by paintMe().

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


The documentation for this class was generated from the following files:
Generated on Fri Jul 17 20:19:46 2009 for ngsview by  doxygen 1.5.1