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-2006 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  * as published by the Free Software Foundation; either version 2 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this file; see the file named COPYING for more
00019  * information.
00020  */
00021 
00022 /** \addtogroup plot */
00023 /*@{*/
00024 /** @file marker.c
00025  *
00026  *
00027  *      This routine places a specified character (either from
00028  * the ASCII set, or one of the 5 special marker characters)
00029  * centered about the current pen position (instead of above & to
00030  * the right of the current position, as characters usually go).
00031  * Calling sequence:
00032  *
00033 @code
00034  *      char c          is the character to be used for a marker,
00035  *                      or one of the following special markers -
00036  *                              1 = plus
00037  *                              2 = an "x"
00038  *                              3 = a triangle
00039  *                              4 = a square
00040  *                              5 = an hourglass
00041 @endcode
00042  *
00043  *  @author     Mike Muuss
00044  *@n    August 04, 1978
00045  *
00046  *  @par Source -
00047  *      SECAD/VLD Computing Consortium, Bldg 394
00048  *@n    The U. S. Army Ballistic Research Laboratory
00049  *@n    Aberdeen Proving Ground, Maryland  21005-5066
00050  *
00051  */
00052 /*@}*/
00053 
00054 #ifndef lint
00055 static const char RCSid[] = "@(#)$Header: /cvsroot/brlcad/brlcad/src/libbn/marker.c,v 14.10 2006/09/03 15:15:16 lbutler Exp $ (BRL)";
00056 #endif
00057 
00058 #include "common.h"
00059 
00060 
00061 
00062 #include <stdio.h>
00063 #ifdef HAVE_STRING_H
00064 #include <string.h>
00065 #endif
00066 
00067 #include "machine.h"
00068 #include "vmath.h"
00069 #include "plot3.h"
00070 
00071 void
00072 tp_2marker(FILE *fp, register int c, double x, double y, double scale)
00073 {
00074         char    mark_str[4];
00075 
00076         mark_str[0] = (char)c;
00077         mark_str[1] = '\0';
00078 
00079         /* Draw the marker */
00080         tp_2symbol( fp, mark_str,
00081                 (x - scale*0.5), (y - scale*0.5),
00082                 scale, 0.0 );
00083 }
00084 
00085 void
00086 PL_FORTRAN(f2mark, F2MARK)( fp, c, x, y, scale )
00087 FILE    **fp;
00088 int     *c;
00089 float   *x;
00090 float   *y;
00091 float   *scale;
00092 {
00093         tp_2marker( *fp, *c, *x, *y, *scale );
00094 }
00095 
00096 /*
00097  *                      T P _ 3 M A R K E R
00098  */
00099 void
00100 tp_3marker(FILE *fp, register int c, double x, double y, double z, double scale)
00101 {
00102         char    mark_str[4];
00103         mat_t   mat;
00104         vect_t  p;
00105 
00106         mark_str[0] = (char)c;
00107         mark_str[1] = '\0';
00108         MAT_IDN( mat );
00109         VSET( p, x - scale*0.5, y - scale*0.5, z );
00110         tp_3symbol( fp, mark_str, p, mat, scale );
00111 }
00112 
00113 void
00114 PL_FORTRAN(f3mark, F3MARK)( fp, c, x, y, z, scale )
00115 FILE    **fp;
00116 int     *c;
00117 float   *x;
00118 float   *y;
00119 float   *z;
00120 float   *scale;
00121 {
00122         tp_3marker( *fp, *c, *x, *y, *z, *scale );
00123 }
00124 
00125 /*@}*/
00126 /*
00127  * Local Variables:
00128  * mode: C
00129  * tab-width: 8
00130  * c-basic-offset: 4
00131  * indent-tabs-mode: t
00132  * End:
00133  * ex: shiftwidth=4 tabstop=8
00134  */

Generated on Mon Sep 18 01:24:47 2006 for BRL-CAD by  doxygen 1.4.6