marker.c

Go to the documentation of this file.
00001 /*                        M A R K E R . C
00002  * BRL-CAD
00003  *
00004  * Copyright (c) 2004-2012 United States Government as represented by
00005  * the U.S. Army Research Laboratory.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License
00009  * version 2.1 as published by the Free Software Foundation.
00010  *
00011  * This library is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this file; see the file named COPYING for more
00018  * information.
00019  */
00020 /** @addtogroup plot */
00021 /** @{ */
00022 /** @file libbn/marker.c
00023  *
00024  *      This routine places a specified character (either from
00025  * the ASCII set, or one of the 5 special marker characters)
00026  * centered about the current pen position (instead of above & to
00027  * the right of the current position, as characters usually go).
00028  * Calling sequence:
00029  *
00030  @code
00031  *      char c          is the character to be used for a marker,
00032  *                      or one of the following special markers -
00033  *                              1 = plus
00034  *                              2 = an "x"
00035  *                              3 = a triangle
00036  *                              4 = a square
00037  *                              5 = an hourglass
00038  @endcode
00039  *
00040  * Originally written on August 04, 1978
00041  *
00042  */
00043 /** @} */
00044 
00045 #include "common.h"
00046 
00047 #include <stdio.h>
00048 #include <string.h>
00049 
00050 #include "vmath.h"
00051 #include "plot3.h"
00052 
00053 void
00054 tp_2marker(FILE *fp, register int c, double x, double y, double scale)
00055 {
00056     char        mark_str[4];
00057 
00058     mark_str[0] = (char)c;
00059     mark_str[1] = '\0';
00060 
00061     /* Draw the marker */
00062     tp_2symbol( fp, mark_str,
00063                 (x - scale*0.5), (y - scale*0.5),
00064                 scale, 0.0 );
00065 }
00066 
00067 void
00068 PL_FORTRAN(f2mark, F2MARK)(FILE **fp, int *c, float *x, float*y, float *scale)
00069 {
00070     tp_2marker( *fp, *c, *x, *y, *scale );
00071 }
00072 
00073 /*
00074  *                      T P _ 3 M A R K E R
00075  */
00076 void
00077 tp_3marker(FILE *fp, register int c, double x, double y, double z, double scale)
00078 {
00079     char        mark_str[4];
00080     mat_t       mat;
00081     vect_t      p;
00082 
00083     mark_str[0] = (char)c;
00084     mark_str[1] = '\0';
00085     MAT_IDN( mat );
00086     VSET( p, x - scale*0.5, y - scale*0.5, z );
00087     tp_3symbol( fp, mark_str, p, mat, scale );
00088 }
00089 
00090 void
00091 PL_FORTRAN(f3mark, F3MARK)(FILE **fp, int *c, float *x, float *y, float *z, float *scale)
00092 {
00093     tp_3marker( *fp, *c, *x, *y, *z, *scale );
00094 }
00095 
00096 /** @} */
00097 /*
00098  * Local Variables:
00099  * mode: C
00100  * tab-width: 8
00101  * indent-tabs-mode: t
00102  * c-file-style: "stroustrup"
00103  * End:
00104  * ex: shiftwidth=4 tabstop=8
00105  */
Generated on Tue Dec 11 13:14:27 2012 for LIBBN by  doxygen 1.6.3