summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoye <joye>2014-04-15 21:23:32 (GMT)
committerjoye <joye>2014-04-15 21:23:32 (GMT)
commit07c430bafa1b0a896a1d0f9eec204303ce0afb5e (patch)
tree2ddd6a80ecdd9e35f86d86453005c73abef4dfab
parent9c45cbb9c92635cb175b2085144fbbb310a2a8ef (diff)
downloadblt-07c430bafa1b0a896a1d0f9eec204303ce0afb5e.zip
blt-07c430bafa1b0a896a1d0f9eec204303ce0afb5e.tar.gz
blt-07c430bafa1b0a896a1d0f9eec204303ce0afb5e.tar.bz2
*** empty log message ***
-rw-r--r--src/bltGrMisc.C22
-rw-r--r--src/bltGrMisc.h11
-rw-r--r--src/bltGraph.C22
-rw-r--r--src/bltGraph.h2
4 files changed, 33 insertions, 24 deletions
diff --git a/src/bltGrMisc.C b/src/bltGrMisc.C
index aaf0e56..5f3a5fc 100644
--- a/src/bltGrMisc.C
+++ b/src/bltGrMisc.C
@@ -96,28 +96,6 @@ int Blt_PointInPolygon(Point2d *s, Point2d *points, int nPoints)
return (count & 0x01);
}
-/*
- *---------------------------------------------------------------------------
- * 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)
-{
- regionPtr->left = (double)(graphPtr->hOffset - graphPtr->xPad);
- regionPtr->top = (double)(graphPtr->vOffset - graphPtr->yPad);
- regionPtr->right = (double)(graphPtr->hOffset + graphPtr->hRange +
- graphPtr->xPad);
- regionPtr->bottom = (double)(graphPtr->vOffset + graphPtr->vRange +
- graphPtr->yPad);
-}
-
static int ClipTest (double ds, double dr, double *t1, double *t2)
{
double t;
diff --git a/src/bltGrMisc.h b/src/bltGrMisc.h
index dbef8fa..4f7b301 100644
--- a/src/bltGrMisc.h
+++ b/src/bltGrMisc.h
@@ -40,6 +40,17 @@
#include <tkInt.h>
#endif
+#define MARGIN_NONE -1
+#define MARGIN_BOTTOM 0 /* x */
+#define MARGIN_LEFT 1 /* y */
+#define MARGIN_TOP 2 /* x2 */
+#define MARGIN_RIGHT 3 /* y2 */
+
+#define rightMargin margins[MARGIN_RIGHT]
+#define leftMargin margins[MARGIN_LEFT]
+#define topMargin margins[MARGIN_TOP]
+#define bottomMargin margins[MARGIN_BOTTOM]
+
class Graph;
typedef struct {
diff --git a/src/bltGraph.C b/src/bltGraph.C
index a79624f..c66fb0d 100644
--- a/src/bltGraph.C
+++ b/src/bltGraph.C
@@ -809,6 +809,28 @@ 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)
+{
+ regionPtr->left = (double)(graphPtr->hOffset - graphPtr->xPad);
+ regionPtr->top = (double)(graphPtr->vOffset - graphPtr->yPad);
+ regionPtr->right = (double)(graphPtr->hOffset + graphPtr->hRange +
+ graphPtr->xPad);
+ regionPtr->bottom = (double)(graphPtr->vOffset + graphPtr->vRange +
+ graphPtr->yPad);
+}
+
void Blt_ReconfigureGraph(Graph* graphPtr)
{
GraphConfigure(graphPtr);
diff --git a/src/bltGraph.h b/src/bltGraph.h
index e29d148..57b9bfa 100644
--- a/src/bltGraph.h
+++ b/src/bltGraph.h
@@ -289,6 +289,4 @@ extern MakeTagProc Blt_MakeAxisTag;
extern Blt_BindTagProc Blt_GraphTags;
extern Blt_BindTagProc Blt_AxisTags;
-extern Graph *Blt_GetGraphFromWindowData(Tk_Window tkwin);
-
#endif