diff options
Diffstat (limited to 'src/bltGrElemLine.C')
-rw-r--r-- | src/bltGrElemLine.C | 229 |
1 files changed, 0 insertions, 229 deletions
diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index e77641b..fcba9ca 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -558,132 +558,6 @@ static Blt_ConfigSpec lineElemConfigSpecs[] = }; -static Blt_ConfigSpec stripElemConfigSpecs[] = -{ - {BLT_CONFIG_CUSTOM, "-activepen", "activePen", "ActivePen", - DEF_LINE_ACTIVE_PEN, Blt_Offset(LineElement, activePenPtr), - BLT_CONFIG_NULL_OK, &bltLinePenOption}, - {BLT_CONFIG_COLOR, "-areaforeground", "areaForeground", "areaForeground", - DEF_LINE_PATTERN_FG, Blt_Offset(LineElement, fillFgColor), - BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_BACKGROUND, "-areabackground", "areaBackground", - "areaBackground", DEF_LINE_PATTERN_BG, Blt_Offset(LineElement, fillBg), - BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_LINE_TAGS, - Blt_Offset(LineElement, obj.tags), BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_COLOR, "-color", "color", "Color", - DEF_LINE_PEN_COLOR, Blt_Offset(LineElement, builtinPen.traceColor), 0}, - {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", - DEF_LINE_DASHES, Blt_Offset(LineElement, builtinPen.traceDashes), - BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_CUSTOM, "-data", "data", "Data", DEF_LINE_DATA, 0, 0, - &bltValuePairsOption}, - {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor", - DEF_LINE_ERRORBAR_COLOR, - Blt_Offset(LineElement, builtinPen.errorBarColor), 0, &bltColorOption}, - {BLT_CONFIG_PIXELS_NNEG, "-errorbarwidth", "errorBarWidth", "ErrorBarWidth", - DEF_LINE_ERRORBAR_LINE_WIDTH, - Blt_Offset(LineElement, builtinPen.errorBarLineWidth), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_PIXELS_NNEG, "-errorbarcap", "errorBarCap", "ErrorBarCap", - DEF_LINE_ERRORBAR_CAP_WIDTH, - Blt_Offset(LineElement, builtinPen.errorBarCapWidth), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_CUSTOM, "-fill", "fill", "Fill", DEF_LINE_FILL_COLOR, - Blt_Offset(LineElement, builtinPen.symbol.fillColor), - BLT_CONFIG_NULL_OK, &bltColorOption}, - {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_LINE_HIDE, - Blt_Offset(LineElement, flags), BLT_CONFIG_DONT_SET_DEFAULT, - (Blt_CustomOption *)HIDE}, - {BLT_CONFIG_STRING, "-label", "label", "Label", (char *)NULL, - Blt_Offset(LineElement, label), BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_RELIEF, "-legendrelief", "legendRelief", "LegendRelief", - DEF_LINE_LABEL_RELIEF, Blt_Offset(LineElement, legendRelief), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth", - DEF_LINE_PEN_WIDTH, Blt_Offset(LineElement, builtinPen.traceWidth), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_LINE_AXIS_X, - Blt_Offset(LineElement, axes.x), 0, &bltXAxisOption}, - {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_LINE_AXIS_Y, - Blt_Offset(LineElement, axes.y), 0, &bltYAxisOption}, - {BLT_CONFIG_INT_NNEG, "-maxsymbols", "maxSymbols", "MaxSymbols", - DEF_LINE_MAX_SYMBOLS, Blt_Offset(LineElement, reqMaxSymbols), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_CUSTOM, "-offdash", "offDash", "OffDash", - DEF_LINE_OFFDASH_COLOR, Blt_Offset(LineElement, builtinPen.traceOffColor), - BLT_CONFIG_NULL_OK, &bltColorOption}, - {BLT_CONFIG_CUSTOM, "-outline", "outline", "Outline", - DEF_LINE_OUTLINE_COLOR, - Blt_Offset(LineElement, builtinPen.symbol.outlineColor), 0, - &bltColorOption}, - {BLT_CONFIG_PIXELS_NNEG, "-outlinewidth", "outlineWidth", "OutlineWidth", - DEF_LINE_OUTLINE_WIDTH, - Blt_Offset(LineElement, builtinPen.symbol.outlineWidth), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_CUSTOM, "-pen", "pen", "Pen", (char *)NULL, - Blt_Offset(LineElement, normalPenPtr), BLT_CONFIG_NULL_OK, - &bltLinePenOption}, - {BLT_CONFIG_PIXELS_NNEG, "-pixels", "pixels", "Pixels", DEF_LINE_PIXELS, - Blt_Offset(LineElement, builtinPen.symbol.size), 0}, - {BLT_CONFIG_BOOLEAN, "-scalesymbols", "scaleSymbols", "ScaleSymbols", - DEF_LINE_SCALE_SYMBOLS, Blt_Offset(LineElement, scaleSymbols), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_FILL, "-showerrorbars", "showErrorBars", "ShowErrorBars", - DEF_LINE_SHOW_ERRORBARS, - Blt_Offset(LineElement, builtinPen.errorBarShow), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_FILL, "-showvalues", "showValues", "ShowValues", - DEF_PEN_SHOW_VALUES, Blt_Offset(LineElement, builtinPen.valueShow), - BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_CUSTOM, "-smooth", "smooth", "Smooth", DEF_LINE_SMOOTH, - Blt_Offset(LineElement, reqSmooth), BLT_CONFIG_DONT_SET_DEFAULT, - &smoothOption}, - {BLT_CONFIG_CUSTOM, "-styles", "styles", "Styles", DEF_LINE_STYLES, - Blt_Offset(LineElement, styles), 0, &bltLineStylesOption}, - {BLT_CONFIG_CUSTOM, "-symbol", "symbol", "Symbol", DEF_LINE_SYMBOL, - Blt_Offset(LineElement, builtinPen.symbol), - BLT_CONFIG_DONT_SET_DEFAULT, &symbolOption}, - {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor", - DEF_PEN_VALUE_ANCHOR, - Blt_Offset(LineElement, builtinPen.valueStyle.anchor), 0}, - {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor", - DEF_PEN_VALUE_COLOR, - Blt_Offset(LineElement, builtinPen.valueStyle.color), 0}, - {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont", - DEF_PEN_VALUE_FONT, - Blt_Offset(LineElement, builtinPen.valueStyle.font), 0}, - {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat", - DEF_PEN_VALUE_FORMAT, Blt_Offset(LineElement, builtinPen.valueFormat), - BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_FLOAT, "-valuerotate", "valueRotate", "ValueRotate", - DEF_PEN_VALUE_ANGLE, - Blt_Offset(LineElement, builtinPen.valueStyle.angle),0}, - {BLT_CONFIG_CUSTOM, "-weights", "weights", "Weights", (char *)NULL, - Blt_Offset(LineElement, w), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-x", "xData", "XData", (char *)NULL, - Blt_Offset(LineElement, x), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-xdata", "xData", "XData", (char *)NULL, - Blt_Offset(LineElement, x), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-y", "yData", "YData", (char *)NULL, - Blt_Offset(LineElement, y), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-xerror", "xError", "XError", (char *)NULL, - Blt_Offset(LineElement, xError), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-ydata", "yData", "YData", (char *)NULL, - Blt_Offset(LineElement, y), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-yerror", "yError", "YError", (char *)NULL, - Blt_Offset(LineElement, yError), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-xhigh", "xHigh", "XHigh", (char *)NULL, - Blt_Offset(LineElement, xHigh), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-xlow", "xLow", "XLow", (char *)NULL, - Blt_Offset(LineElement, xLow), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-yhigh", "yHigh", "YHigh", (char *)NULL, - Blt_Offset(LineElement, xHigh), 0, &bltValuesOption}, - {BLT_CONFIG_CUSTOM, "-ylow", "yLow", "YLow", (char *)NULL, - Blt_Offset(LineElement, yLow), 0, &bltValuesOption}, - {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0} -}; - static Blt_ConfigSpec linePenConfigSpecs[] = { {BLT_CONFIG_COLOR, "-color", "color", "Color", DEF_PEN_ACTIVE_COLOR, @@ -2009,55 +1883,6 @@ MapActiveSymbols(Graph *graphPtr, LineElement *elemPtr) /* *--------------------------------------------------------------------------- * - * MapStrip -- - * - * Creates an array of line segments of the graph coordinates. - * - * Results: - * None. - * - * Side effects: - * Memory is allocated for the line segment array. - * - *--------------------------------------------------------------------------- - */ -static void -MapStrip(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr) -{ - Region2d exts; - Segment2d *lines; - int *indices, *indexPtr; - Point2d *pend, *pp; - Segment2d *sp; - int count; - - indices = malloc(sizeof(int) * mapPtr->nScreenPts); - - /* - * Create array to hold points for line segments (not polyline - * coordinates). So allocate twice the number of points. - */ - sp = lines = malloc(mapPtr->nScreenPts * sizeof(Segment2d)); - Blt_GraphExtents(graphPtr, &exts); - count = 0; /* Count the number of segments. */ - indexPtr = mapPtr->map; - for (pp = mapPtr->screenPts, pend = pp + (mapPtr->nScreenPts - 1); - pp < pend; pp++, indexPtr++) { - sp->p = pp[0], sp->q = pp[1]; - if (Blt_LineRectClip(&exts, &sp->p, &sp->q)) { - sp++; - indices[count] = *indexPtr; - count++; - } - } - elemPtr->lines.map = indices; - elemPtr->lines.length = count; - elemPtr->lines.segments = lines; -} - -/* - *--------------------------------------------------------------------------- - * * MergePens -- * * Reorders the both arrays of points and segments to merge pens. @@ -3045,60 +2870,6 @@ ClosestTrace( /* *--------------------------------------------------------------------------- * - * ClosestStrip -- - * - * Find the line segment closest to the given window coordinate in the - * element. - * - * Results: - * If a new minimum distance is found, the information regarding it is - * returned via searchPtr. - * - *--------------------------------------------------------------------------- - */ -static int -ClosestStrip( - Graph *graphPtr, /* Graph widget record */ - LineElement *elemPtr, /* Line element record */ - ClosestSearch *searchPtr, /* Info about closest point in - * element */ - DistanceProc *distProc) -{ - Point2d closest; - double dMin; - int count; - int iClose; - Segment2d *sp; - - iClose = 0; - dMin = searchPtr->dist; - closest.x = closest.y = 0; - for (sp = elemPtr->lines.segments, count = 0; - count < elemPtr->lines.length; count++, sp++) { - double d; - Point2d b; - - d = (*distProc)(searchPtr->x, searchPtr->y, &sp->p, &sp->q, &b); - if (d < dMin) { - closest = b; - iClose = elemPtr->lines.map[count]; - dMin = d; - } - } - if (dMin < searchPtr->dist) { - searchPtr->dist = dMin; - searchPtr->elemPtr = (Element *)elemPtr; - searchPtr->index = iClose; - searchPtr->point = Blt_InvMap2D(graphPtr, closest.x, closest.y, - &elemPtr->axes); - return TRUE; - } - return FALSE; -} - -/* - *--------------------------------------------------------------------------- - * * ClosestPoint -- * * Find the element whose data point is closest to the given screen |