Jeremy Boulton
Last Updated: 2/20/98
The Chromosome class
class Chromosome : GraphicsObject {
private:
chromBand_DBase *band_db; // pointer to info about bands
int zoomable; // boolean
int posx1, posx2, posy1; // where on screen do we draw?
float left_acedb_coord, scale; // what part of the chrom?
// should it be 'long'?
public:
Chromosome( chromBand_DBase *cbd, int x1, int x2, int y1, int zoom );
~Chromosome();
SetZoom( acedb_x1, scale );
ActionEvent ProcessMouseEvent( MouseEvent );
ActionEvent ProcessKeyboardEvent( KeyboardEvent );
void paint( void );
};
The chromBand_Dbase argument to the constructor tells the object where
to get information about the chromosome bands - it is a pointer to
the band database.
The Process*Event() functions return ActionEvents so that the caller
(the Window) will know if any action on the object affects the viewing
of any other object or if the object has changed in such a way that the
database needs to be updated. This is probably not the case for this
object unless highlighting a band highlights all BACs in that band or
something.
Chromosome::Chromosome( chromBand_Dbase *cbd, int x1, int x2, int y1, int zoom )
{
band_db = cbd;
posx1 = x1;
posx2 = x2;
posy1 = y1;
float left_acedb_coord = MIN_ACEDB_COORD; // -40000 or something?
scale = 1.0;
zoomable = zoom;
}
The zoomed version of the chromosome picture and the constant-scale
version will be two different instances of the same class, instantiated
with different values (false/true) of zoomability.