[Commit] papers/xr_ols2003 appendix.tex,1.10,1.11
Carl Worth
commit@keithp.com
Fri, 16 May 2003 13:21:48 -0700
- Previous message: [Commit] papers/xr_ols2003 appendix.tex,1.9,1.10
- Next message: [Commit] papers/xr_ols2003 api.tex,1.17,1.18 appendix.tex,1.11,1.12 future.tex,1.4,1.5 implementation.tex,1.1,1.2 introduction.tex,1.16,1.17 related.tex,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: cworth
Update of /local/src/CVS/papers/xr_ols2003
In directory home.keithp.com:/tmp/cvs-serv27690
Modified Files:
appendix.tex
Log Message:
Reordered code in appendix so draw function is always first
Index: appendix.tex
===================================================================
RCS file: /local/src/CVS/papers/xr_ols2003/appendix.tex,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- appendix.tex 16 May 2003 20:13:11 -0000 1.10
+++ appendix.tex 16 May 2003 20:21:46 -0000 1.11
@@ -61,30 +61,6 @@
\begin{scriptsize}
\begin{verbatim}
void
-stroke_v_twice (XrState *xrs,
- int width, int height)
-{
- XrMoveTo (xrs, 0, 0);
- XrRelLineTo (xrs, width/2, height/2);
- XrRelLineTo (xrs, width/2, -height/2);
-
- XrSave (xrs);
- XrStroke (xrs);
- XrRestore (xrs);
-
- XrSave (xrs);
- {
- XrSetLineWidth (xrs, 2.0);
- XrSetLineCap (xrs, XrLineCapButt);
- XrSetRGBColor (xrs, 1, 1, 1);
- XrStroke (xrs);
- }
- XrRestore (xrs);
-
- XrNewPath (xrs);
-}
-
-void
draw_caps_joins (XrState *xrs,
int width, int height)
{
@@ -111,6 +87,30 @@
XrSetLineCap (xrs, XrLineCapRound);
stroke_v_twice (xrs, width, height);
}
+
+void
+stroke_v_twice (XrState *xrs,
+ int width, int height)
+{
+ XrMoveTo (xrs, 0, 0);
+ XrRelLineTo (xrs, width/2, height/2);
+ XrRelLineTo (xrs, width/2, -height/2);
+
+ XrSave (xrs);
+ XrStroke (xrs);
+ XrRestore (xrs);
+
+ XrSave (xrs);
+ {
+ XrSetLineWidth (xrs, 2.0);
+ XrSetLineCap (xrs, XrLineCapButt);
+ XrSetRGBColor (xrs, 1, 1, 1);
+ XrStroke (xrs);
+ }
+ XrRestore (xrs);
+
+ XrNewPath (xrs);
+}
\end{verbatim}
\end{scriptsize}
\caption{Source for cap and join demonstration}
@@ -152,18 +152,6 @@
\begin{scriptsize}
\begin{verbatim}
void
-draw_spline (XrState *xrs, double height)
-{
- XrMoveTo (xrs, 0, .1 * height);
- height = .8 * height;
- XrRelCurveTo (xrs,
- -height/2, height/2,
- height/2, height/2,
- 0, height);
- XrStroke (xrs);
-}
-
-void
draw_splines (XrState *xrs,
int width, int height)
{
@@ -182,6 +170,18 @@
XrTranslate (xrs, gap, 0);
}
}
+
+void
+draw_spline (XrState *xrs, double height)
+{
+ XrMoveTo (xrs, 0, .1 * height);
+ height = .8 * height;
+ XrRelCurveTo (xrs,
+ -height/2, height/2,
+ height/2, height/2,
+ 0, height);
+ XrStroke (xrs);
+}
\end{verbatim}
\end{scriptsize}
\caption{Source for splines drawn with varying tolerance}
@@ -192,20 +192,6 @@
\begin{scriptsize}
\begin{verbatim}
void
-star_path (XrState *xrs)
-{
- int i;
- double theta = 4 * M_PI / 5.0;
-
- XrMoveTo (xrs, 0, 0);
- for (i=0; i < 4; i++) {
- XrRelLineTo (xrs, 1.0, 0);
- XrRotate (xrs, theta);
- }
- XrClosePath (xrs);
-}
-
-void
draw_stars (XrState *xrs,
int width, int height)
{
@@ -232,6 +218,20 @@
}
XrRestore (xrs);
}
+
+void
+star_path (XrState *xrs)
+{
+ int i;
+ double theta = 4 * M_PI / 5.0;
+
+ XrMoveTo (xrs, 0, 0);
+ for (i=0; i < 4; i++) {
+ XrRelLineTo (xrs, 1.0, 0);
+ XrRotate (xrs, theta);
+ }
+ XrClosePath (xrs);
+}
\end{verbatim}
\end{scriptsize}
\caption{Source for stars to demonstrate fill rule}
@@ -242,6 +242,33 @@
\begin{scriptsize}
\begin{minipage}{.5\linewidth}
\begin{verbatim}
+void
+draw_gradients (XrState *xrs,
+ int img_width, int img_height)
+{
+ XrSurface *gradient;
+ double width, height, pad;
+
+ width = img_width / 4.0;
+ pad = (img_width - (3 * width)) / 2.0;
+ height = img_height;
+
+ gradient=make_gradient(xrs,width,height);
+
+ XrSetPattern (xrs, gradient);
+ draw_flat (xrs, width, height);
+ XrTranslate (xrs, width + pad, 0);
+ XrSetPattern (xrs, gradient);
+ draw_tent (xrs, width, height);
+ XrTranslate (xrs, width + pad, 0);
+ XrSetPattern (xrs, gradient);
+ draw_cylinder (xrs, width, height);
+
+ XrRestore (xrs);
+
+ XrSurfaceDestroy (gradient);
+}
+
XrSurface *
make_gradient (XrState *xrs,
double width, double height)
@@ -279,33 +306,6 @@
return g;
}
-
-void
-draw_gradients (XrState *xrs,
- int img_width, int img_height)
-{
- XrSurface *gradient;
- double width, height, pad;
-
- width = img_width / 4.0;
- pad = (img_width - (3 * width)) / 2.0;
- height = img_height;
-
- gradient=make_gradient(xrs,width,height);
-
- XrSetPattern (xrs, gradient);
- draw_flat (xrs, width, height);
- XrTranslate (xrs, width + pad, 0);
- XrSetPattern (xrs, gradient);
- draw_tent (xrs, width, height);
- XrTranslate (xrs, width + pad, 0);
- XrSetPattern (xrs, gradient);
- draw_cylinder (xrs, width, height);
-
- XrRestore (xrs);
-
- XrSurfaceDestroy (gradient);
-}
\end{verbatim}
\end{minipage}
\begin{minipage}{.5\linewidth}
@@ -343,10 +343,10 @@
XrMoveTo (xrs, 0, hw);
XrRelCurveTo (xrs, 0, -hw,
- w, -hw, w, 0);
+ w, -hw, w, 0);
XrRelLineTo (xrs, 0, h - hw);
XrRelCurveTo (xrs, 0, -hw,
- -w, -hw, -w, 0);
+ -w, -hw, -w, 0);
XrClosePath (xrs);
XrFill (xrs);
- Previous message: [Commit] papers/xr_ols2003 appendix.tex,1.9,1.10
- Next message: [Commit] papers/xr_ols2003 api.tex,1.17,1.18 appendix.tex,1.11,1.12 future.tex,1.4,1.5 implementation.tex,1.1,1.2 introduction.tex,1.16,1.17 related.tex,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]