summaryrefslogtreecommitdiffstats
path: root/src/bltGrAxis.C
diff options
context:
space:
mode:
authorjoye <joye>2014-04-17 17:05:42 (GMT)
committerjoye <joye>2014-04-17 17:05:42 (GMT)
commit5203b01c7d32185f31ad84a0cf1040b90adb1d42 (patch)
treecf710852e5731bb3f0b2c9568b664ce945197e47 /src/bltGrAxis.C
parentb6a17c50c2b0722cec7c63876ac28f3f66e47293 (diff)
downloadblt-5203b01c7d32185f31ad84a0cf1040b90adb1d42.zip
blt-5203b01c7d32185f31ad84a0cf1040b90adb1d42.tar.gz
blt-5203b01c7d32185f31ad84a0cf1040b90adb1d42.tar.bz2
*** empty log message ***
Diffstat (limited to 'src/bltGrAxis.C')
-rw-r--r--src/bltGrAxis.C48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C
index fed9fb9..49552f8 100644
--- a/src/bltGrAxis.C
+++ b/src/bltGrAxis.C
@@ -499,6 +499,9 @@ void Axis::draw(Drawable drawable)
{
AxisOptions* ops = (AxisOptions*)ops_;
+ if (ops->hide || !use_ || (flags & DELETE_PENDING))
+ return;
+
if (ops->normalBg) {
Tk_Fill3DRectangle(graphPtr_->tkwin_, drawable, ops->normalBg,
left_, top_, right_ - left_, bottom_ - top_,
@@ -622,11 +625,29 @@ void Axis::draw(Drawable drawable)
}
}
+void Axis::drawGrids(Drawable drawable)
+{
+ AxisOptions* ops = (AxisOptions*)ops_;
+
+ if (ops->hide || !ops->showGrid || !use_ || (flags & DELETE_PENDING))
+ return;
+
+ Blt_Draw2DSegments(graphPtr_->display_, drawable, ops->major.gc,
+ ops->major.segments, ops->major.nUsed);
+
+ if (ops->showGridMinor)
+ Blt_Draw2DSegments(graphPtr_->display_, drawable, ops->minor.gc,
+ ops->minor.segments, ops->minor.nUsed);
+}
+
void Axis::drawLimits(Drawable drawable)
{
AxisOptions* ops = (AxisOptions*)ops_;
GraphOptions* gops = (GraphOptions*)graphPtr_->ops_;
+ if ((flags & DELETE_PENDING) || (!ops->limitsFormat))
+ return;
+
int vMin = graphPtr_->left_ + gops->xPad + 2;
int vMax = vMin;
int hMin = graphPtr_->bottom_ - gops->yPad - 2;
@@ -1670,6 +1691,9 @@ void Axis::print(Blt_Ps ps)
{
AxisOptions* ops = (AxisOptions*)ops_;
+ if (ops->hide || !use_ || (flags & DELETE_PENDING))
+ return;
+
Blt_Ps_Format(ps, "%% Axis \"%s\"\n", name());
if (ops->normalBg)
Blt_Ps_Fill3DRectangle(ps, ops->normalBg, left_, top_,
@@ -1718,11 +1742,35 @@ void Axis::print(Blt_Ps ps)
}
}
+void Axis::printGrids(Blt_Ps ps)
+{
+ AxisOptions* ops = (AxisOptions*)ops_;
+
+ if (ops->hide || !ops->showGrid || !use_ || (flags & DELETE_PENDING))
+ continue;
+
+ Blt_Ps_Format(ps, "%% Axis %s: grid line attributes\n", name());
+ Blt_Ps_XSetLineAttributes(ps, ops->major.color, ops->major.lineWidth,
+ &ops->major.dashes, CapButt, JoinMiter);
+ Blt_Ps_Format(ps, "%% Axis %s: major grid line segments\n", name());
+ Blt_Ps_Draw2DSegments(ps, ops->major.segments, ops->major.nUsed);
+
+ if (ops->showGridMinor) {
+ Blt_Ps_XSetLineAttributes(ps, ops->minor.color, ops->minor.lineWidth,
+ &ops->minor.dashes, CapButt, JoinMiter);
+ Blt_Ps_Format(ps, "%% Axis %s: minor grid line segments\n", name());
+ Blt_Ps_Draw2DSegments(ps, ops->minor.segments, ops->minor.nUsed);
+ }
+}
+
void Axis::printLimits(Blt_Ps ps)
{
AxisOptions* ops = (AxisOptions*)ops_;
GraphOptions* gops = (GraphOptions*)graphPtr_->ops_;
+ if ((flags & DELETE_PENDING) || (!ops->limitsFormat))
+ return;
+
double vMin = graphPtr_->left_ + gops->xPad + 2;
double vMax = vMin;
double hMin = graphPtr_->bottom_ - gops->yPad - 2;