From 821e38f363b36d8ce19b6af6f5940db4f2adbadd Mon Sep 17 00:00:00 2001 From: joye Date: Wed, 24 Jun 2015 19:56:41 +0000 Subject: *** empty log message *** --- src/bltGrElemBar.C | 22 ++++++++-------------- src/bltGrHairs.C | 2 -- src/bltGraph.C | 26 +++----------------------- 3 files changed, 11 insertions(+), 39 deletions(-) diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index 05eeb64..2e01547 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -866,9 +866,8 @@ void BarElement::checkStacks(Axis* xAxis, Axis* yAxis, barGraphPtr_->nBarGroups_ == 0) return; - BarGroup *gp, *gend; - for (gp = barGraphPtr_->barGroups_, gend = gp + barGraphPtr_->nBarGroups_; gp < gend; - gp++) { + for (BarGroup *gp = barGraphPtr_->barGroups_, + *gend = gp + barGraphPtr_->nBarGroups_; gp < gend; gp++) { if ((gp->xAxis == xAxis) && (gp->yAxis == yAxis)) { // Check if any of the y-values (because of stacking) are greater @@ -994,8 +993,8 @@ void BarElement::mapActive() int* activeToData = new int[nActiveIndices_]; int count = 0; for (int ii=0; iiops(); - XRectangle *rp, *rend; - for (rp = bars, rend = rp + nBars; rp < rend; rp++) { + for (XRectangle *rp = bars, *rend = rp + nBars; rp < rend; rp++) { if ((rp->width < 1) || (rp->height < 1)) continue; @@ -1220,9 +1218,7 @@ void BarElement::drawValues(Drawable drawable, BarPen* penPtr, TextStyle ts(graphPtr_, &pops->valueStyle); int count = 0; - XRectangle *rp, *rend; - - for (rp = bars, rend = rp + nBars; rp < rend; rp++) { + for (XRectangle *rp = bars, *rend = rp + nBars; rp < rend; rp++) { Point2d anchorPos; char string[TCL_DOUBLE_SPACE * 2 + 2]; @@ -1261,8 +1257,7 @@ void BarElement::printSegments(PSOutput* psPtr, BarPen* penPtr, XRectangle *bars, int nBars) { BarPenOptions* pops = (BarPenOptions*)penPtr->ops(); - XRectangle *rp, *rend; - for (rp = bars, rend = rp + nBars; rp < rend; rp++) { + for (XRectangle *rp = bars, *rend = rp + nBars; rp < rend; rp++) { if ((rp->width < 1) || (rp->height < 1)) continue; @@ -1291,8 +1286,7 @@ void BarElement::printValues(PSOutput* psPtr, BarPen* penPtr, fmt = "%g"; TextStyle ts(graphPtr_, &pops->valueStyle); - XRectangle *rp, *rend; - for (rp = bars, rend = rp + nBars; rp < rend; rp++) { + for (XRectangle *rp = bars, *rend = rp + nBars; rp < rend; rp++) { double x = ops->coords.x->values_[barToData[count]]; double y = ops->coords.y->values_[barToData[count]]; diff --git a/src/bltGrHairs.C b/src/bltGrHairs.C index 97bed92..6fa7c09 100644 --- a/src/bltGrHairs.C +++ b/src/bltGrHairs.C @@ -140,8 +140,6 @@ void Crosshairs::draw(Drawable drawable) segArr_[0].x, segArr_[0].y, segArr_[1].x, segArr_[1].y); XDrawLine(graphPtr_->display_, drawable, gc_, segArr_[2].x, segArr_[2].y, segArr_[3].x, segArr_[3].y); - - // XDrawSegments(graphPtr_->display_, drawable, gc_, segArr_, 2); } } } diff --git a/src/bltGraph.C b/src/bltGraph.C index 3187753..6440201 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -212,16 +212,13 @@ int Graph::configure() void Graph::map() { - // cerr << '.'; if (flags & RESET) { - // cerr << 'r'; resetAxes(); flags &= ~RESET; flags |= LAYOUT; } if (flags & LAYOUT) { - // cerr << 'l'; layoutGraph(); crosshairs_->map(); mapAxes(); @@ -1040,8 +1037,7 @@ void Graph::printAxes(PSOutput* psPtr) { GraphOptions* ops = (GraphOptions*)ops_; - Margin *mp, *mend; - for (mp = ops->margins, mend = mp + 4; mp < mend; mp++) { + for (Margin *mp = ops->margins, *mend = mp + 4; mp < mend; mp++) { for (ChainLink* link = Chain_FirstLink(mp->axes); link; link = Chain_NextLink(link)) { Axis *axisPtr = (Axis*)Chain_GetValue(link); @@ -1439,24 +1435,8 @@ int Graph::getXY(const char* string, int* xPtr, int* yPtr) void Graph::drawSegments(Drawable drawable, GC gc, Segment2d* segments, int nSegments) { - Segment2d* sp; - Segment2d* send; - - XSegment* xsegments = new XSegment[nSegments]; - if (xsegments == NULL) - return; - - XSegment* dp = xsegments; - for (sp = segments, send = sp + nSegments; sp < send; sp++) { - dp->x1 = (short int)sp->p.x; - dp->y1 = (short int)sp->p.y; - dp->x2 = (short int)sp->q.x; - dp->y2 = (short int)sp->q.y; - dp++; - } - - XDrawSegments(display_, drawable, gc, xsegments, nSegments); - delete [] xsegments; + for (Segment2d *sp = segments, *send = sp + nSegments; sp < send; sp++) + XDrawLine(display_, drawable, gc, sp->p.x, sp->p.y, sp->q.x, sp->q.y); } GC Graph::getPrivateGC(unsigned long gcMask, XGCValues *valuePtr) -- cgit v0.12