FeatureGui Class Reference

Abstract class for the visual appereance of a feature. Each FeatureData derived class will have a corresponding FeatureGui derived class with a specialized paintMe() method. More...

#include <featuregui.h>

Inheritance diagram for FeatureGui:

Inheritance graph
[legend]
Collaboration diagram for FeatureGui:

Collaboration graph
[legend]
List of all members.

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

SpatialFeatureDatam_data

Detailed Description

Abstract class for the visual appereance of a feature. Each FeatureData derived class will have a corresponding FeatureGui derived class with a specialized paintMe() method.

Definition at line 41 of file featuregui.h.


Constructor & Destructor Documentation

FeatureGui::FeatureGui ( SpatialFeatureData data  )  [inline]

Definition at line 44 of file featuregui.h.

00044                                           : m_data( data )
00045   {}

virtual FeatureGui::~FeatureGui (  )  [inline, virtual]

Definition at line 46 of file featuregui.h.

00047   {}


Member Function Documentation

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.

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.

Implemented in DnpGui, DnaStrGui, ChromatGui, QualityGui, and TagGui.

Referenced by paint().


Member Data Documentation

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().


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