diff options
-rw-r--r-- | bltGrMarkerBitmap.C | 4 | ||||
-rwxr-xr-x | configure | 1 | ||||
-rwxr-xr-x | configure.in | 1 | ||||
-rw-r--r-- | src/bltGrElemBar.C | 2 | ||||
-rw-r--r-- | src/bltGrElemLine.C | 24 | ||||
-rw-r--r-- | src/bltGrMarkerLine.C | 2 | ||||
-rw-r--r-- | src/bltGrMarkerPolygon.C | 3 | ||||
-rw-r--r-- | src/bltGrPSOutput.h | 4 | ||||
-rw-r--r-- | src/bltGraph.C | 35 | ||||
-rw-r--r-- | src/bltGraph.h | 2 | ||||
-rw-r--r-- | src/bltGraphOp.C | 3 |
11 files changed, 34 insertions, 47 deletions
diff --git a/bltGrMarkerBitmap.C b/bltGrMarkerBitmap.C index f6b5650..14b0318 100644 --- a/bltGrMarkerBitmap.C +++ b/bltGrMarkerBitmap.C @@ -213,7 +213,9 @@ void BitmapMarker::map() polygon[ii].x = (polygon[ii].x) + tx; polygon[ii].y = (polygon[ii].y) + ty; } - Blt_GraphExtents(graphPtr_, &extents); + + graphPtr_->extents(&extents); + int nn = Blt_PolyRectClip(&extents, polygon, 4, outline_); if (nn < 3) { memcpy(&outline_, polygon, sizeof(Point2d) * 4); @@ -5563,7 +5563,6 @@ done bltNsUtil.C bltParse.C bltPs.C - bltPsAfm.C bltOp.C bltSpline.C bltSwitch.C diff --git a/configure.in b/configure.in index 1ef003b..ac68d68 100755 --- a/configure.in +++ b/configure.in @@ -108,7 +108,6 @@ TEA_ADD_SOURCES([ bltNsUtil.C bltParse.C bltPs.C - bltPsAfm.C bltOp.C bltSpline.C bltSwitch.C diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index e24191f..336bcc4 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -1066,7 +1066,7 @@ void BarElement::MapErrorBars(BarStyle **dataToStyle) BarElementOptions* ops = (BarElementOptions*)ops_; Region2d reg; - Blt_GraphExtents(graphPtr_, ®); + graphPtr_->extents(®); int nPoints = NUMBEROFPOINTS(ops); int n =0; diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index 5aed37d..d74f275 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -1292,22 +1292,23 @@ void LineElement::GenerateSpline(MapInfo *mapPtr) void LineElement::GenerateParametricSpline(MapInfo *mapPtr) { - Region2d exts; Point2d *origPts, *iPts; int *map; int niPts, nOrigPts; int result; - int i, j, count; + int i, j; nOrigPts = mapPtr->nScreenPts; origPts = mapPtr->screenPts; - Blt_GraphExtents(graphPtr_, &exts); + + Region2d exts; + graphPtr_->extents(&exts); /* * Populate the x2 array with both the original X-coordinates and extra * X-coordinates for each horizontal pixel that the line segment contains. */ - count = 1; + int count = 1; for (i = 0, j = 1; j < nOrigPts; i++, j++) { Point2d p, q; @@ -1400,16 +1401,16 @@ void LineElement::GenerateParametricSpline(MapInfo *mapPtr) void LineElement::MapSymbols(MapInfo *mapPtr) { - Region2d exts; Point2d *pp; int i; Point2d* points = (Point2d*)malloc(sizeof(Point2d) * mapPtr->nScreenPts); int *map = (int*)malloc(sizeof(int) * mapPtr->nScreenPts); - Blt_GraphExtents(graphPtr_, &exts); - int count = 0; + Region2d exts; + graphPtr_->extents(&exts); + int count = 0; for (pp = mapPtr->screenPts, i = 0; i < mapPtr->nScreenPts; i++, pp++) { if (PointInRegion(&exts, pp->x, pp->y)) { points[count].x = pp->x; @@ -1437,7 +1438,7 @@ void LineElement::MapActiveSymbols() } Region2d exts; - Blt_GraphExtents(graphPtr_, &exts); + graphPtr_->extents(&exts); Point2d *points = (Point2d*)malloc(sizeof(Point2d) * nActiveIndices_); int* map = (int*)malloc(sizeof(int) * nActiveIndices_); @@ -1702,7 +1703,8 @@ void LineElement::MapTraces(MapInfo *mapPtr) LineElementOptions* ops = (LineElementOptions*)ops_; Region2d exts; - Blt_GraphExtents(graphPtr_, &exts); + graphPtr_->extents(&exts); + int count = 1; int code1 = OutCode(&exts, mapPtr->screenPts); Point2d* p = mapPtr->screenPts; @@ -1775,7 +1777,7 @@ void LineElement::MapFillArea(MapInfo *mapPtr) int np = mapPtr->nScreenPts + 3; Region2d exts; - Blt_GraphExtents(graphPtr_, &exts); + graphPtr_->extents(&exts); Point2d* origPts = (Point2d*)malloc(sizeof(Point2d) * np); if (gops->inverted) { @@ -1901,7 +1903,7 @@ void LineElement::MapErrorBars(LineStyle **styleMap) LineElementOptions* ops = (LineElementOptions*)ops_; Region2d exts; - Blt_GraphExtents(graphPtr_, &exts); + graphPtr_->extents(&exts); int n =0; int np = NUMBEROFPOINTS(ops); diff --git a/src/bltGrMarkerLine.C b/src/bltGrMarkerLine.C index 718a40d..0a4b2eb 100644 --- a/src/bltGrMarkerLine.C +++ b/src/bltGrMarkerLine.C @@ -178,7 +178,7 @@ void LineMarker::map() return; Region2d extents; - Blt_GraphExtents(graphPtr_, &extents); + graphPtr_->extents(&extents); // Allow twice the number of world coordinates. The line will represented // as series of line segments, not one continous polyline. This is diff --git a/src/bltGrMarkerPolygon.C b/src/bltGrMarkerPolygon.C index bfa4196..5771d35 100644 --- a/src/bltGrMarkerPolygon.C +++ b/src/bltGrMarkerPolygon.C @@ -273,7 +273,8 @@ void PolygonMarker::map() *dp = screenPts[0]; } Region2d extents; - Blt_GraphExtents(graphPtr_, &extents); + graphPtr_->extents(&extents); + clipped_ = 1; if (ops->fill) { Point2d* lfillPts = new Point2d[nScreenPts * 3]; diff --git a/src/bltGrPSOutput.h b/src/bltGrPSOutput.h index b853a9b..fc14b7c 100644 --- a/src/bltGrPSOutput.h +++ b/src/bltGrPSOutput.h @@ -187,10 +187,6 @@ extern void Blt_Ps_Polygon(Blt_Ps ps, Point2d *screenPts, int nScreenPts); extern void Blt_Ps_SetPrinting(Blt_Ps ps, int value); extern int Blt_Ps_IsPrinting(void); -extern int Blt_Ps_TextWidth(Tk_Font font, const char *string, int nBytes); - -extern int Blt_Ps_GetFontMetrics(Tk_Font font, Tk_FontMetrics *fmPtr); - extern void Blt_Ps_FontName(const char *family, int flags, Tcl_DString *resultPtr); diff --git a/src/bltGraph.C b/src/bltGraph.C index dcc39a5..db16f6b 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -701,6 +701,16 @@ static void AdjustAxisPointers(Graph* graphPtr) } } +void Graph::extents(Region2d* regionPtr) +{ + GraphOptions* ops = (GraphOptions*)ops_; + + regionPtr->left = (double)(hOffset_ - ops->xPad); + regionPtr->top = (double)(vOffset_ - ops->yPad); + regionPtr->right = (double)(hOffset_ + hRange_ + ops->xPad); + regionPtr->bottom = (double)(vOffset_ + vRange_ + ops->yPad); +} + // Support static void UpdateMarginTraces(Graph* graphPtr) @@ -726,29 +736,6 @@ static void UpdateMarginTraces(Graph* graphPtr) } } -/* - *--------------------------------------------------------------------------- - * Generates a bounding box representing the plotting area of the - * graph. This data structure is used to clip the points and line - * segments of the line element. - * The clip region is the plotting area plus such arbitrary extra space. - * The reason we clip with a bounding box larger than the plot area is so - * that symbols will be drawn even if their center point isn't in the - * plotting area. - *--------------------------------------------------------------------------- - */ - -void Blt_GraphExtents(Graph* graphPtr, Region2d *regionPtr) -{ - GraphOptions* ops = (GraphOptions*)graphPtr->ops_; - regionPtr->left = (double)(graphPtr->hOffset_ - ops->xPad); - regionPtr->top = (double)(graphPtr->vOffset_ - ops->yPad); - regionPtr->right = (double)(graphPtr->hOffset_ + graphPtr->hRange_ + - ops->xPad); - regionPtr->bottom = (double)(graphPtr->vOffset_ + graphPtr->vRange_ + - ops->yPad); -} - void Blt_ReconfigureGraph(Graph* graphPtr) { graphPtr->configure(); @@ -829,7 +816,7 @@ static ClientData PickEntry(ClientData clientData, int x, int y, } Region2d exts; - Blt_GraphExtents(graphPtr, &exts); + graphPtr->extents(&exts); // Sample coordinate is in one of the graph margins. Can only pick an axis. if ((x >= exts.right) || (x < exts.left) || diff --git a/src/bltGraph.h b/src/bltGraph.h index 211db66..865032f 100644 --- a/src/bltGraph.h +++ b/src/bltGraph.h @@ -206,10 +206,10 @@ class Graph { void display(); void map(); void eventuallyRedraw(); + void extents(Region2d*); }; extern void Blt_ReconfigureGraph(Graph* graphPtr); -extern void Blt_GraphExtents(Graph* graphPtr, Region2d *extsPtr); typedef ClientData (MakeTagProc)(Graph* graphPtr, const char *tagName); extern MakeTagProc Blt_MakeElementTag; diff --git a/src/bltGraphOp.C b/src/bltGraphOp.C index a901a3d..f70950d 100644 --- a/src/bltGraphOp.C +++ b/src/bltGraphOp.C @@ -329,7 +329,8 @@ static int InsideOp(Graph* graphPtr, Tcl_Interp* interp, int objc, return TCL_ERROR; Region2d exts; - Blt_GraphExtents(graphPtr, &exts); + graphPtr->extents(&exts); + int result = PointInRegion(&exts, x, y); Tcl_SetBooleanObj(Tcl_GetObjResult(interp), result); |