20 const double x_scaling = 1.0,
21 const double x_offset = 0.0,
22 const double y_scaling = 1.0,
23 const double y_offset = 0.0,
24 const double size = 5.0)
61 const double x_scaling = 1.0,
62 const double x_offset = 0.0,
63 const double y_scaling = 1.0,
64 const double y_offset = 0.0,
65 const double size = 5.0)
96 double x_len = x_stop.first-x_start.first;
97 double y_len = y_stop.second-y_start.second;
104 double x_fac(0), y_fac(0), tic_x_spacing(0), tic_y_spacing(0);
105 x_fac = std::floor(std::log10(max_pos_x));
106 y_fac = std::floor(std::log10(max_pos_y));
109 tic_x_spacing = x_fac*std::pow(10,x_fac-1);
111 tic_x_spacing = -1*x_fac*std::pow(10,x_fac);
114 tic_y_spacing = y_fac*std::pow(10,y_fac-1);
116 tic_y_spacing = -1*y_fac*std::pow(10,y_fac);
119 if (tic_x_spacing <= 0)
121 if (tic_y_spacing <= 0)
140 double pos(x_start_x+tic_x_spacing);
141 while ( pos <=
m_xScale*x_len+x_start_x )
146 xy_coords start = make_pair(pos_pix-x_tic_width/2.0, y_start.second-
m_size/2.0);
147 xy_coords stop = make_pair(pos_pix-x_tic_width/2.0, y_start.second+
m_size/2.0);
156 ost << (pos-x_start_x);
158 string tic_label(ost.str());
159 double font_size = 10.0;
160 string font(
"Times-Roman");
173 pos += tic_x_spacing;
179 pos = y_start_y+tic_y_spacing;
180 while ( pos <=
m_yScale*y_len+y_start_y )
183 xy_coords start = make_pair( x_start.first-
m_size/2.0, pos_pix-y_tic_width/2.0);
184 xy_coords stop = make_pair( x_start.first+
m_size/2.0, pos_pix-y_tic_width/2.0);
194 ost << (pos-y_start_y);
196 string tic_label(ost.str());
197 double font_size = 10.0;
198 string font(
"Times-Roman");
213 pos += tic_y_spacing;
Definition: Whiteboard.h:276
double GetSize()
Definition: TicMarks.h:37
virtual ~TickingStrategyBase()
Definition: TicMarks.h:35
vector< text > m_yTxt
Definition: TicMarks.h:51
Definition: Whiteboard.h:394
vector< text > GetYText()
Definition: TicMarks.h:42
double m_xOffset
Definition: TicMarks.h:48
double m_yScale
Definition: TicMarks.h:48
virtual ~LinearTicking()
Definition: TicMarks.h:74
line * m_yAxis
Definition: TicMarks.h:46
The whiteboard namespace.
Definition: Axes.h:10
vector< line > GetXLines()
Definition: TicMarks.h:39
double GetWidth() const
Definition: Whiteboard.h:302
double m_yOffset
Definition: TicMarks.h:48
vector< line > GetYLines()
Definition: TicMarks.h:40
Definition: TicMarks.h:56
vector< line > m_xAxisTics
Definition: TicMarks.h:50
const color black(0, 0, 0)
Definition: TicMarks.h:13
tic_style
Definition: TicMarks.h:13
Definition: TicMarks.h:13
pair< double, double > xy_coords
Definition: Whiteboard.h:30
vector< text > GetXText()
Definition: TicMarks.h:41
virtual void CreateTicking()=0
Definition: TicMarks.h:13
File holding the base drawing classes of the whiteboard.
line * m_xAxis
Definition: TicMarks.h:45
double m_size
Definition: TicMarks.h:47
Definition: TicMarks.h:13
LinearTicking(line *x_axis, line *y_axis, const double x_scaling=1.0, const double x_offset=0.0, const double y_scaling=1.0, const double y_offset=0.0, const double size=5.0)
Definition: TicMarks.h:59
Definition: TicMarks.h:15
vector< text > m_xTxt
Definition: TicMarks.h:51
xy_coords StartCoords() const
Definition: Whiteboard.h:300
TickingStrategyBase(line *x_axis, line *y_axis, const double x_scaling=1.0, const double x_offset=0.0, const double y_scaling=1.0, const double y_offset=0.0, const double size=5.0)
Definition: TicMarks.h:18
void CreateTicking()
Definition: TicMarks.h:81
double m_xScale
Definition: TicMarks.h:48
vector< line > m_yAxisTics
Definition: TicMarks.h:50
xy_coords StopCoords() const
Definition: Whiteboard.h:301