From c2ff89ef8036780c06a8de051777cbe9a6b80623 Mon Sep 17 00:00:00 2001 From: joye Date: Wed, 16 Apr 2014 18:01:44 +0000 Subject: *** empty log message *** --- src/bltGrAxis.C | 46 +++++++++++++++++------------------ src/bltGrAxisOp.C | 56 +++++++++++++++++++++--------------------- src/bltGrElemBar.C | 18 +++++++------- src/bltGrElemLine.C | 17 ++++++------- src/bltGrHairs.C | 10 ++++---- src/bltGrLegd.C | 32 ++++++++++++------------ src/bltGrMarker.C | 8 +++--- src/bltGraph.C | 70 ++++++++++++++++++++++++++--------------------------- src/bltGraph.h | 14 +++++------ src/bltGraphOp.C | 14 +++++------ 10 files changed, 141 insertions(+), 144 deletions(-) diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C index 06702fb..e0d944c 100644 --- a/src/bltGrAxis.C +++ b/src/bltGrAxis.C @@ -376,12 +376,12 @@ void Axis::map(int offset, int margin) { if (isHorizontal()) { screenMin_ = graphPtr_->hOffset; - width_ = graphPtr_->right - graphPtr_->left; + width_ = graphPtr_->right_ - graphPtr_->left_; screenRange_ = graphPtr_->hRange; } else { screenMin_ = graphPtr_->vOffset; - height_ = graphPtr_->bottom - graphPtr_->top; + height_ = graphPtr_->bottom_ - graphPtr_->top_; screenRange_ = graphPtr_->vRange; } screenScale_ = 1.0 / screenRange_; @@ -1172,7 +1172,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) switch (margin) { case MARGIN_TOP: { - axisLine = graphPtr_->top; + axisLine = graphPtr_->top_; if (ops->exterior) { axisLine -= gops->plotBW + axisPad + ops->lineWidth / 2; tickLabel = axisLine - 2; @@ -1184,10 +1184,10 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) axisLine--; axisLine -= axisPad + ops->lineWidth / 2; - tickLabel = graphPtr_->top - gops->plotBW - 2; + tickLabel = graphPtr_->top_ - gops->plotBW - 2; } - int mark = graphPtr_->top - offset - pad; + int mark = graphPtr_->top_ - offset - pad; tickAnchor_ = TK_ANCHOR_S; left_ = screenMin_ - inset - 2; right_ = screenMin_ + screenRange_ + inset - 1; @@ -1199,7 +1199,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) int x, y; if (ops->titleAlternate) { - x = graphPtr_->right + AXIS_PAD_TITLE; + x = graphPtr_->right_ + AXIS_PAD_TITLE; y = mark - (height_ / 2); titleAnchor_ = TK_ANCHOR_W; } @@ -1232,7 +1232,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) * tick * title */ - axisLine = graphPtr_->bottom; + axisLine = graphPtr_->bottom_; if (gops->plotRelief == TK_RELIEF_SOLID) axisLine++; @@ -1244,10 +1244,10 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) } else { axisLine -= axisPad + ops->lineWidth / 2; - tickLabel = graphPtr_->bottom + gops->plotBW + 2; + tickLabel = graphPtr_->bottom_ + gops->plotBW + 2; } - int mark = graphPtr_->bottom + offset; + int mark = graphPtr_->bottom_ + offset; float fangle = fmod(ops->tickAngle, 90.0); if (fangle == 0.0) tickAnchor_ = TK_ANCHOR_N; @@ -1261,7 +1261,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) left_ = screenMin_ - inset - 2; right_ = screenMin_ + screenRange_ + inset - 1; - top_ = graphPtr_->bottom + labelOffset - t1; + top_ = graphPtr_->bottom_ + labelOffset - t1; if (gops->stackAxes) bottom_ = mark + marginPtr->axesOffset - 1; else @@ -1269,7 +1269,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) int x, y; if (ops->titleAlternate) { - x = graphPtr_->right + AXIS_PAD_TITLE; + x = graphPtr_->right_ + AXIS_PAD_TITLE; y = mark + (height_ / 2); titleAnchor_ = TK_ANCHOR_W; } @@ -1325,7 +1325,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) * G = graph border width * H = highlight thickness */ - axisLine = graphPtr_->left; + axisLine = graphPtr_->left_; if (ops->exterior) { axisLine -= gops->plotBW + axisPad + ops->lineWidth / 2; tickLabel = axisLine - 2; @@ -1336,10 +1336,10 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) if (gops->plotRelief == TK_RELIEF_SOLID) axisLine--; axisLine += axisPad + ops->lineWidth / 2; - tickLabel = graphPtr_->left - gops->plotBW - 2; + tickLabel = graphPtr_->left_ - gops->plotBW - 2; } - int mark = graphPtr_->left - offset; + int mark = graphPtr_->left_ - offset; tickAnchor_ = TK_ANCHOR_E; if (gops->stackAxes) left_ = mark - marginPtr->axesOffset; @@ -1352,7 +1352,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) int x, y; if (ops->titleAlternate) { x = mark - (width_ / 2); - y = graphPtr_->top - AXIS_PAD_TITLE; + y = graphPtr_->top_ - AXIS_PAD_TITLE; titleAnchor_ = TK_ANCHOR_SW; } else { @@ -1370,7 +1370,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) case MARGIN_RIGHT: { - axisLine = graphPtr_->right; + axisLine = graphPtr_->right_; if (gops->plotRelief == TK_RELIEF_SOLID) axisLine++; @@ -1382,10 +1382,10 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) } else { axisLine -= axisPad + ops->lineWidth / 2; - tickLabel = graphPtr_->right + gops->plotBW + 2; + tickLabel = graphPtr_->right_ + gops->plotBW + 2; } - int mark = graphPtr_->right + offset + pad; + int mark = graphPtr_->right_ + offset + pad; tickAnchor_ = TK_ANCHOR_W; left_ = mark; if (gops->stackAxes) @@ -1399,7 +1399,7 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr) int x, y; if (ops->titleAlternate) { x = mark + (width_ / 2); - y = graphPtr_->top - AXIS_PAD_TITLE; + y = graphPtr_->top_ - AXIS_PAD_TITLE; titleAnchor_ = TK_ANCHOR_SE; } else { @@ -1580,14 +1580,14 @@ void Axis::makeGridLine(double value, Segment2d *sp) if (isHorizontal()) { sp->p.x = hMap(value); - sp->p.y = graphPtr_->top; + sp->p.y = graphPtr_->top_; sp->q.x = sp->p.x; - sp->q.y = graphPtr_->bottom; + sp->q.y = graphPtr_->bottom_; } else { - sp->p.x = graphPtr_->left; + sp->p.x = graphPtr_->left_; sp->p.y = vMap(value); - sp->q.x = graphPtr_->right; + sp->q.x = graphPtr_->right_; sp->q.y = sp->p.y; } } diff --git a/src/bltGrAxisOp.C b/src/bltGrAxisOp.C index e3f93a8..813a180 100644 --- a/src/bltGrAxisOp.C +++ b/src/bltGrAxisOp.C @@ -456,7 +456,7 @@ static int DeleteOp(Tcl_Interp* interp, Graph* graphPtr, static int FocusOp(Tcl_Interp* interp, Graph* graphPtr, int objc, Tcl_Obj* const objv[]) { - graphPtr->focusPtr = NULL; + graphPtr->focusPtr_ = NULL; if (objc == 4) { Axis* axisPtr; if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) @@ -464,13 +464,13 @@ static int FocusOp(Tcl_Interp* interp, Graph* graphPtr, AxisOptions* ops = (AxisOptions*)axisPtr->ops(); if (axisPtr && !ops->hide && axisPtr->use_) - graphPtr->focusPtr = axisPtr; + graphPtr->focusPtr_ = axisPtr; } - Blt_SetFocusItem(graphPtr->bindTable, graphPtr->focusPtr, NULL); + Blt_SetFocusItem(graphPtr->bindTable, graphPtr->focusPtr_, NULL); - if (graphPtr->focusPtr) - Tcl_SetStringObj(Tcl_GetObjResult(interp), graphPtr->focusPtr->name(),-1); + if (graphPtr->focusPtr_) + Tcl_SetStringObj(Tcl_GetObjResult(interp), graphPtr->focusPtr_->name(),-1); return TCL_OK; } @@ -843,8 +843,8 @@ void Blt_DrawAxisLimits(Graph* graphPtr, Drawable drawable) int vMin, hMin, vMax, hMax; #define SPACING 8 - vMin = vMax = graphPtr->left + gops->xPad + 2; - hMin = hMax = graphPtr->bottom - gops->yPad - 2; /* Offsets */ + vMin = vMax = graphPtr->left_ + gops->xPad + 2; + hMin = hMax = graphPtr->bottom_ - gops->yPad - 2; /* Offsets */ for (hPtr = Tcl_FirstHashEntry(&graphPtr->axes.table, &cursor); hPtr != NULL; hPtr = Tcl_NextHashEntry(&cursor)) { @@ -885,7 +885,7 @@ void Blt_DrawAxisLimits(Graph* graphPtr, Drawable drawable) ops->limitsTextStyle.anchor = TK_ANCHOR_SE; Blt_DrawText2(graphPtr->tkwin_, drawable, maxPtr, - &ops->limitsTextStyle, graphPtr->right, + &ops->limitsTextStyle, graphPtr->right_, hMax, &textDim); hMax -= (textDim.height + SPACING); } @@ -895,7 +895,7 @@ void Blt_DrawAxisLimits(Graph* graphPtr, Drawable drawable) Blt_DrawText2(graphPtr->tkwin_, drawable, maxPtr, &ops->limitsTextStyle, vMax, - graphPtr->top, &textDim); + graphPtr->top_, &textDim); vMax += (textDim.width + SPACING); } } @@ -906,7 +906,7 @@ void Blt_DrawAxisLimits(Graph* graphPtr, Drawable drawable) ops->limitsTextStyle.angle = 90.0; Blt_DrawText2(graphPtr->tkwin_, drawable, minPtr, - &ops->limitsTextStyle, graphPtr->left, + &ops->limitsTextStyle, graphPtr->left_, hMin, &textDim); hMin -= (textDim.height + SPACING); } @@ -915,7 +915,7 @@ void Blt_DrawAxisLimits(Graph* graphPtr, Drawable drawable) Blt_DrawText2(graphPtr->tkwin_, drawable, minPtr, &ops->limitsTextStyle, vMin, - graphPtr->bottom, &textDim); + graphPtr->bottom_, &textDim); vMin += (textDim.width + SPACING); } } @@ -931,8 +931,8 @@ void Blt_AxisLimitsToPostScript(Graph* graphPtr, Blt_Ps ps) char string[200]; #define SPACING 8 - vMin = vMax = graphPtr->left + gops->xPad + 2; - hMin = hMax = graphPtr->bottom - gops->yPad - 2; /* Offsets */ + vMin = vMax = graphPtr->left_ + gops->xPad + 2; + hMin = hMax = graphPtr->bottom_ - gops->yPad - 2; /* Offsets */ for (hPtr = Tcl_FirstHashEntry(&graphPtr->axes.table, &cursor); hPtr != NULL; hPtr = Tcl_NextHashEntry(&cursor)) { const char *minFmt, *maxFmt; @@ -958,7 +958,7 @@ void Blt_AxisLimitsToPostScript(Graph* graphPtr, Blt_Ps ps) ops->limitsTextStyle.anchor = TK_ANCHOR_SE; Blt_Ps_DrawText(ps, string, &ops->limitsTextStyle, - (double)graphPtr->right, hMax); + (double)graphPtr->right_, hMax); hMax -= (textWidth + SPACING); } else { @@ -966,7 +966,7 @@ void Blt_AxisLimitsToPostScript(Graph* graphPtr, Blt_Ps ps) ops->limitsTextStyle.anchor = TK_ANCHOR_NW; Blt_Ps_DrawText(ps, string, &ops->limitsTextStyle, - vMax, (double)graphPtr->top); + vMax, (double)graphPtr->top_); vMax += (textWidth + SPACING); } } @@ -981,14 +981,14 @@ void Blt_AxisLimitsToPostScript(Graph* graphPtr, Blt_Ps ps) ops->limitsTextStyle.angle = 90.0; Blt_Ps_DrawText(ps, string, &ops->limitsTextStyle, - (double)graphPtr->left, hMin); + (double)graphPtr->left_, hMin); hMin -= (textWidth + SPACING); } else { ops->limitsTextStyle.angle = 0.0; Blt_Ps_DrawText(ps, string, &ops->limitsTextStyle, - vMin, (double)graphPtr->bottom); + vMin, (double)graphPtr->bottom_); vMin += (textWidth + SPACING); } } @@ -1261,8 +1261,8 @@ void Blt_LayoutGraph(Graph* graphPtr) int plotWidth, plotHeight; int inset, inset2; - int width = graphPtr->width; - int height = graphPtr->height; + int width = graphPtr->width_; + int height = graphPtr->height_; /* * Step 1: Compute the amount of space needed to display the axes @@ -1496,21 +1496,21 @@ void Blt_LayoutGraph(Graph* graphPtr) height = h; } } - graphPtr->width = width; - graphPtr->height = height; - graphPtr->left = left + inset; - graphPtr->top = top + inset; - graphPtr->right = width - right - inset; - graphPtr->bottom = height - bottom - inset; + graphPtr->width_ = width; + graphPtr->height_ = height; + graphPtr->left_ = left + inset; + graphPtr->top_ = top + inset; + graphPtr->right_ = width - right - inset; + graphPtr->bottom_ = height - bottom - inset; gops->leftMargin.width = left + graphPtr->inset_; gops->rightMargin.width = right + graphPtr->inset_; gops->topMargin.height = top + graphPtr->inset_; gops->bottomMargin.height = bottom + graphPtr->inset_; - graphPtr->vOffset = graphPtr->top + gops->yPad; + graphPtr->vOffset = graphPtr->top_ + gops->yPad; graphPtr->vRange = plotHeight - 2*gops->yPad; - graphPtr->hOffset = graphPtr->left + gops->xPad; + graphPtr->hOffset = graphPtr->left_ + gops->xPad; graphPtr->hRange = plotWidth - 2*gops->xPad; if (graphPtr->vRange < 1) @@ -1526,7 +1526,7 @@ void Blt_LayoutGraph(Graph* graphPtr) // space provided for it in the top margin titleY = graphPtr->titleHeight_; graphPtr->titleY_ = 3 + graphPtr->inset_; - graphPtr->titleX_ = (graphPtr->right + graphPtr->left) / 2; + graphPtr->titleX_ = (graphPtr->right_ + graphPtr->left_) / 2; } static int GetMarginGeometry(Graph* graphPtr, Margin *marginPtr) diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index c8e48ff..07455ec 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -375,7 +375,7 @@ void BarElement::map() c1 = Blt_Map2D(graphPtr_, c1.x, c1.y, &ops->axes); c2 = Blt_Map2D(graphPtr_, c2.x, c2.y, &ops->axes); if ((ybot == 0.0) && (axisyops->logScale)) { - c2.y = graphPtr_->bottom; + c2.y = graphPtr_->bottom_; } if (c2.y < c1.y) { @@ -386,8 +386,8 @@ void BarElement::map() double t; t = c1.x, c1.x = c2.x, c2.x = t; } - if ((c1.x > graphPtr_->right) || (c2.x < graphPtr_->left) || - (c1.y > graphPtr_->bottom) || (c2.y < graphPtr_->top)) { + if ((c1.x > graphPtr_->right_) || (c2.x < graphPtr_->left_) || + (c1.y > graphPtr_->bottom_) || (c2.y < graphPtr_->top_)) { continue; } /* Bound the bars horizontally by the width of the graph window */ @@ -395,8 +395,8 @@ void BarElement::map() if (gops->stackAxes) { top = ops->axes.y->screenMin_; bottom = ops->axes.y->screenMin_ + ops->axes.y->screenRange_; - left = graphPtr_->left; - right = graphPtr_->right; + left = graphPtr_->left_; + right = graphPtr_->right_; } else { left = top = 0; bottom = right = 10000; @@ -1225,10 +1225,10 @@ void BarElement::DrawBarSegments(Drawable drawable, BarPen* penPtr, TkRegion rgn; XRectangle clip; - clip.x = graphPtr_->left; - clip.y = graphPtr_->top; - clip.width = graphPtr_->right - graphPtr_->left + 1; - clip.height = graphPtr_->bottom - graphPtr_->top + 1; + clip.x = graphPtr_->left_; + clip.y = graphPtr_->top_; + clip.width = graphPtr_->right_ - graphPtr_->left_ + 1; + clip.height = graphPtr_->bottom_ - graphPtr_->top_ + 1; rgn = TkCreateRegion(); TkUnionRectWithRegion(&clip, rgn, rgn); diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index 9c2abd1..a210379 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -1209,17 +1209,16 @@ void LineElement::GenerateSpline(MapInfo *mapPtr) * increasing */ } } - if (((origPts[0].x > (double)graphPtr_->right)) || - ((origPts[mapPtr->nScreenPts - 1].x < (double)graphPtr_->left))) { - return; /* All points are clipped */ - } + if (((origPts[0].x > (double)graphPtr_->right_)) || + ((origPts[mapPtr->nScreenPts - 1].x < (double)graphPtr_->left_))) + return; /* * The spline is computed in screen coordinates instead of data points so * that we can select the abscissas of the interpolated points from each * pixel horizontally across the plotting area. */ - extra = (graphPtr_->right - graphPtr_->left) + 1; + extra = (graphPtr_->right_ - graphPtr_->left_) + 1; if (extra < 1) { return; } @@ -1240,8 +1239,8 @@ void LineElement::GenerateSpline(MapInfo *mapPtr) count++; /* Is any part of the interval (line segment) in the plotting area? */ - if ((origPts[j].x >= (double)graphPtr_->left) || - (origPts[i].x <= (double)graphPtr_->right)) { + if ((origPts[j].x >= (double)graphPtr_->left_) || + (origPts[i].x <= (double)graphPtr_->right_)) { double x, last; x = origPts[i].x + 1.0; @@ -1257,8 +1256,8 @@ void LineElement::GenerateSpline(MapInfo *mapPtr) * Pick the max of the starting X-coordinate and the left edge and * the min of the last X-coordinate and the right edge. */ - x = MAX(x, (double)graphPtr_->left); - last = MIN(origPts[j].x, (double)graphPtr_->right); + x = MAX(x, (double)graphPtr_->left_); + last = MIN(origPts[j].x, (double)graphPtr_->right_); /* Add the extra x-coordinates to the interval. */ while (x < last) { diff --git a/src/bltGrHairs.C b/src/bltGrHairs.C index eb933db..2141043 100644 --- a/src/bltGrHairs.C +++ b/src/bltGrHairs.C @@ -37,7 +37,7 @@ extern "C" { #include "bltGrHairs.h" #include "bltGrMisc.h" -#define PointInGraph(g,x,y) (((x) <= (g)->right) && ((x) >= (g)->left) && ((y) <= (g)->bottom) && ((y) >= (g)->top)) +#define PointInGraph(g,x,y) (((x) <= (g)->right_) && ((x) >= (g)->left_) && ((y) <= (g)->bottom_) && ((y) >= (g)->top_)) static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_COLOR, "-color", "color", "Color", @@ -116,12 +116,12 @@ void Crosshairs::configure() // Are the new coordinates on the graph? segArr_[0].x1 = ops->x; segArr_[0].x2 = ops->x; - segArr_[0].y1 = graphPtr_->bottom; - segArr_[0].y2 = graphPtr_->top; + segArr_[0].y1 = graphPtr_->bottom_; + segArr_[0].y2 = graphPtr_->top_; segArr_[1].y1 = ops->y; segArr_[1].y2 = ops->y; - segArr_[1].x1 = graphPtr_->left; - segArr_[1].x2 = graphPtr_->right; + segArr_[1].x1 = graphPtr_->left_; + segArr_[1].x2 = graphPtr_->right_; if (!ops->hide) on(); diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index d462393..eee643f 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -652,42 +652,42 @@ void Legend::setOrigin() switch ((Position)ops->position) { case RIGHT: w = gops->rightMargin.width - gops->rightMargin.axesOffset; - h = graphPtr_->bottom - graphPtr_->top; - x = graphPtr_->right + gops->rightMargin.axesOffset; - y = graphPtr_->top; + h = graphPtr_->bottom_ - graphPtr_->top_; + x = graphPtr_->right_ + gops->rightMargin.axesOffset; + y = graphPtr_->top_; break; case LEFT: w = gops->leftMargin.width - gops->leftMargin.axesOffset; - h = graphPtr_->bottom - graphPtr_->top; + h = graphPtr_->bottom_ - graphPtr_->top_; x = graphPtr_->inset_; - y = graphPtr_->top; + y = graphPtr_->top_; break; case TOP: - w = graphPtr_->right - graphPtr_->left; + w = graphPtr_->right_ - graphPtr_->left_; h = gops->topMargin.height - gops->topMargin.axesOffset; if (gops->title) h -= graphPtr_->titleHeight_; - x = graphPtr_->left; + x = graphPtr_->left_; y = graphPtr_->inset_; if (gops->title) y += graphPtr_->titleHeight_; break; case BOTTOM: - w = graphPtr_->right - graphPtr_->left; + w = graphPtr_->right_ - graphPtr_->left_; h = gops->bottomMargin.height - gops->bottomMargin.axesOffset; - x = graphPtr_->left; - y = graphPtr_->bottom + gops->bottomMargin.axesOffset; + x = graphPtr_->left_; + y = graphPtr_->bottom_ + gops->bottomMargin.axesOffset; break; case PLOT: - w = graphPtr_->right - graphPtr_->left; - h = graphPtr_->bottom - graphPtr_->top; - x = graphPtr_->left; - y = graphPtr_->top; + w = graphPtr_->right_ - graphPtr_->left_; + h = graphPtr_->bottom_ - graphPtr_->top_; + x = graphPtr_->left_; + y = graphPtr_->top_; break; case XY: @@ -696,10 +696,10 @@ void Legend::setOrigin() x = ops->xReq; y = ops->yReq; if (x < 0) - x += graphPtr_->width; + x += graphPtr_->width_; if (y < 0) - y += graphPtr_->height; + y += graphPtr_->height_; break; } diff --git a/src/bltGrMarker.C b/src/bltGrMarker.C index ad6970a..fcfe640 100644 --- a/src/bltGrMarker.C +++ b/src/bltGrMarker.C @@ -131,10 +131,10 @@ Point2d Marker::mapPoint(Point2d* pointPtr, Axis2d* axesPtr) int Marker::boxesDontOverlap(Graph* graphPtr_, Region2d *extsPtr) { - return (((double)graphPtr_->right < extsPtr->left) || - ((double)graphPtr_->bottom < extsPtr->top) || - (extsPtr->right < (double)graphPtr_->left) || - (extsPtr->bottom < (double)graphPtr_->top)); + return (((double)graphPtr_->right_ < extsPtr->left) || + ((double)graphPtr_->bottom_ < extsPtr->top) || + (extsPtr->right < (double)graphPtr_->left_) || + (extsPtr->bottom < (double)graphPtr_->top_)); } int Marker::regionInPolygon(Region2d *regionPtr, Point2d *points, int nPoints, diff --git a/src/bltGraph.C b/src/bltGraph.C index b2c235a..ed3f0aa 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -242,15 +242,15 @@ Graph::Graph(ClientData clientData, Tcl_Interp* interp, titleY_ =0; titleWidth_ =0; titleHeight_ =0; - focusPtr =NULL; - width =0; - height =0; + width_ =0; + height_ =0; + left_ =0; + right_ =0; + top_ =0; + bottom_ =0; + focusPtr_ =NULL; halo =0; drawGC =NULL; - left =0; - right =0; - top =0; - bottom =0; vRange =0; vOffset =0; hRange =0; @@ -421,8 +421,8 @@ void GraphDisplay(Graph* graphPtr) * something reasonable. */ return; } - graphPtr->width = Tk_Width(graphPtr->tkwin_); - graphPtr->height = Tk_Height(graphPtr->tkwin_); + graphPtr->width_ = Tk_Width(graphPtr->tkwin_); + graphPtr->height_ = Tk_Height(graphPtr->tkwin_); Blt_MapGraph(graphPtr); if (!Tk_IsMapped(graphPtr->tkwin_)) { /* The graph's window isn't displayed, so don't bother drawing @@ -434,23 +434,23 @@ void GraphDisplay(Graph* graphPtr) Pixmap drawable; if (ops->doubleBuffer) drawable = Tk_GetPixmap(graphPtr->display_, Tk_WindowId(graphPtr->tkwin_), - graphPtr->width, graphPtr->height, Tk_Depth(graphPtr->tkwin_)); + graphPtr->width_, graphPtr->height_, Tk_Depth(graphPtr->tkwin_)); else drawable = Tk_WindowId(graphPtr->tkwin_); if (ops->backingStore) { if ((graphPtr->cache == None) || - (graphPtr->cacheWidth != graphPtr->width) || - (graphPtr->cacheHeight != graphPtr->height)) { + (graphPtr->cacheWidth != graphPtr->width_) || + (graphPtr->cacheHeight != graphPtr->height_)) { if (graphPtr->cache != None) Tk_FreePixmap(graphPtr->display_, graphPtr->cache); graphPtr->cache = Tk_GetPixmap(graphPtr->display_, Tk_WindowId(graphPtr->tkwin_), - graphPtr->width, graphPtr->height, + graphPtr->width_, graphPtr->height_, Tk_Depth(graphPtr->tkwin_)); - graphPtr->cacheWidth = graphPtr->width; - graphPtr->cacheHeight = graphPtr->height; + graphPtr->cacheWidth = graphPtr->width_; + graphPtr->cacheHeight = graphPtr->height_; graphPtr->flags |= CACHE_DIRTY; } } @@ -488,8 +488,8 @@ void GraphDisplay(Graph* graphPtr) if ((ops->borderWidth > 0) && (ops->relief != TK_RELIEF_FLAT)) Tk_Draw3DRectangle(graphPtr->tkwin_, drawable, ops->normalBg, ops->highlightWidth, ops->highlightWidth, - graphPtr->width - 2*ops->highlightWidth, - graphPtr->height - 2*ops->highlightWidth, + graphPtr->width_ - 2*ops->highlightWidth, + graphPtr->height_ - 2*ops->highlightWidth, ops->borderWidth, ops->relief); // Draw focus highlight ring @@ -502,7 +502,7 @@ void GraphDisplay(Graph* graphPtr) // Disable crosshairs before redisplaying to the screen Blt_DisableCrosshairs(graphPtr); XCopyArea(graphPtr->display_, drawable, Tk_WindowId(tkwin), - graphPtr->drawGC, 0, 0, graphPtr->width, graphPtr->height, 0, 0); + graphPtr->drawGC, 0, 0, graphPtr->width_, graphPtr->height_, 0, 0); Blt_EnableCrosshairs(graphPtr); if (ops->doubleBuffer) Tk_FreePixmap(graphPtr->display_, drawable); @@ -597,15 +597,15 @@ static void DrawMargins(Graph* graphPtr, Drawable drawable) * surface. This clears the surrounding area and clips the plot. */ rects[0].x = rects[0].y = rects[3].x = rects[1].x = 0; - rects[0].width = rects[3].width = (short int)graphPtr->width; - rects[0].height = (short int)graphPtr->top; - rects[3].y = graphPtr->bottom; - rects[3].height = graphPtr->height - graphPtr->bottom; - rects[2].y = rects[1].y = graphPtr->top; - rects[1].width = graphPtr->left; - rects[2].height = rects[1].height = graphPtr->bottom - graphPtr->top; - rects[2].x = graphPtr->right; - rects[2].width = graphPtr->width - graphPtr->right; + rects[0].width = rects[3].width = (short int)graphPtr->width_; + rects[0].height = (short int)graphPtr->top_; + rects[3].y = graphPtr->bottom_; + rects[3].height = graphPtr->height_ - graphPtr->bottom_; + rects[2].y = rects[1].y = graphPtr->top_; + rects[1].width = graphPtr->left_; + rects[2].height = rects[1].height = graphPtr->bottom_ - graphPtr->top_; + rects[2].x = graphPtr->right_; + rects[2].width = graphPtr->width_ - graphPtr->right_; Tk_Fill3DRectangle(graphPtr->tkwin_, drawable, ops->normalBg, rects[0].x, rects[0].y, rects[0].width, rects[0].height, @@ -625,10 +625,10 @@ static void DrawMargins(Graph* graphPtr, Drawable drawable) if (ops->plotBW > 0) { int x, y, w, h; - x = graphPtr->left - ops->plotBW; - y = graphPtr->top - ops->plotBW; - w = (graphPtr->right - graphPtr->left) + (2*ops->plotBW); - h = (graphPtr->bottom - graphPtr->top) + (2*ops->plotBW); + x = graphPtr->left_ - ops->plotBW; + y = graphPtr->top_ - ops->plotBW; + w = (graphPtr->right_ - graphPtr->left_) + (2*ops->plotBW); + h = (graphPtr->bottom_ - graphPtr->top_) + (2*ops->plotBW); Tk_Draw3DRectangle(graphPtr->tkwin_, drawable, ops->normalBg, x, y, w, h, ops->plotBW, ops->plotRelief); } @@ -659,10 +659,10 @@ static void DrawPlot(Graph* graphPtr, Drawable drawable) // Draw the background of the plotting area with 3D border Tk_Fill3DRectangle(graphPtr->tkwin_, drawable, ops->plotBg, - graphPtr->left-ops->plotBW, - graphPtr->top-ops->plotBW, - graphPtr->right - graphPtr->left + 1 +2*ops->plotBW, - graphPtr->bottom - graphPtr->top + 1 +2*ops->plotBW, + graphPtr->left_ - ops->plotBW, + graphPtr->top_ - ops->plotBW, + graphPtr->right_ - graphPtr->left_ + 1 + 2*ops->plotBW, + graphPtr->bottom_ - graphPtr->top_ + 1 + 2*ops->plotBW, ops->plotBW, ops->plotRelief); // Draw the elements, markers, legend, and axis limits diff --git a/src/bltGraph.h b/src/bltGraph.h index e429e06..68ed3a3 100644 --- a/src/bltGraph.h +++ b/src/bltGraph.h @@ -169,15 +169,15 @@ class Graph { short int titleY_; short int titleWidth_; short int titleHeight_; - Axis *focusPtr; - int width; - int height; + int width_; + int height_; + short int left_; + short int right_; + short int top_; + short int bottom_; + Axis *focusPtr_; int halo; GC drawGC; - short int left; - short int right; - short int top; - short int bottom; int vRange; int vOffset; int hRange; diff --git a/src/bltGraphOp.C b/src/bltGraphOp.C index f5fd13c..8242c6d 100644 --- a/src/bltGraphOp.C +++ b/src/bltGraphOp.C @@ -258,25 +258,23 @@ static int ExtentsOp(Graph* graphPtr, Tcl_Interp* interp, int objc, char c = string[0]; if ((c == 'p') && (length > 4) && (strncmp("plotheight", string, length) == 0)) { - int height = graphPtr->bottom - graphPtr->top + 1; + int height = graphPtr->bottom_ - graphPtr->top_ + 1; Tcl_SetIntObj(Tcl_GetObjResult(interp), height); } else if ((c == 'p') && (length > 4) && (strncmp("plotwidth", string, length) == 0)) { - int width = graphPtr->right - graphPtr->left + 1; + int width = graphPtr->right_ - graphPtr->left_ + 1; Tcl_SetIntObj(Tcl_GetObjResult(interp), width); } else if ((c == 'p') && (length > 4) && (strncmp("plotarea", string, length) == 0)) { Tcl_Obj* listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL); Tcl_ListObjAppendElement(interp, listObjPtr, - Tcl_NewIntObj(graphPtr->left)); + Tcl_NewIntObj(graphPtr->left_)); Tcl_ListObjAppendElement(interp, listObjPtr, - Tcl_NewIntObj(graphPtr->top)); - Tcl_ListObjAppendElement(interp, listObjPtr, - Tcl_NewIntObj(graphPtr->right - graphPtr->left+1)); - Tcl_ListObjAppendElement(interp, listObjPtr, - Tcl_NewIntObj(graphPtr->bottom - graphPtr->top+1)); + Tcl_NewIntObj(graphPtr->top_)); + Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(graphPtr->right_ - graphPtr->left_+1)); + Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(graphPtr->bottom_ - graphPtr->top_+1)); Tcl_SetObjResult(interp, listObjPtr); } else if ((c == 'l') && (length > 2) && -- cgit v0.12