diff options
author | joye <joye> | 2014-06-27 19:49:48 (GMT) |
---|---|---|
committer | joye <joye> | 2014-06-27 19:49:48 (GMT) |
commit | 514cef44b509b69d5f25789c518d23c0a8e5a773 (patch) | |
tree | 16d3c9189adede03eb182d4feb52a320fcb25d59 /src | |
parent | 4c23f3621903e2d983f2925dfa56c8992dec57be (diff) | |
download | blt-514cef44b509b69d5f25789c518d23c0a8e5a773.zip blt-514cef44b509b69d5f25789c518d23c0a8e5a773.tar.gz blt-514cef44b509b69d5f25789c518d23c0a8e5a773.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/bltGrAxisOption.C | 2 | ||||
-rw-r--r-- | src/bltGrElemBar.C | 2 | ||||
-rw-r--r-- | src/bltGrElemLine.C | 20 | ||||
-rw-r--r-- | src/bltGrElemLineSpline.C | 2 | ||||
-rw-r--r-- | src/bltGrMarker.C | 4 | ||||
-rw-r--r-- | src/bltGrMarkerLine.C | 6 | ||||
-rw-r--r-- | src/bltGrMarkerPolygon.C | 7 | ||||
-rw-r--r-- | src/bltGrMarkerText.C | 2 | ||||
-rw-r--r-- | src/bltGrMisc.C | 8 | ||||
-rw-r--r-- | src/bltGrMisc.h | 2 | ||||
-rw-r--r-- | src/bltGrPenOption.C | 2 | ||||
-rw-r--r-- | src/bltGraph.C | 4 |
12 files changed, 31 insertions, 30 deletions
diff --git a/src/bltGrAxisOption.C b/src/bltGrAxisOption.C index 88f12d3..9009cbd 100644 --- a/src/bltGrAxisOption.C +++ b/src/bltGrAxisOption.C @@ -61,7 +61,7 @@ static int AxisSetProc(ClientData clientData, Tcl_Interp* interp, if (!axisPtrPtr) return TCL_OK; - Graph* graphPtr = GetGraphFromWindowData(tkwin); + Graph* graphPtr = getGraphFromWindowData(tkwin); ClassId classId = (ClassId)(long(clientData)); Axis *axisPtr; diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index 3723faf..ff50e48 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -632,7 +632,7 @@ void BarElement::closest() Point2d *pp, *pend; for (pp=outline, pend=outline+4; pp<pend; pp++) { - Point2d t = GetProjection(searchPtr->x, searchPtr->y, pp, pp + 1); + Point2d t = getProjection(searchPtr->x, searchPtr->y, pp, pp + 1); if (t.x > right) t.x = right; else if (t.x < left) diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index cf1f7a3..29e3048 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -793,7 +793,7 @@ double LineElement::distanceToLine(int x, int y, Point2d *p, Point2d *q, { double right, left, top, bottom; - *t = GetProjection(x, y, p, q); + *t = getProjection(x, y, p, q); if (p->x > q->x) right = p->x, left = q->x; else @@ -1199,7 +1199,7 @@ void LineElement::generateParametricSpline(MapInfo *mapPtr) p = origPts[i]; q = origPts[j]; count++; - if (LineRectClip(&exts, &p, &q)) { + if (lineRectClip(&exts, &p, &q)) { count += (int)(hypot(q.x - p.x, q.y - p.y) * 0.5); } } @@ -1237,7 +1237,7 @@ void LineElement::generateParametricSpline(MapInfo *mapPtr) /* Is any part of the interval (line segment) in the plotting * area? */ - if (LineRectClip(&exts, &p, &q)) { + if (lineRectClip(&exts, &p, &q)) { double dp, dq; /* Distance of original point to p. */ @@ -1674,7 +1674,7 @@ void LineElement::mapFillArea(MapInfo *mapPtr) } Point2d *clipPts = (Point2d*)malloc(sizeof(Point2d) * np * 3); - np = PolyRectClip(&exts, origPts, np - 1, clipPts); + np = polyRectClip(&exts, origPts, np - 1, clipPts); free(origPts); if (np < 3) @@ -1786,7 +1786,7 @@ void LineElement::mapErrorBars(LineStyle **styleMap) q = graphPtr_->map2D(low, y, ops->xAxis, ops->yAxis); segPtr->p = p; segPtr->q = q; - if (LineRectClip(&exts, &segPtr->p, &segPtr->q)) { + if (lineRectClip(&exts, &segPtr->p, &segPtr->q)) { segPtr++; *indexPtr++ = i; } @@ -1794,7 +1794,7 @@ void LineElement::mapErrorBars(LineStyle **styleMap) segPtr->p.x = segPtr->q.x = p.x; segPtr->p.y = p.y - stylePtr->errorBarCapWidth; segPtr->q.y = p.y + stylePtr->errorBarCapWidth; - if (LineRectClip(&exts, &segPtr->p, &segPtr->q)) { + if (lineRectClip(&exts, &segPtr->p, &segPtr->q)) { segPtr++; *indexPtr++ = i; } @@ -1802,7 +1802,7 @@ void LineElement::mapErrorBars(LineStyle **styleMap) segPtr->p.x = segPtr->q.x = q.x; segPtr->p.y = q.y - stylePtr->errorBarCapWidth; segPtr->q.y = q.y + stylePtr->errorBarCapWidth; - if (LineRectClip(&exts, &segPtr->p, &segPtr->q)) { + if (lineRectClip(&exts, &segPtr->p, &segPtr->q)) { segPtr++; *indexPtr++ = i; } @@ -1855,7 +1855,7 @@ void LineElement::mapErrorBars(LineStyle **styleMap) q = graphPtr_->map2D(x, low, ops->xAxis, ops->yAxis); segPtr->p = p; segPtr->q = q; - if (LineRectClip(&exts, &segPtr->p, &segPtr->q)) { + if (lineRectClip(&exts, &segPtr->p, &segPtr->q)) { segPtr++; *indexPtr++ = i; } @@ -1863,7 +1863,7 @@ void LineElement::mapErrorBars(LineStyle **styleMap) segPtr->p.y = segPtr->q.y = p.y; segPtr->p.x = p.x - stylePtr->errorBarCapWidth; segPtr->q.x = p.x + stylePtr->errorBarCapWidth; - if (LineRectClip(&exts, &segPtr->p, &segPtr->q)) { + if (lineRectClip(&exts, &segPtr->p, &segPtr->q)) { segPtr++; *indexPtr++ = i; } @@ -1871,7 +1871,7 @@ void LineElement::mapErrorBars(LineStyle **styleMap) segPtr->p.y = segPtr->q.y = q.y; segPtr->p.x = q.x - stylePtr->errorBarCapWidth; segPtr->q.x = q.x + stylePtr->errorBarCapWidth; - if (LineRectClip(&exts, &segPtr->p, &segPtr->q)) { + if (lineRectClip(&exts, &segPtr->p, &segPtr->q)) { segPtr++; *indexPtr++ = i; } diff --git a/src/bltGrElemLineSpline.C b/src/bltGrElemLineSpline.C index dc787e5..3d75f11 100644 --- a/src/bltGrElemLineSpline.C +++ b/src/bltGrElemLineSpline.C @@ -35,6 +35,8 @@ #include "bltSpline.h" +using namespace Blt; + typedef double TriDiagonalMatrix[3]; typedef struct { double b, c, d; diff --git a/src/bltGrMarker.C b/src/bltGrMarker.C index 84910f4..5b53f03 100644 --- a/src/bltGrMarker.C +++ b/src/bltGrMarker.C @@ -165,7 +165,7 @@ int Marker::regionInPolygon(Region2d *regionPtr, Point2d *points, int nPoints, p = *pp; q = *(pp + 1); - if (LineRectClip(regionPtr, &p, &q)) + if (lineRectClip(regionPtr, &p, &q)) return 1; } @@ -175,7 +175,7 @@ int Marker::regionInPolygon(Region2d *regionPtr, Point2d *points, int nPoints, r.x = regionPtr->left; r.y = regionPtr->top; - return PointInPolygon(&r, points, nPoints); + return pointInPolygon(&r, points, nPoints); } } diff --git a/src/bltGrMarkerLine.C b/src/bltGrMarkerLine.C index e3eeb6e..0347dc8 100644 --- a/src/bltGrMarkerLine.C +++ b/src/bltGrMarkerLine.C @@ -180,7 +180,7 @@ void LineMarker::map() next.y += ops->yOffset; Point2d q = next; - if (LineRectClip(&extents, &p, &q)) { + if (lineRectClip(&extents, &p, &q)) { segPtr->p = p; segPtr->q = q; segPtr++; @@ -205,7 +205,7 @@ int LineMarker::pointInSegments(Point2d* samplePtr, Segment2d* segments, double minDist = DBL_MAX; Segment2d *sp, *send; for (sp = segments, send = sp + nSegments; sp < send; sp++) { - Point2d t = GetProjection((int)samplePtr->x, (int)samplePtr->y, + Point2d t = getProjection((int)samplePtr->x, (int)samplePtr->y, &sp->p, &sp->q); double right; double left; @@ -268,7 +268,7 @@ int LineMarker::regionIn(Region2d *extsPtr, int enclosed) pp < pend; pp++) { Point2d p = mapPoint(pp, ops->xAxis, ops->yAxis); Point2d q = mapPoint(pp + 1, ops->xAxis, ops->yAxis); - if (LineRectClip(extsPtr, &p, &q)) + if (lineRectClip(extsPtr, &p, &q)) count++; } return (count > 0); /* At least 1 segment passes through diff --git a/src/bltGrMarkerPolygon.C b/src/bltGrMarkerPolygon.C index f701cec..a2e4ed7 100644 --- a/src/bltGrMarkerPolygon.C +++ b/src/bltGrMarkerPolygon.C @@ -227,8 +227,7 @@ void PolygonMarker::map() clipped_ = 1; if (ops->fill) { Point2d* lfillPts = new Point2d[nScreenPts * 3]; - int n = - PolyRectClip(&extents, screenPts, ops->worldPts->num,lfillPts); + int n = polyRectClip(&extents, screenPts, ops->worldPts->num,lfillPts); if (n < 3) delete [] lfillPts; else { @@ -251,7 +250,7 @@ void PolygonMarker::map() for (sp = screenPts, send = sp + (nScreenPts - 1); sp < send; sp++) { segPtr->p = sp[0]; segPtr->q = sp[1]; - if (LineRectClip(&extents, &segPtr->p, &segPtr->q)) { + if (lineRectClip(&extents, &segPtr->p, &segPtr->q)) { segPtr++; } } @@ -269,7 +268,7 @@ int PolygonMarker::pointIn(Point2d *samplePtr) PolygonMarkerOptions* ops = (PolygonMarkerOptions*)ops_; if (ops->worldPts && (ops->worldPts->num >= 3) && screenPts_) - return PointInPolygon(samplePtr, screenPts_, ops->worldPts->num + 1); + return pointInPolygon(samplePtr, screenPts_, ops->worldPts->num + 1); return 0; } diff --git a/src/bltGrMarkerText.C b/src/bltGrMarkerText.C index b5a849c..a753c86 100644 --- a/src/bltGrMarkerText.C +++ b/src/bltGrMarkerText.C @@ -217,7 +217,7 @@ int TextMarker::pointIn(Point2d *samplePtr) points[ii].x = outline_[ii].x + anchorPt_.x; points[ii].y = outline_[ii].y + anchorPt_.y; } - return PointInPolygon(samplePtr, points, 5); + return pointInPolygon(samplePtr, points, 5); } return ((samplePtr->x >= anchorPt_.x) && diff --git a/src/bltGrMisc.C b/src/bltGrMisc.C index 377e447..188e73b 100644 --- a/src/bltGrMisc.C +++ b/src/bltGrMisc.C @@ -56,7 +56,7 @@ char* Blt::dupstr(const char* str) return copy; } -int Blt::PointInPolygon(Point2d *s, Point2d *points, int nPoints) +int Blt::pointInPolygon(Point2d *s, Point2d *points, int nPoints) { Point2d *p, *q, *qend; int count; @@ -116,7 +116,7 @@ static int ClipTest (double ds, double dr, double *t1, double *t2) * Line Clipping, ACM, TOG,3(1), 1984, pp.1-22. *--------------------------------------------------------------------------- */ -int Blt::LineRectClip(Region2d* regionPtr, Point2d *p, Point2d *q) +int Blt::lineRectClip(Region2d* regionPtr, Point2d *p, Point2d *q) { double t1, t2; double dx, dy; @@ -158,7 +158,7 @@ int Blt::LineRectClip(Region2d* regionPtr, Point2d *p, Point2d *q) #define AddVertex(vx, vy) r->x=(vx), r->y=(vy), r++, count++ #define LastVertex(vx, vy) r->x=(vx), r->y=(vy), count++ -int Blt::PolyRectClip(Region2d *regionPtr, Point2d *points, int nPoints, +int Blt::polyRectClip(Region2d *regionPtr, Point2d *points, int nPoints, Point2d *clipPts) { Point2d *p; /* First vertex of input polygon edge. */ @@ -270,7 +270,7 @@ int Blt::PolyRectClip(Region2d *regionPtr, Point2d *points, int nPoints, * line. *--------------------------------------------------------------------------- */ -Point2d Blt::GetProjection(int x, int y, Point2d *p, Point2d *q) +Point2d Blt::getProjection(int x, int y, Point2d *p, Point2d *q) { double dx = p->x - q->x; double dy = p->y - q->y; diff --git a/src/bltGrMisc.h b/src/bltGrMisc.h index 5c41969..7273bfc 100644 --- a/src/bltGrMisc.h +++ b/src/bltGrMisc.h @@ -92,7 +92,7 @@ namespace Blt { int nScreenPts); extern int polyRectClip(Region2d *extsPtr, Point2d *inputPts, int nInputPts, Point2d *outputPts); - extern int LineRectClip(Region2d *regionPtr, Point2d *p, Point2d *q); + extern int lineRectClip(Region2d *regionPtr, Point2d *p, Point2d *q); extern Point2d getProjection (int x, int y, Point2d *p, Point2d *q); extern Graph* getGraphFromWindowData(Tk_Window tkwin); }; diff --git a/src/bltGrPenOption.C b/src/bltGrPenOption.C index be6fa44..f894e6d 100644 --- a/src/bltGrPenOption.C +++ b/src/bltGrPenOption.C @@ -57,7 +57,7 @@ static int PenSetProc(ClientData clientData, Tcl_Interp* interp, return TCL_OK; } - Graph* graphPtr = Blt::GetGraphFromWindowData(tkwin); + Graph* graphPtr = getGraphFromWindowData(tkwin); Pen* penPtr; if (graphPtr->getPen(*objPtr, &penPtr) != TCL_OK) return TCL_ERROR; diff --git a/src/bltGraph.C b/src/bltGraph.C index 87697aa..f3ac448 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -1222,7 +1222,7 @@ Axis* Graph::nearestAxis(int x, int y) t.y = y - t.y - (rh * 0.5); bbox[4] = bbox[0]; - if (PointInPolygon(&t, bbox, 5)) { + if (pointInPolygon(&t, bbox, 5)) { return axisPtr; } } @@ -1242,7 +1242,7 @@ Axis* Graph::nearestAxis(int x, int y) t.y = y - t.y - (rh * 0.5); bbox[4] = bbox[0]; - if (PointInPolygon(&t, bbox, 5)) { + if (pointInPolygon(&t, bbox, 5)) { return axisPtr; } } |