aboutsummaryrefslogtreecommitdiff
path: root/src/render_hkl.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-07-06 18:09:59 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:52 +0100
commit68b8e4272dc7cb808323e7b37bd02170403332bd (patch)
tree95774493a79f565e63e37dc0ea22874de28dc88c /src/render_hkl.c
parent0bd1f78e65bf02dfff19b20f5883978c12f6d766 (diff)
Add --disable-cairo option and compile without Cairo
Diffstat (limited to 'src/render_hkl.c')
-rw-r--r--src/render_hkl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/render_hkl.c b/src/render_hkl.c
index d7a9069e..de8e3021 100644
--- a/src/render_hkl.c
+++ b/src/render_hkl.c
@@ -20,8 +20,10 @@
#include <string.h>
#include <unistd.h>
#include <getopt.h>
+#ifdef HAVE_CAIRO
#include <cairo.h>
#include <cairo-pdf.h>
+#endif
#include "utils.h"
#include "reflections.h"
@@ -43,7 +45,9 @@ static void show_help(const char *s)
"\n"
" -h, --help Display this help message.\n"
" --povray Render a 3D animation using POV-ray.\n"
+#ifdef HAVE_CAIRO
" --zone-axis Render a 2D zone axis pattern.\n"
+#endif
" --boost=<val> Squash colour scale by <val>.\n"
" -j <n> Run <n> instances of POV-ray in parallel.\n"
" -p, --pdb=<file> PDB file from which to get the unit cell.\n"
@@ -60,6 +64,7 @@ static void show_help(const char *s)
}
+#ifdef HAVE_CAIRO
static void render_za(UnitCell *cell, double *ref, unsigned int *c,
double boost, const char *sym, int wght)
{
@@ -275,6 +280,7 @@ out:
cairo_surface_finish(surface);
cairo_destroy(dctx);
}
+#endif
int main(int argc, char *argv[])
@@ -393,7 +399,13 @@ int main(int argc, char *argv[])
if ( config_povray ) {
r = povray_render_animation(cell, ref, cts, nproc);
} else if ( config_zoneaxis ) {
+#ifdef HAVE_CAIRO
render_za(cell, ref, cts, boost, sym, wght);
+#else
+ ERROR("This version of CrystFEL was compiled without Cairo");
+ ERROR(" support, which is required to plot a zone axis");
+ ERROR(" pattern. Sorry!\n");
+#endif
} else {
ERROR("Try again with either --povray or --zone-axis.\n");
}