diff --git a/src/zmapFeature/zmapFeature.c b/src/zmapFeature/zmapFeature.c index b0acc9641b19265192301ecab30d9da95ebf52d8..db6152ba3be51830222cbbb906bf0306013a281b 100755 --- a/src/zmapFeature/zmapFeature.c +++ b/src/zmapFeature/zmapFeature.c @@ -27,9 +27,9 @@ * * Exported functions: See zmapView_P.h * HISTORY: - * Last edited: Apr 3 16:47 2009 (edgrif) + * Last edited: Apr 28 12:44 2009 (edgrif) * Created: Fri Jul 16 13:05:58 2004 (edgrif) - * CVS info: $Id: zmapFeature.c,v 1.109 2009-04-06 13:04:34 edgrif Exp $ + * CVS info: $Id: zmapFeature.c,v 1.110 2009-04-28 14:29:49 edgrif Exp $ *------------------------------------------------------------------- */ @@ -2725,7 +2725,7 @@ static void addFeatureModeCB(gpointer key, gpointer data, gpointer user_data) mode = ZMAPSTYLE_MODE_ALIGNMENT ; /* Initially alignments should not be bumped. */ - zMapStyleInitOverlapMode(style, ZMAPOVERLAP_COMPLEX_LIMIT, ZMAPOVERLAP_COMPLETE) ; + zMapStyleInitBumpMode(style, ZMAPBUMP_NAME_COLINEAR, ZMAPBUMP_UNBUMP) ; break ; } @@ -2733,10 +2733,10 @@ static void addFeatureModeCB(gpointer key, gpointer data, gpointer user_data) { mode = ZMAPSTYLE_MODE_TRANSCRIPT ; - /* We simply never want transcripts to overlap. */ - zMapStyleInitOverlapMode(style, ZMAPOVERLAP_COMPLEX_INTERLEAVE, ZMAPOVERLAP_COMPLEX_INTERLEAVE) ; + /* We simply never want transcripts to bump. */ + zMapStyleInitBumpMode(style, ZMAPBUMP_NAME_INTERLEAVE, ZMAPBUMP_NAME_INTERLEAVE) ; - /* We also never need them to be hidden when they don't overlap the marked region. */ + /* We also never need them to be hidden when they don't bump the marked region. */ zMapStyleSetDisplay(style, ZMAPSTYLE_COLDISPLAY_SHOW) ; break ; diff --git a/src/zmapFeature/zmapFeatureTypes.c b/src/zmapFeature/zmapFeatureTypes.c index 4147263acb541148453321f27e8399c4f6039f8c..ede790a28c44ae7358a745a683da0197c0b446f8 100755 --- a/src/zmapFeature/zmapFeatureTypes.c +++ b/src/zmapFeature/zmapFeatureTypes.c @@ -27,9 +27,9 @@ * * Exported functions: See ZMap/zmapFeature.h * HISTORY: - * Last edited: Apr 22 09:26 2009 (edgrif) + * Last edited: Apr 28 14:24 2009 (edgrif) * Created: Tue Dec 14 13:15:11 2004 (edgrif) - * CVS info: $Id: zmapFeatureTypes.c,v 1.79 2009-04-22 16:26:07 edgrif Exp $ + * CVS info: $Id: zmapFeatureTypes.c,v 1.80 2009-04-28 14:29:49 edgrif Exp $ *------------------------------------------------------------------- */ @@ -256,16 +256,22 @@ gboolean zMapStyleMerge(ZMapFeatureTypeStyle curr_style, ZMapFeatureTypeStyle ne curr_style->fields_set.col_display_state = TRUE ; } - if (new_style->fields_set.curr_overlap_mode) + if (new_style->fields_set.curr_bump_mode) { - curr_style->curr_overlap_mode = new_style->curr_overlap_mode ; - curr_style->fields_set.curr_overlap_mode = TRUE ; + curr_style->curr_bump_mode = new_style->curr_bump_mode ; + curr_style->fields_set.curr_bump_mode = TRUE ; } - if (new_style->fields_set.default_overlap_mode) + if (new_style->fields_set.default_bump_mode) { - curr_style->default_overlap_mode = new_style->default_overlap_mode ; - curr_style->fields_set.default_overlap_mode = TRUE ; + curr_style->default_bump_mode = new_style->default_bump_mode ; + curr_style->fields_set.default_bump_mode = TRUE ; + } + + if (new_style->fields_set.bump_fixed) + { + curr_style->opts.bump_fixed = new_style->opts.bump_fixed ; + curr_style->fields_set.bump_fixed = TRUE ; } if (new_style->fields_set.bump_spacing) @@ -658,14 +664,14 @@ void zMapStyleSetScore(ZMapFeatureTypeStyle style, char *score_str, /* WE ONLY SCORE BY WIDTH AT THE MOMENT..... */ if (bump_str && *bump_str) { - if (g_ascii_strcasecmp(bump_str, "overlap") == 0) - bump = ZMAPOVERLAP_OVERLAP ; + if (g_ascii_strcasecmp(bump_str, "bump") == 0) + bump = ZMAPBUMP_OVERLAP ; else if (g_ascii_strcasecmp(bump_str, "position") == 0) - bump = ZMAPOVERLAP_POSITION ; + bump = ZMAPBUMP_POSITION ; else if (g_ascii_strcasecmp(bump_str, "name") == 0) - bump = ZMAPOVERLAP_NAME ; + bump = ZMAPBUMP_NAME ; else if (g_ascii_strcasecmp(bump_str, "simple") == 0) - bump = ZMAPOVERLAP_SIMPLE ; + bump = ZMAPBUMP_SIMPLE ; } #endif /* ED_G_NEVER_INCLUDE_THIS_CODE */ @@ -797,18 +803,21 @@ void zMapStyleSetGFF(ZMapFeatureTypeStyle style, char *gff_source, char *gff_fea -void zMapStyleSetOverlapMode(ZMapFeatureTypeStyle style, ZMapStyleOverlapMode overlap_mode) +void zMapStyleSetBumpMode(ZMapFeatureTypeStyle style, ZMapStyleBumpMode bump_mode) { - zMapAssert(style && (overlap_mode >= ZMAPOVERLAP_START && overlap_mode <= ZMAPOVERLAP_END)) ; + zMapAssert(style && (bump_mode >= ZMAPBUMP_START && bump_mode <= ZMAPBUMP_END)) ; - if (!style->fields_set.curr_overlap_mode) + if (!zmapStyleBumpIsFixed(style)) { - style->fields_set.curr_overlap_mode = TRUE ; - - style->default_overlap_mode = overlap_mode ; - } + if (!style->fields_set.curr_bump_mode) + { + style->fields_set.curr_bump_mode = TRUE ; + + style->default_bump_mode = bump_mode ; + } - style->curr_overlap_mode = overlap_mode ; + style->curr_bump_mode = bump_mode ; + } return ; } @@ -838,37 +847,45 @@ double zMapStyleGetBumpSpace(ZMapFeatureTypeStyle style) -/* Reset overlap mode to default and returns the default mode. */ -ZMapStyleOverlapMode zMapStyleResetOverlapMode(ZMapFeatureTypeStyle style) +/* Reset bump mode to default and returns the default mode. */ +ZMapStyleBumpMode zMapStyleResetBumpMode(ZMapFeatureTypeStyle style) { - zMapAssert(style && style->fields_set.curr_overlap_mode) ; + ZMapStyleBumpMode default_mode = ZMAPBUMP_INVALID ; + + zMapAssert(style) ; - style->curr_overlap_mode = style->default_overlap_mode ; + if (!zmapStyleBumpIsFixed(style)) + { + default_mode = style->curr_bump_mode = style->default_bump_mode ; + } - return style->curr_overlap_mode ; + return default_mode ; } -/* Re/init overlap mode. */ -void zMapStyleInitOverlapMode(ZMapFeatureTypeStyle style, - ZMapStyleOverlapMode default_overlap_mode, ZMapStyleOverlapMode curr_overlap_mode) +/* Re/init bump mode. */ +void zMapStyleInitBumpMode(ZMapFeatureTypeStyle style, + ZMapStyleBumpMode default_bump_mode, ZMapStyleBumpMode curr_bump_mode) { zMapAssert(style - && (default_overlap_mode == ZMAPOVERLAP_INVALID - || (default_overlap_mode >= ZMAPOVERLAP_START && default_overlap_mode <= ZMAPOVERLAP_END)) - && (curr_overlap_mode == ZMAPOVERLAP_INVALID - || (curr_overlap_mode >= ZMAPOVERLAP_START && curr_overlap_mode <= ZMAPOVERLAP_END))) ; + && (default_bump_mode == ZMAPBUMP_INVALID + || (default_bump_mode >= ZMAPBUMP_START && default_bump_mode <= ZMAPBUMP_END)) + && (curr_bump_mode == ZMAPBUMP_INVALID + || (curr_bump_mode >= ZMAPBUMP_START && curr_bump_mode <= ZMAPBUMP_END))) ; - if (curr_overlap_mode != ZMAPOVERLAP_INVALID) + if (!zmapStyleBumpIsFixed(style)) { - style->fields_set.curr_overlap_mode = TRUE ; - style->curr_overlap_mode = curr_overlap_mode ; - } + if (curr_bump_mode != ZMAPBUMP_INVALID) + { + style->fields_set.curr_bump_mode = TRUE ; + style->curr_bump_mode = curr_bump_mode ; + } - if (default_overlap_mode != ZMAPOVERLAP_INVALID) - { - style->fields_set.default_overlap_mode = TRUE ; - style->default_overlap_mode = default_overlap_mode ; + if (default_bump_mode != ZMAPBUMP_INVALID) + { + style->fields_set.default_bump_mode = TRUE ; + style->default_bump_mode = default_bump_mode ; + } } return ; @@ -1015,8 +1032,8 @@ GData *zMapStyleGetAllPredefined(void) ZMAP_FIXED_STYLE_3FRAME_TEXT); g_object_set(G_OBJECT(curr), ZMAPSTYLE_PROPERTY_MODE, ZMAPSTYLE_MODE_META, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, ZMAPSTYLE_PROPERTY_DISPLAYABLE, FALSE, NULL); g_datalist_id_set_data(&style_list, curr->unique_id, curr) ; @@ -1044,8 +1061,10 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_DISPLAYABLE, TRUE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_HIDE, ZMAPSTYLE_PROPERTY_WIDTH, 900.0, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_BUMP_FIXED, TRUE, ZMAPSTYLE_PROPERTY_BUMP_SPACING, 10.0, ZMAPSTYLE_PROPERTY_STRAND_SPECIFIC, TRUE, ZMAPSTYLE_PROPERTY_SHOW_REVERSE_STRAND, FALSE, @@ -1067,8 +1086,9 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_DISPLAYABLE, TRUE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_HIDE, ZMAPSTYLE_PROPERTY_WIDTH, 300.0, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_BUMP_FIXED, TRUE, ZMAPSTYLE_PROPERTY_STRAND_SPECIFIC, TRUE, ZMAPSTYLE_PROPERTY_COLOURS, colours, NULL); @@ -1086,8 +1106,8 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_MODE, ZMAPSTYLE_MODE_TEXT, ZMAPSTYLE_PROPERTY_DISPLAYABLE, TRUE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_HIDE, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, ZMAPSTYLE_PROPERTY_STRAND_SPECIFIC, TRUE, ZMAPSTYLE_PROPERTY_COLOURS, colours, NULL); @@ -1102,8 +1122,9 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_MODE, ZMAPSTYLE_MODE_META, ZMAPSTYLE_PROPERTY_DISPLAYABLE, FALSE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_HIDE, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_BUMP_FIXED, TRUE, NULL); g_datalist_id_set_data(&style_list, curr->unique_id, curr); @@ -1115,8 +1136,9 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_MODE, ZMAPSTYLE_MODE_META, ZMAPSTYLE_PROPERTY_DISPLAYABLE, FALSE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_HIDE, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_BUMP_FIXED, TRUE, NULL); g_datalist_id_set_data(&style_list, curr->unique_id, curr); @@ -1131,8 +1153,9 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_MODE, ZMAPSTYLE_MODE_TEXT, ZMAPSTYLE_PROPERTY_DISPLAYABLE, TRUE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_HIDE, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_BUMP_FIXED, TRUE, ZMAPSTYLE_PROPERTY_WIDTH, 300.0, ZMAPSTYLE_PROPERTY_STRAND_SPECIFIC, TRUE, ZMAPSTYLE_PROPERTY_COLOURS, colours, @@ -1148,8 +1171,9 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_MODE, ZMAPSTYLE_MODE_META, ZMAPSTYLE_PROPERTY_DISPLAYABLE, FALSE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_HIDE, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_BUMP_FIXED, TRUE, NULL); g_datalist_id_set_data(&style_list, curr->unique_id, curr); @@ -1165,8 +1189,9 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_MODE, ZMAPSTYLE_MODE_BASIC, ZMAPSTYLE_PROPERTY_DISPLAYABLE, TRUE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_HIDE, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_COMPLETE, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_UNBUMP, + ZMAPSTYLE_PROPERTY_BUMP_FIXED, TRUE, ZMAPSTYLE_PROPERTY_WIDTH, 15.0, ZMAPSTYLE_PROPERTY_STRAND_SPECIFIC, FALSE, ZMAPSTYLE_PROPERTY_SHOW_ONLY_IN_SEPARATOR, TRUE, @@ -1187,9 +1212,10 @@ GData *zMapStyleGetAllPredefined(void) ZMAPSTYLE_PROPERTY_MODE, ZMAPSTYLE_MODE_BASIC, ZMAPSTYLE_PROPERTY_DISPLAYABLE, TRUE, ZMAPSTYLE_PROPERTY_DISPLAY_MODE, ZMAPSTYLE_COLDISPLAY_SHOW, - ZMAPSTYLE_PROPERTY_WIDTH, 20.0, - ZMAPSTYLE_PROPERTY_OVERLAP_MODE, ZMAPOVERLAP_OSCILLATE, - ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, ZMAPOVERLAP_OSCILLATE, + ZMAPSTYLE_PROPERTY_WIDTH, 10.0, + ZMAPSTYLE_PROPERTY_BUMP_MODE, ZMAPBUMP_ALTERNATING, + ZMAPSTYLE_PROPERTY_DEFAULT_BUMP_MODE, ZMAPBUMP_ALTERNATING, + ZMAPSTYLE_PROPERTY_BUMP_FIXED, TRUE, ZMAPSTYLE_PROPERTY_COLOURS, colours, NULL); } diff --git a/src/zmapFeature/zmapStyleUtils.c b/src/zmapFeature/zmapStyleUtils.c index ba0f5901feb9df42a9606abecd3668d0ecd42ede..cfb42c1119908a32462f30ce9d89240fba17330c 100755 --- a/src/zmapFeature/zmapStyleUtils.c +++ b/src/zmapFeature/zmapStyleUtils.c @@ -28,9 +28,9 @@ * Exported functions: See ZMap/zmapStyle.h * * HISTORY: - * Last edited: Feb 4 11:52 2009 (edgrif) + * Last edited: Apr 27 14:10 2009 (edgrif) * Created: Thu Oct 30 10:24:35 2008 (edgrif) - * CVS info: $Id: zmapStyleUtils.c,v 1.3 2009-02-04 15:58:47 edgrif Exp $ + * CVS info: $Id: zmapStyleUtils.c,v 1.4 2009-04-28 14:29:49 edgrif Exp $ *------------------------------------------------------------------- */ @@ -114,16 +114,16 @@ static void listPrintFunc(gpointer data, gpointer user_data) ; * } * * */ -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2Mode, ZMapStyleMode, ZMAPSTYLE_MODE_INVALID, ZMAP_STYLE_MODE_LIST) ; -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2ColDisplayState, ZMapStyleColumnDisplayState, ZMAPSTYLE_COLDISPLAY_INVALID, ZMAP_STYLE_COLUMN_DISPLAY_LIST); -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr23FrameMode, ZMapStyle3FrameMode, ZMAPSTYLE_3_FRAME_INVALID, ZMAP_STYLE_3_FRAME_LIST) ; -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2GraphMode, ZMapStyleGraphMode, ZMAPSTYLE_GRAPH_INVALID, ZMAP_STYLE_GRAPH_MODE_LIST); -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2GlyphMode, ZMapStyleGlyphMode, ZMAPSTYLE_GLYPH_INVALID, ZMAP_STYLE_GLYPH_MODE_LIST); -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2DrawContext, ZMapStyleDrawContext, ZMAPSTYLE_DRAW_INVALID, ZMAP_STYLE_DRAW_CONTEXT_LIST); -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2ColourType, ZMapStyleColourType, ZMAPSTYLE_COLOURTYPE_INVALID, ZMAP_STYLE_COLOUR_TYPE_LIST); -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2ColourTarget, ZMapStyleColourTarget, ZMAPSTYLE_COLOURTARGET_INVALID, ZMAP_STYLE_COLOUR_TARGET_LIST); -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2ScoreMode, ZMapStyleScoreMode, ZMAPSCORE_INVALID, ZMAP_STYLE_SCORE_MODE_LIST); -ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2OverlapMode, ZMapStyleOverlapMode, ZMAPOVERLAP_INVALID, ZMAP_STYLE_OVERLAP_MODE_LIST); +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2Mode, ZMapStyleMode, ZMAPSTYLE_MODE_INVALID, ZMAP_STYLE_MODE_LIST, , ) ; +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2ColDisplayState, ZMapStyleColumnDisplayState, ZMAPSTYLE_COLDISPLAY_INVALID, ZMAP_STYLE_COLUMN_DISPLAY_LIST, , ); +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr23FrameMode, ZMapStyle3FrameMode, ZMAPSTYLE_3_FRAME_INVALID, ZMAP_STYLE_3_FRAME_LIST, , ) ; +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2GraphMode, ZMapStyleGraphMode, ZMAPSTYLE_GRAPH_INVALID, ZMAP_STYLE_GRAPH_MODE_LIST, , ); +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2GlyphMode, ZMapStyleGlyphMode, ZMAPSTYLE_GLYPH_INVALID, ZMAP_STYLE_GLYPH_MODE_LIST, , ); +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2DrawContext, ZMapStyleDrawContext, ZMAPSTYLE_DRAW_INVALID, ZMAP_STYLE_DRAW_CONTEXT_LIST, , ); +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2ColourType, ZMapStyleColourType, ZMAPSTYLE_COLOURTYPE_INVALID, ZMAP_STYLE_COLOUR_TYPE_LIST, , ); +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2ColourTarget, ZMapStyleColourTarget, ZMAPSTYLE_COLOURTARGET_INVALID, ZMAP_STYLE_COLOUR_TARGET_LIST, , ); +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2ScoreMode, ZMapStyleScoreMode, ZMAPSCORE_INVALID, ZMAP_STYLE_SCORE_MODE_LIST, , ); +ZMAP_ENUM_FROM_STRING_FUNC(zMapStyleStr2BumpMode, ZMapStyleBumpMode, ZMAPBUMP_INVALID, ZMAP_STYLE_BUMP_MODE_LIST, , ); @@ -146,7 +146,23 @@ ZMAP_ENUM_AS_EXACT_STRING_FUNC(zmapStyleDrawContext2ExactStr, ZMapStyleDrawC ZMAP_ENUM_AS_EXACT_STRING_FUNC(zmapStyleColourType2ExactStr, ZMapStyleColourType, ZMAP_STYLE_COLOUR_TYPE_LIST); ZMAP_ENUM_AS_EXACT_STRING_FUNC(zmapStyleColourTarget2ExactStr, ZMapStyleColourTarget, ZMAP_STYLE_COLOUR_TARGET_LIST); ZMAP_ENUM_AS_EXACT_STRING_FUNC(zmapStyleScoreMode2ExactStr, ZMapStyleScoreMode, ZMAP_STYLE_SCORE_MODE_LIST); -ZMAP_ENUM_AS_EXACT_STRING_FUNC(zmapStyleOverlapMode2ExactStr, ZMapStyleOverlapMode, ZMAP_STYLE_OVERLAP_MODE_LIST); +ZMAP_ENUM_AS_EXACT_STRING_FUNC(zmapStyleBumpMode2ExactStr, ZMapStyleBumpMode, ZMAP_STYLE_BUMP_MODE_LIST); + + + +/* Enum -> Short Text functions, these functions convert the enums to their corresponding short + * text description. + * + * The functions all have the form + * const char *zMapStyleXXXXMode2ExactStr(ZMapStyleXXXXXMode mode) + * { + * code... + * } + * + * */ +ZMAP_ENUM_TO_SHORT_TEXT_FUNC(zmapStyleBumpMode2ShortText, ZMapStyleBumpMode, ZMAP_STYLE_BUMP_MODE_LIST); + + @@ -383,9 +399,9 @@ void zMapStylePrint(ZMapIOOut dest, ZMapFeatureTypeStyle style, char *prefix, gb PRINTFIELD(dest, fields_set.min_mag, min_mag, "Min mag", "%g", (double)) ; PRINTFIELD(dest, fields_set.max_mag, max_mag, "Max mag", "%g", (double)) ; - PRINTFIELD(dest, fields_set.curr_overlap_mode, curr_overlap_mode, "Current Overlap mode", "%s", zmapStyleOverlapMode2ExactStr) ; - PRINTFIELD(dest, fields_set.default_overlap_mode, default_overlap_mode, "Default Overlap mode", "%s", zmapStyleOverlapMode2ExactStr) ; - + PRINTFIELD(dest, fields_set.curr_bump_mode, curr_bump_mode, "Current Bump mode", "%s", zmapStyleBumpMode2ExactStr) ; + PRINTFIELD(dest, fields_set.default_bump_mode, default_bump_mode, "Default Bump mode", "%s", zmapStyleBumpMode2ExactStr) ; + PRINTFIELD(dest, fields_set.bump_fixed, opts.bump_fixed, "Bump Fixed", "%s", PRINTBOOL) ; PRINTFIELD(dest, fields_set.bump_spacing, bump_spacing, "Bump Spacing", "%g", (double)) ; PRINTFIELD(dest, fields_set.width, width, "Width", "%g", (double)) ; @@ -489,9 +505,16 @@ void zMapStylePrint(ZMapIOOut dest, ZMapFeatureTypeStyle style, char *prefix, gb +/* Returns TRUE if bumping has been fixed to one type, FALSE otherwise. */ +gboolean zmapStyleBumpIsFixed(ZMapFeatureTypeStyle style) +{ + gboolean is_fixed = FALSE ; + if (style->fields_set.bump_fixed && style->opts.bump_fixed) + is_fixed = TRUE ; - + return is_fixed ; +} diff --git a/src/zmapFeature/zmapStyle_I.h b/src/zmapFeature/zmapStyle_I.h index 98755d0fe353180f32a1366444ea557d44704c58..f44e40a88882b88b6f746e30f39b0156ea071f17 100755 --- a/src/zmapFeature/zmapStyle_I.h +++ b/src/zmapFeature/zmapStyle_I.h @@ -26,9 +26,9 @@ * Description: Private header for style. * * HISTORY: - * Last edited: Apr 6 11:51 2009 (edgrif) + * Last edited: Apr 27 14:30 2009 (edgrif) * Created: Mon Feb 26 09:13:30 2007 (edgrif) - * CVS info: $Id: zmapStyle_I.h,v 1.9 2009-04-06 13:52:44 edgrif Exp $ + * CVS info: $Id: zmapStyle_I.h,v 1.10 2009-04-28 14:29:49 edgrif Exp $ *------------------------------------------------------------------- */ @@ -285,8 +285,9 @@ typedef struct _zmapFeatureTypeStyleStruct unsigned int col_display_state : 1 ; - unsigned int default_overlap_mode : 1 ; - unsigned int curr_overlap_mode : 1 ; + unsigned int default_bump_mode : 1 ; + unsigned int curr_bump_mode : 1 ; + unsigned int bump_fixed : 1 ; unsigned int bump_spacing : 1 ; unsigned int min_mag : 1 ; @@ -355,8 +356,8 @@ typedef struct _zmapFeatureTypeStyleStruct ZMapStyleColumnDisplayState col_display_state ; /* Controls how/when col is displayed. */ - ZMapStyleOverlapMode default_overlap_mode ; /*!< Allows return to original bump mode. */ - ZMapStyleOverlapMode curr_overlap_mode ; /*!< Controls how features are grouped + ZMapStyleBumpMode default_bump_mode ; /*!< Allows return to original bump mode. */ + ZMapStyleBumpMode curr_bump_mode ; /*!< Controls how features are grouped into sub columns within a column. */ double bump_spacing ; /*!< gap between bumped features. */ @@ -388,7 +389,7 @@ typedef struct _zmapFeatureTypeStyleStruct unsigned int show_when_empty : 1 ; /*!< If FALSE, features' column is displayed even if there are no features. */ - + unsigned int bump_fixed : 1 ; /*!< If TRUE then bump mode cannot be changed. */ unsigned int showText : 1 ; /*!< Should feature text be displayed. */ @@ -437,7 +438,7 @@ ZMAP_ENUM_AS_STRING_DEC(zmapStyleDrawContext2Str, ZMapStyleDrawContext); ZMAP_ENUM_AS_STRING_DEC(zmapStyleColourType2Str, ZMapStyleColourType); ZMAP_ENUM_AS_STRING_DEC(zmapStyleColourTarget2Str, ZMapStyleColourTarget); ZMAP_ENUM_AS_STRING_DEC(zmapStyleScoreMode2Str, ZMapStyleScoreMode); -ZMAP_ENUM_AS_STRING_DEC(zmapStyleOverlapMode2Str, ZMapStyleOverlapMode); +ZMAP_ENUM_AS_STRING_DEC(zmapStyleBumpMode2Str, ZMapStyleBumpMode); #endif /* ED_G_NEVER_INCLUDE_THIS_CODE */ @@ -446,6 +447,7 @@ ZMAP_ENUM_AS_STRING_DEC(zmapStyleOverlapMode2Str, ZMapStyleOverlapMode); gboolean zmapStyleIsValid(ZMapFeatureTypeStyle style) ; +gboolean zmapStyleBumpIsFixed(ZMapFeatureTypeStyle style) ;