src/hg/hgTracks/imageV2.h 1.7

1.7 2009/09/14 15:22:39 tdreszer
Added imgTrackAddMapItem to let the imgTrack divide map items between slices.
Index: src/hg/hgTracks/imageV2.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/imageV2.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -B -U 4 -r1.6 -r1.7
--- src/hg/hgTracks/imageV2.h	4 Sep 2009 18:24:06 -0000	1.6
+++ src/hg/hgTracks/imageV2.h	14 Sep 2009 15:22:39 -0000	1.7
@@ -9,8 +9,12 @@
 //#define IMAGEv2_DRAG_REORDER
 //#define IMAGEv2_DRAG_SCROLL
 //#define IMAGEv2_DRAG_SCROLL_SZ 3
 
+#if defined(IMAGEv2_DRAG_SCROLL_SZ) && (IMAGEv2_DRAG_SCROLL_SZ > 1)
+    //#define IMAGEv2_SHORT_MAPITEMS
+#endif// defined(IMAGEv2_DRAG_SCROLL_SZ) && (IMAGEv2_DRAG_SCROLL_SZ > 1)
+
 // CURRENT PROBLEMS:
 // o some map items span both sideLabel and data!!
 // o subrtacks should be dragReorderable!!!  Make them individual imgTracks
 // o centerlabel next feature '>>' arrows are scrolled off screen: fix when centerlabels are small and don't scroll
@@ -22,9 +26,9 @@
 #define IMAGEV2_H
 
 extern struct imgBox   *theImgBox;   // Make this global for now to avoid huge rewrite
 //extern struct image    *theOneImg;   // Make this global for now to avoid huge rewrite
-//extern struct imgTrack *curImgTrack; // Make this global for now to avoid huge rewrite
+extern struct imgTrack *curImgTrack; // Make this global for now to avoid huge rewrite
 //extern struct imgSlice *curSlice;    // Make this global for now to avoid huge rewrite
 extern struct mapSet   *curMap;      // Make this global for now to avoid huge rewrite
 //extern struct mapItem  *curMapItem;  // Make this global for now to avoid huge rewrite
 
@@ -172,9 +176,9 @@
 struct imgTrack // IMAGEv2: imageBox conatins list of displayed imageTracks
     {
     struct imgTrack *next;    // slList
     struct trackDb *tdb;	  // trackDb entry (should this be struct track* entry?)
-    char *name;	              // It is possible to have an imgTrack without a tdb, but then it mist have a name
+    char *name;	              // It is possible to have an imgTrack without a tdb, but then it must have a name
     char *db;                 // Image for db (species) (assert imgTrack matches imgBox)
     char *chrom;              // Image for chrom (assert imgTrack matches imgBox)
     int  chromStart;          // Image start (absolute, not portal position)
     int  chromEnd;            // Image end (absolute, not portal position)
@@ -204,8 +208,12 @@
 struct imgSlice *imgTrackSliceUpdateOrAdd(struct imgTrack *imgTrack,enum sliceType type, struct image *img,char *title,int width,int height,int offsetX,int offsetY);
 /* Updates the slice or adds it */
 struct mapSet *imgTrackGetMapByType(struct imgTrack *imgTrack,enum sliceType type);
 /* Gets the map assocated with a specific slice belonging to the imgTrack */
+int imgTrackAddMapItem(struct imgTrack *imgTrack,char *link,char *title,int topLeftX,int topLeftY,int bottomRightX,int bottomRightY);
+/* Will add a map item it an imgTrack's appropriate slice's map
+   Since a map item may span slices, the imgTrack is in the best position to determine where to put the map item
+   returns count of map items added, which could be 0, 1 or more than one if item spans slices */
 boolean imgTrackIsComplete(struct imgTrack *imgTrack,boolean verbose);
 /* Tests the completeness and consistency of this imgTrack (not including slices) */
 void imgTrackFree(struct imgTrack **pImgTrack);
 /* frees all memory assocated with an imgTrack (including slices) */