TagGui Class Reference

The visual appearance of a TagData. More...

#include <featuregui.h>

Inheritance diagram for TagGui:

Inheritance graph
[legend]
Collaboration diagram for TagGui:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TagGui (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)
TagDatatagData ()

Detailed Description

The visual appearance of a TagData.

Definition at line 136 of file featuregui.h.


Constructor & Destructor Documentation

TagGui::TagGui ( SpatialFeatureData data  )  [inline]

Definition at line 139 of file featuregui.h.

00139                                         : FeatureGui( data )
00140     {
00141     }


Member Function Documentation

void TagGui::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 313 of file featuregui.cpp.

References QPainter::fillRect(), TagData::getScore(), QBrush::setColor(), QBrush::setStyle(), and tagData().

00315 {
00316   static TagColorMap colormap;
00317 
00318 
00319   QBrush brush;
00320   brush.setStyle( Qt::SolidPattern );
00321   
00322 //   brush.setColor( colormap.getColor(tagData()->uniqueName()) );
00323 //   brush.setColor( colormap.getColor(tagData()->getInfo()) );
00324   double score = tagData()->getScore();
00325   if ( score < 1 ) {
00326     score = 1;
00327   }
00328   
00329   int gb = 255 - (log10(score) * 85);
00330   if (gb < 0) {
00331     gb = 0;
00332   }
00333   brush.setColor( QColor(255, gb, gb) );
00334   
00335 
00336   p->fillRect( x_pix, y_pix, static_cast<int>((x2_dna - x1_dna + 1 )* width), height , brush) ;
00337 
00338   return;
00339 }

TagData * TagGui::tagData (  ) 

Definition at line 341 of file featuregui.cpp.

References FeatureGui::m_data.

Referenced by paintMe().

00342 {
00343     return dynamic_cast<TagData *>( m_data );
00344 }


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