#include <featuregui.h>
Inheritance diagram for DnpGui:
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) |
DnpData * | dnpData () |
Definition at line 66 of file featuregui.h.
|
Definition at line 69 of file featuregui.h. 00069 : FeatureGui( data ) 00070 { 00071 // cerr << "in dnpgui ctor" << endl; 00072 }
|
|
Definition at line 104 of file featuregui.cpp. References FeatureGui::m_data. Referenced by paintMe(). 00105 { 00106 return dynamic_cast<DnpData *>( m_data ); 00107 }
|
|
Paints the visual appearance of a feature.
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 }
|