#include <featuregui.h>
Inheritance diagram for FeatureGui:
Public Member Functions | |
FeatureGui (SpatialFeatureData *data) | |
virtual | ~FeatureGui () |
void | paint (QPainter *p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna, double width, int height, int center) |
Protected Member Functions | |
virtual 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)=0 |
Protected Attributes | |
SpatialFeatureData * | m_data |
Definition at line 41 of file featuregui.h.
FeatureGui::FeatureGui | ( | SpatialFeatureData * | data | ) | [inline] |
virtual FeatureGui::~FeatureGui | ( | ) | [inline, virtual] |
void FeatureGui::paint | ( | QPainter * | p, | |
TR_PIX | x_pix, | |||
TR_PIX | y_pix, | |||
TR_DNA | x1_dna, | |||
TR_DNA | x2_dna, | |||
double | width, | |||
int | height, | |||
int | center | |||
) |
Definition at line 25 of file featuregui.cpp.
References SpatialFeatureData::endPos(), m_data, paintMe(), SpatialFeatureData::startPos(), and TR_DNA.
Referenced by TrapperView::paintFeatures().
00027 { 00028 /* we don't need to paint outside the window, thus we seak max and min values */ 00029 00030 // TR_DNA x1_dna_cut = max( m_data->startPos(), x1_dna ) ; 00031 // TR_DNA x2_dna_cut = min( m_data->endPos(), x2_dna ); 00032 00033 //EA smarter alternative? 00034 TR_DNA x1_dna_cut; 00035 00036 if ( (x1_dna_cut = max( m_data->startPos(), x1_dna )) > x2_dna ) 00037 return; 00038 00039 TR_DNA x2_dna_cut; 00040 00041 if ( ( x2_dna_cut = min( m_data->endPos(), x2_dna ) ) < x1_dna ) 00042 return; 00043 00044 00045 /* 00046 cerr << "uniquename=" << m_data->uniqueName() 00047 << " x1_dna=" << x1_dna 00048 << " x2_dna=" << x2_dna 00049 << " startPos=" << m_data->startPos() 00050 << " endPos=" << m_data->endPos() 00051 << " x1_dna_cut=" << x1_dna_cut 00052 << " x2_dna_cut=" << x2_dna_cut 00053 << endl; 00054 */ 00055 00056 x_pix += static_cast<TR_PIX>(( x1_dna_cut - x1_dna ) * width); 00057 00058 00059 paintMe( p, x_pix, y_pix, x1_dna_cut, x2_dna_cut, width, height, center); 00060 }
virtual void FeatureGui::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 | |||
) | [protected, pure virtual] |
Paints the visual appearance of a feature.
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. |
Implemented in DnpGui, DnaStrGui, ChromatGui, QualityGui, and TagGui.
Referenced by paint().
SpatialFeatureData* FeatureGui::m_data [protected] |
Definition at line 51 of file featuregui.h.
Referenced by ChromatGui::chromatData(), DnaStrGui::dnaStrData(), DnpGui::dnpData(), paint(), QualityGui::qualityData(), and TagGui::tagData().