File: markers.h

package info (click to toggle)
epix 1.2.19-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 3,284 kB
  • sloc: cpp: 16,837; sh: 5,043; makefile: 155; lisp: 6
file content (119 lines) | stat: -rw-r--r-- 4,086 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* 
 * markers.h -- ePiX markers and labels
 *
 * This file is part of ePiX, a C++ library for creating high-quality 
 * figures in LaTeX 
 *
 * Version 1.1.16
 * Last Change: September 09, 2007
 */

/* 
 * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
 * Andrew D. Hwang <rot 13 nujnat at zngupf dot ubylpebff dot rqh>
 * Department of Mathematics and Computer Science
 * College of the Holy Cross
 * Worcester, MA, 01610-2395, USA
 */

/*
 * ePiX is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * ePiX is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 * License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ePiX; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

/*
 * label -- put string constant <label_text> at Cartesian position <base>
 * translated by (offset.x1, offset.x2) true points (i.e., 3rd component
 * of <offset> is discarded).
 *
 * Accepts an optional LaTeX-style positioning argument.
 * If no offset is specified, the label is centered at the given Cartesian
 * location.
 * masklabel requires the "color" package, and places the text in 
 * a white box that masks whatever is underneath and earlier in the file.
 */
#ifndef EPIX_MARKERS
#define EPIX_MARKERS

#include <string>

#include "enums.h"

namespace ePiX {

  class P;

  // position, [offset], label text, [alignment]
  void label(const P&, const P&, const std::string&);
  void label(const P&, const std::string&);
  void label(const P&, const P&, const std::string&, epix_label_posn);

  void masklabel(const P&, const P&, const std::string&);
  void masklabel(const P&, const std::string&);
  void masklabel(const P&, const P&, const std::string&, epix_label_posn);


  // Empty and filled LaTeX circles of diameter get_dotsize() true pt
  void marker (const P&, epix_mark_type);

  void circ(const P& posn, const P& offset=P(0,0),
	    const std::string& label_text="",
	    epix_label_posn align=none); // filled white circ

  void ring(const P& posn, const P& offset=P(0,0),
	    const std::string& label_text="",
	    epix_label_posn align=none); // unfilled circ 

  void spot(const P& posn, const P& offset=P(0,0),
	    const std::string& label_text="",
	    epix_label_posn align=none);

  void dot(const P& posn, const P& offset=P(0,0),
	   const std::string& label_text="",
	   epix_label_posn align=none);

  void ddot(const P& posn, const P& offset=P(0,0),
	    const std::string& label_text="",
	    epix_label_posn align=none);

  void box(const P& posn, const P& offset=P(0,0),
	   const std::string& label_text="",
	   epix_label_posn align=none);

  void bbox(const P& posn, const P& offset=P(0,0),
	    const std::string& label_text="",
	    epix_label_posn align=none);

  void h_axis_tick(const P& location, epix_label_posn align=c);
  void v_axis_tick(const P& location, epix_label_posn align=c);

  // Arrow with aligned label at tail
  void arrow(const P& tail, const P& head, const P& offset,
	     const std::string& label_text,
	     epix_label_posn align, double scale=1);

  //// Path-like glyphs ////
  // angle indicators; default args are true sizes in pt
  void right_angle(const P& loc, P leg1, P leg2, double scale=8);
  void arc_measure(const P& loc, P leg1, P leg2,
		   const P& offset, const std::string&, epix_label_posn,
		   double scale=8);
  void arc_measure(const P& loc, P leg1, P leg2, double scale=8);

  void axis_break(const P& tail, const P& head, double scale=12);
  void h_error_bar(const P& loc, double err, epix_mark_type mk, double ht=6);
  void v_error_bar(const P& loc, double err, epix_mark_type mk, double wd=6);
} // end of namespace

#endif /* EPIX_MARKERS */