19 #include "msdevstudio/MSconfig.h"
20 #define finite _finite
43 using namespace hippodraw;
46 : m_sci_note_x(false),
49 m_axis_y_origin ( 0.0),
51 m_axis_height ( 0.0 ),
53 m_x_tick_font_size ( 1.0 ),
54 m_y_tick_font_size ( 1.0 ),
66 : m_sci_note_x(axis_rep.m_sci_note_x),
67 m_sci_note_y(axis_rep.m_sci_note_y),
68 m_axis_x_origin( axis_rep.m_axis_x_origin ),
69 m_axis_y_origin( axis_rep.m_axis_y_origin ),
70 m_axis_width( axis_rep.m_axis_width ),
71 m_axis_height( axis_rep.m_axis_height ),
72 m_font_size( axis_rep.m_font_size ),
73 m_x_font_size( axis_rep.m_x_font_size ),
74 m_y_font_size( axis_rep.m_y_font_size ),
75 m_xLabelFont( axis_rep.m_xLabelFont ),
76 m_yLabelFont( axis_rep.m_yLabelFont ),
77 m_zLabelFont( axis_rep.m_zLabelFont ),
78 m_titleFont( axis_rep.m_titleFont ),
79 m_draw_titles( axis_rep.m_draw_titles )
123 #ifdef HAVE_TEX_UTILS
125 string tex_snippet = title.substr(4);
132 float mx = marginRect.
getX();
136 double x_font_size = ( 1.3 *
mw ) / title.size();
142 float x = mx + 0.5 * marginRect.
getWidth ();
146 view.
drawText ( title, x, y, 0.0, 0.0,
'c',
't',
false,
152 #ifdef HAVE_TEX_UTILS
173 draw_rect.
getY() ) / 2.0 );
175 else if ( location ==
PLOTTOP )
181 - draw_rect.
getY() ) ) /2.0 );
194 double size = height * 0.040;
195 size = std::min ( size, 11.0 );
200 const vector<AxisTick> & labels = axisModel.
getTicks ( );
201 if ( labels.empty () == true )
return;
214 const AxisTick & tick = labels.back ( );
217 draw_rect.
getX() - yr )
235 draw_rect.
getX() ) - yr )
236 / labels[labels.size() - 1].content().size() );
251 draw_rect.
getY() ) / 2.0 );
253 else if ( location ==
PLOTTOP )
259 - draw_rect.
getY() ) ) /2.0 );
266 ViewBase & base,
const std::string & x_label )
272 const vector< AxisTick > & ticks = axisModel.
getTicks();
274 int mid = ticks.size()/2;
275 double ref = ticks[mid].value();
276 double range = ticks[mid+1].value()-ref;
280 #ifdef HAVE_TEX_UTILS
282 string tex_snippet = x_label.substr(4);
284 tex_snippet+=
"-"+ticks[mid].content();
297 label = x_label+
" - "+ticks[mid].content();
303 float x = 0., y = 0.;
306 float draw_w = draw_rect.
getWidth ();
309 float margin_x = margin_rect.
getX ();
310 float margin_w = margin_rect.
getWidth ();
312 x = margin_x + 0.5 * margin_w;
314 float tmp = 0.045 * draw_w;
315 tmp = max ( tmp, 1.0f );
319 double ratio = draw_w / ( label.size() ) * 2;
330 view.
drawText ( label, x, y, 0., 0.0,
'c',
't',
342 view.
drawText ( label, x, y, 0.0, 0.0,
'c',
't',
359 double pmag = axisModel.
getPMag();
360 int i = static_cast <
int > ( pmag );
369 double pmag = axisModel.
getPMag();
370 int i = static_cast <
int > ( pmag );
377 #ifdef HAVE_TEX_UTILS
385 ViewBase & base,
const std::string & y_label )
391 const vector< AxisTick > & ticks = axisModel.
getTicks();
393 int mid = ticks.size()/2;
394 double ref = ticks[mid].value();
395 double range = ticks[mid+1].value()-ref;
399 #ifdef HAVE_TEX_UTILS
402 string tex_snippet = y_label.substr(4);
405 tex_snippet+=
"-"+ticks[mid].content();
422 label = y_label+
" - "+ticks[mid].content();
430 float x = 0., y = 0.;
435 float tmp = draw_rect.
getHeight() * 0.05;
438 / ( label.size() ) * 2 );
448 view.
drawText ( label, x, y, 0.0, 90.0,
'c',
't',
458 view.
drawText ( label, x, y, 0.0, -90.0,
'c',
't',
474 double pmag = axisModel.
getPMag();
475 int i = static_cast <
int > ( pmag );
484 double pmag = axisModel.
getPMag();
485 int i = static_cast <
int > ( pmag );
492 #ifdef HAVE_TEX_UTILS
501 const std::string & ref)
508 float x = margin_rect.
getX() + margin_rect.getWidth ();
536 ViewBase & base ,
const std::string & mag )
541 float x = margin_rect.
getX() + margin_rect.getWidth ();
543 double pmag = axisModel.
getPMag();
544 int i =
static_cast<int> (pmag);
566 ViewBase & base,
const std::string & mag )
583 double pmag = axisModel.
getPMag();
584 int i = static_cast <
int > ( pmag );
601 const Range & x_range,
602 const Range & y_range)
606 vector< double > xv ( 100 );
607 vector< double > yv ( 100 );
608 Color black ( 0, 0, 0 );
610 xv[0] = x_range.
low( );
611 yv[0] = y_range.
low( );
612 for(
int i = 1;
i < 100;
i++)
614 xv[
i] = xv[
i-1] + ( x_range.
high() - x_range.
low() )/99;
621 xv[0] = x_range.
high( );
622 yv[0] = y_range.
low( );
623 for(
int i = 1;
i < 100;
i++)
626 yv[
i] = yv[
i-1] + ( y_range.
high() - y_range.
low() )/99; ;
632 xv[0] = x_range.
low( );
633 yv[0] = y_range.
high( );
634 for(
int i = 1;
i < 100;
i++)
636 xv[
i] = xv[
i-1] + ( x_range.
high() - x_range.
low() )/99;
644 xv[0] = x_range.
low( );
645 yv[0] = y_range.
low( );
646 for(
int i = 1;
i < 100;
i++)
649 yv[
i] = yv[
i-1] + ( y_range.
high() - y_range.
low() )/99;
669 const vector< AxisTick > & x_ticks = axisModelX.
getTicks();
670 const vector< AxisTick > & y_ticks = axisModelY.
getTicks();
672 unsigned int nxpoints = 100;
673 unsigned int nypoints = 100;
674 vector< double > xv(100), yv(100);
676 double user_x, user_y;
677 Color grey( 180, 180, 180 );
684 if ( x_ticks.empty () ==
true || y_ticks.empty () == true )
688 double dx = ( x_range.
high() - x_range.
low() ) / ( nxpoints - 1 );
689 double dy = ( y_range.
high() - y_range.
low() ) / ( nypoints - 1 ) ;
695 for (
unsigned int i = ( x_range.
low() == x_ticks[0].value() )?1:0;
696 i < x_ticks.size();
i++ )
698 user_x = x_ticks[
i ].value();
700 for (
unsigned int j = 0; j < nypoints; j++ )
702 user_y = y_range.
low() + j * dy;
718 for (
unsigned int j = ( y_range.
low() == y_ticks[0].value() )?1:0;
719 j < y_ticks.size(); j++ )
721 user_y = y_ticks[ j ].value();
723 for (
unsigned int i = 0;
i < nxpoints;
i++ )
725 user_x = x_range.
low() +
i * dx;
749 const vector< AxisTick > & ticks = axisModelX.
getTicks();
750 if ( ticks.empty() == true )
return;
755 unsigned int size = 4 * ticks.size();
763 double tick_length = 0.05 * view_rect.
getHeight();
764 tick_length = min ( tick_length, 8. );
767 for (
unsigned int i = 0;
i < ticks.size();
i++ )
769 double user_x_start = ticks[
i].value ();
770 double user_x_temp = user_x_start;
772 double user_by_start = yrange.
low();
773 double user_ty_start = yrange.
high();
776 t.
transform ( user_x_start, user_by_start );
777 t.
transform ( user_x_temp, user_ty_start );
780 double view_by_start = view.
userToDrawY ( user_by_start );
781 double view_ty_start = view.
userToDrawY ( user_ty_start );
783 double view_x_end = view_x_start;
784 double view_by_end = view_by_start - tick_length;
785 double view_ty_end = view_ty_start + tick_length;
788 if( isfinite( view_x_start ) &&
789 isfinite( view_by_start ) &&
790 isfinite( view_ty_start ) &&
791 isfinite( view_x_start ) &&
792 isfinite( view_by_end ) )
794 if( finite( view_x_start ) &&
795 finite( view_by_start ) &&
796 finite( view_ty_start ) &&
797 finite( view_x_start ) &&
798 finite( view_by_end ) )
801 xv.push_back( view_x_start );
802 yv.push_back( view_by_start );
803 xv.push_back( view_x_end );
804 yv.push_back( view_by_end );
806 xv.push_back( view_x_start );
807 yv.push_back( view_ty_start );
808 xv.push_back( view_x_end );
809 yv.push_back( view_ty_end );
829 double tick_length = 0.05 * draw_rect.
getWidth ();
830 tick_length = min ( tick_length, 8. );
835 const vector< AxisTick > & ticks = axisModelY.
getTicks ();
836 unsigned int size = ticks.size ();
838 if ( size == 0 )
return;
850 for (
unsigned int i = 0;
i < ticks.size();
i++ )
852 double user_lx_start = xrange.
low();
853 double user_rx_start = xrange.
high();
854 double user_y_start = ticks[
i].value();
855 double user_y_temp = user_y_start;
858 t.
transform( user_lx_start, user_y_start );
859 t.
transform( user_rx_start, user_y_temp );
861 double view_lx_start = view.
userToDrawX( user_lx_start );
862 double view_rx_start = view.
userToDrawX( user_rx_start );
863 double view_y_start = view.
userToDrawY( user_y_start );
865 double view_lx_end = view_lx_start + tick_length;
866 double view_rx_end = view_rx_start - tick_length;
867 double view_y_end = view_y_start;
870 if( isfinite( view_lx_start ) &&
871 isfinite( view_y_start ) &&
872 isfinite( view_lx_start ) &&
873 isfinite( view_y_end ) )
875 if( finite( view_lx_start ) &&
876 finite( view_y_start ) &&
877 finite( view_lx_start ) &&
878 finite( view_y_end ) )
881 xv.push_back( view_lx_start );
882 yv.push_back( view_y_start );
883 xv.push_back( view_lx_end );
884 yv.push_back( view_y_end );
886 xv.push_back( view_rx_start );
887 yv.push_back( view_y_start );
888 xv.push_back( view_rx_end );
889 yv.push_back( view_y_end );
911 if ( zAxisModel != 0 )
setZFontSize ( *zAxisModel, view );
921 double padding = 1.0;
923 vector < double > xv;
924 vector < double > yv;
926 const vector < AxisTick > & ticks = axisModelX.
getTicks ();
927 unsigned int size = ticks.size ();
928 if ( size == 0 )
return;
935 for (
unsigned int i = 0;
i <
size;
i++ ){
936 xv.push_back ( ticks[
i].value () );
937 yv.push_back ( yrange.
low() );
947 float y = margin.
getY ();
952 y = margin.getY () + margin.getHeight ();
960 int mid = ticks.size()/2;
961 ref = ticks[mid].value();
962 double range = ticks[mid+1].value()-ref;
964 sprintf(cstr,
"%.0e", range);
966 string::size_type pos = str.find (
'e' );
967 mag=string( str, pos + 1 );
970 for (
unsigned int i = 0;
i < ticks.size();
i++ )
975 double user_x_start = ticks[
i].value();
976 double user_y_start = yrange.
low();
978 t.
transform( user_x_start, user_y_start );
981 double view_y_start = view.
userToDrawY( user_y_start );
983 double user_x_end = ticks[
i].value ();
985 yrange.
low() + .05 * ( yrange.
high() - yrange.
low() );
990 double view_y_end = view.
userToDrawY( user_y_end );
993 double dx = view_x_end - view_x_start;
994 double dy = view_y_end - view_y_start;
996 double ux = dx / sqrt( dx * dx + dy * dy );
997 double uy = dy / sqrt ( dx * dx + dy * dy );
1002 x = view_x_start - ux * padding;
1003 y = view_y_start - uy * padding;
1008 double diff=ticks[
i].value()-ref;
1011 sprintf(pstr,
"%.0e", diff);
1012 const std::string str(pstr);
1013 string::size_type pos = str.find (
'e' );
1014 string m ( str, 0, pos );
1015 string e ( str, pos + 1 );
1017 if (e!=mag && m!=
"0") m+=
"0";
1036 if ( axisModelX.
isLog () == false ) {
1049 double padding = 2.0;
1051 const vector< AxisTick > & ticks = axisModelY.
getTicks ();
1052 unsigned int size = ticks.size ();
1053 if ( size == 0 )
return;
1064 int mid = ticks.size()/2;
1065 ref = ticks[mid].value();
1066 double range = ticks[mid+1].value()-ref;
1068 sprintf(cstr,
"%.0e", range);
1070 string::size_type pos = str.find (
'e' );
1071 mag=string( str, pos + 1 );
1074 for (
unsigned int i = 0;
i < ticks.size();
i++ )
1079 double user_x_start = xrange.
low();
1080 double user_y_start = ticks[
i].value();
1082 t.
transform( user_x_start, user_y_start );
1084 double view_x_start = view.
userToDrawX( user_x_start );
1085 double view_y_start = view.
userToDrawY( user_y_start );
1088 = xrange.
low() + .05 * ( xrange.
high() - xrange.
low() );
1089 double user_y_end = ticks[
i].value ();
1093 double view_x_end = view.
userToDrawX( user_x_end );
1094 double view_y_end = view.
userToDrawY( user_y_end );
1097 double dx = view_x_end - view_x_start;
1098 double dy = view_y_end - view_y_start;
1100 double ux = dx / sqrt( dx * dx + dy * dy );
1101 double uy = dy / sqrt ( dx * dx + dy * dy );
1106 float x = view_x_start - ux * padding;
1107 float y = view_y_start - uy * 1.5;
1112 double diff=ticks[
i].value()-ref;
1115 sprintf(pstr,
"%.0e", diff);
1116 const std::string str(pstr);
1117 string::size_type pos = str.find (
'e' );
1118 string m ( str, 0, pos );
1119 string e ( str, pos + 1 );
1121 if (e!=mag && m!=
"0") m+=
"0";
1136 else if ( axisModelY.
needPMag () ){
1138 if ( axisModelY.
isLog () == false ) {
1153 string::size_type pos = label.find (
'e' );
1154 if ( pos == string::npos ) {
1158 double ss_size = 0.9 * font_size;
1159 string m ( label, 0, pos );
1160 string e ( label, pos + 1 );
1163 x += 0.25 * font_size;
1164 y += 0.25 * ss_size;
1165 view.
drawText ( m, x, y, font_size, angle,
'r', yalign );
1167 if ( e[0] ==
'-' ) {
1168 x -= 0.10 * font_size;
1171 view.
drawText ( e, x, y, ss_size, angle,
'l', yalign );
1175 x += 0.25 * font_size;
1176 y += 0.25 * ss_size;
1177 view.
drawText ( m, x, y, font_size, angle,
'r', yalign );
1179 if ( e[0] ==
'-' ) {
1180 x -= 0.10 * font_size;
1183 view.
drawText ( e, x, y, ss_size, angle,
'l', yalign );
1200 string::size_type pos = label.find (
'e' );
1201 if ( pos == string::npos ) {
1202 view.
drawText ( label, x, y, font_size, angle, xalign, yalign );
1206 string m ( label, 0, pos );
1207 string e ( label, pos + 1 );
1211 x = x - 0.40 * font_size * e.size();
1212 view.
drawText ( m, x, y, font_size, angle, xalign, yalign );
1214 if ( e[0] ==
'-' ) {
1215 x -= 0.20 * font_size;
1217 y = y - 0.625 * font_size;
1218 view.
drawText ( e, x, y, 0.9 * font_size, angle,
'l', yalign );
1222 x = x - 0.40 * font_size * e.size();
1223 view.
drawText (m, x, y, font_size, angle, xalign, yalign );
1225 if ( e[0] ==
'-' ) {
1226 x -= 0.20 * font_size;
1228 y = y - 0.625 * font_size;
1229 view.
drawText ( e, x, y, 0.9 * font_size, angle,
'l', yalign );
1238 const std::vector < float > & xv,
1239 const std::vector < float> & yv,
1247 const string & alabel = ticks[0].content();
1248 string::size_type pos = alabel.find (
'e' );
1249 bool sci_notate = pos != string::npos;
1251 if ( sci_notate ==
false ) {
1252 for (
unsigned int i = 0;
i < ticks.size();
i++ ) {
1253 view.
drawText ( ticks[
i].content(), xv[
i], yv[i],
1254 font_size, angle, xalign, yalign );
1258 bool mixed_m =
false;
1259 for (
unsigned int i = 0;
i < ticks.size ();
i++ ) {
1260 const string & label = ticks[
i].content ();
1261 string m ( label, 0, pos );
1262 string e ( label, pos + 1 );
1263 mixed_m |= m !=
"1";
1265 if ( mixed_m ==
true ) {
1268 for (
unsigned int i = 0;
i < ticks.size ();
i++ ) {
1269 const string & label = ticks[
i].content();
1270 string::size_type pos = alabel.find (
'e' );
1271 string m ( label, 0, pos );
1272 string e ( label, pos + 1 );
1275 float x = xv[
i] - 0.40 * font_size * e.size();
1276 view.
drawText ( m, x, yv[
i], font_size, angle, xalign, yalign );
1278 if ( e[0] ==
'-' ) {
1279 x -= 0.20 * font_size;
1281 float y = yv[
i] - 0.625 * font_size;
1282 view.
drawText ( e, x, y, 0.9 * font_size, angle,
'l', yalign );
1286 float x = xv[
i] - 0.40 * font_size * e.size();
1287 view.
drawText (m, x, yv[
i], font_size, angle, xalign, yalign );
1289 if ( e[0] ==
'-' ) {
1290 x -= 0.20 * font_size;
1292 float y = yv[
i] - 0.625 * font_size;
1293 view.
drawText ( e, x, y, 0.9 * font_size, angle,
'l', yalign );
1306 vector < double > xv ( 4 );
1307 vector < double > yv ( 4 );
1318 double xoffset = tp.
xOffset();
1319 double yoffset = tp.
yOffset();
1340 Color grey ( 180, 180, 180 );
1374 assert( font != 0 );
1392 assert( font != 0 );
1410 assert( font != 0 );
1427 assert( font != 0 );
double m_z_font_size
Font size for the Z axis label.
bool m_draw_titles
The following flag indicates whether the titles have to be drawn or not.
double m_x_tick_font_size
Font size for the x tick labels.
float m_axis_x_origin
The x coordinate of the origin of the coordinate system.
double high() const
Returns the maximum of the range object.
void initAxisRect(ViewBase &view)
Gets the sizes of the two rectangles (the rectangles of the drawing on the screen) memorized by the V...
A class to maintain tick coordinates and string values.
double m_y_font_size
Font size for the Y axis label.
double m_font_size
Font size for the tick labels.
double getHeight() const
A shortcut to get size.height.
A transform that transforms coordinates from one coordinate system to another.
double m_x_font_size
Font size for X axis label.
The base class for the value to the color transformation.
virtual void drawLatex(const std::string &eq, int position=0)
Draws a Latex equation.
size_t ci_find(const string &str1, const string &str2)
Case insensitive find.
virtual void transform(double &x, double &y) const =0
Transform the coordinates on the X and Y axes.
void setYFontSize(const AxisModelBase &axis_model, ViewBase &view)
Calculates the font size for the y axis.
void drawYLabels(const AxisModelBase &axis_model, ViewBase &view, const std::string &y_label)
Draws the labels of the y axis.
hippodraw::PeriodicBinaryTransform class interface
float m_axis_y_origin
The y coordinate of the origin of the coordinate system.
virtual void drawAllYTicks(const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
This function is the principal function of the ticks drawing family because it draws the ticks on the...
double yOffset() const
Returns the yOffset of the (periodic) transform.
void drawYTickLabels(const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
Draws the labels for the Y ticks.
void setZLabelFont(FontBase *font)
Set the font to be used to override the default while drawing Z label.
void beginPlot(ViewBase &view)
Every class which draws has its beginPlot function.
double xOffset() const
Returns the xOffset of the (periodic) transform.
void setDrawTitles(bool set)
Sets the m_draw_titles flag to the set value.
virtual void drawTitle(ViewBase &view, const std::string &title)
Draws the title.
void drawYMag(const AxisModelBase &axisModel, ViewBase &view, const std::string &mag="")
Draws the Y magnitude label.
hippodraw::AxisRepBase class interface
virtual void drawColorScale(const BinToColor &, ViewBase &)
Draws the color scale bar.
virtual Rect getDrawRect() const =0
Returns the drawing Rectangle in the devices coordinate system.
virtual void drawAllXTicks(const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
This function is the principal function of the ticks drawing family because it draws the ticks on the...
virtual bool needPMag() const
The following functions are used by the AxisRepBase * object.
void drawXTickLines(const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
Draws the X tick lines.
virtual void drawGridLines(const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, TransformBase &transform, ViewBase &view)
Draws the grid lines after transformation.
void drawYTickLines(const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
Draws the Y tick lines.
FontBase * m_xLabelFont
The font to be used to for the X label overriding the default font.
void drawXTickLabels(const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
Draws the labels for the X ticks.
virtual void drawCrossHairs(double x, double y, TransformBase &transform, ViewBase &view)
Draws the cross hairs after transformation.
The namespace for conversion to string.
FontBase * zLabelFont()
What font is being used to override the default while drawing Z label.
double getWidth() const
A shortcut to get size.width.
virtual void drawViewLines(const std::vector< double > &x, const std::vector< double > &y, Line::Style style, bool color, float size)=0
Draws multiple line segments.
virtual void drawAxesLines(TransformBase &transform, ViewBase &view, const Range &x_range, const Range &y_range)
Draws the axes lines after transformation.
A abstract base class for font handling.
virtual float userToDrawX(double x) const =0
Converts a coordinate in user space to drawing space along the X axis.
void drawXMag(const AxisModelBase &axisModel, ViewBase &view, const std::string &mag="")
Draws the X magnitude label.
The abstract base class for views that have a region for drawing data points with area around it for ...
A Color class for creating the color object following the standard RGB color space.
void drawXLabels(const AxisModelBase &axis_model, ViewBase &view, const std::string &x_label)
Draws the labels of the x axis.
A Periodic transform that transforms coordinates from one 2D coordinate system to another...
double moduloSubY(double y1, double y2) const
Modulo Subtraction along Y axis.
void setXFontSize(const AxisModelBase &axis_model, ViewBase &view)
Calculates the font size for the x axis.
AxisLoc
The base class for the binner hierarchy.
FontBase * m_zLabelFont
The font to be used to for the Z label overriding the default font.
void setYLabelFont(FontBase *font)
Set the font to be used to override the default while drawing Y label.
FontBase * yLabelFont()
What font is being used to override the default while drawing Y label.
hippodraw::DataView class interface
virtual void validate(Range &x, Range &y) const =0
Validates the Ranges.
AxisLoc getScaleLocation() const
intp size(numeric::array arr)
string convert(int i)
Converts an integer to a string.
virtual void drawLines(const std::vector< double > &x, const std::vector< double > &y, Line::Style style, const Color &color, float size)=0
Draws multiple line segments - that is, a line between x0,y0 and x1,y2, another between x2...
The AxisModelBase class maintains the Range and scaling of an axis.
void setTitleFont(FontBase *font)
Set the font to be used to override the default while drawing title.
void drawXTickLabel(const std::string &label, float x, float y, ViewBase &view)
Draws a tick label for X axis.
Class representing a rectangle.
virtual float userToDrawY(double y) const =0
Converts a coordinate in user space to drawing space along the Y axis.
FontBase * m_yLabelFont
The font to be used to for the Y label overriding the default font.
virtual float userToDrawXAutoInv(double x) const =0
void drawReferencePoint(const AxisModelBase &axisModel, ViewBase &base, const std::string &ref)
Draw the reference point for X or Y axis.
virtual bool isLog() const =0
Returns a boolean describing the type of the scale of the axis.
virtual void setFontSize(const AxisModelBase *x_axis, const AxisModelBase *y_axis, const AxisModelBase *z_axis, ViewBase &view)
Adjusts the font sizes.
The base class for the axis representation hierarchy.
double m_y_tick_font_size
Font size for the y tick labels.
virtual ~AxisRepBase()
The virtual destructor.
AxisLoc getLabelLocation() const
The abstract base class for views.
const std::vector< AxisTick > & getTicks() const
Returns a reference of generated ticks.
hippodraw::AxisModelBase class interface
void setXLabelFont(FontBase *font)
Set the font to be used to override the default while drawing X label.
virtual void drawText(const std::string &s, float x, float y, float fontsize, float angle=0.0, char xp= 'l', char yp= 't', bool resize=false, const FontBase *font=0, const Color *color=0)=0
Draws a text string at a point in the view's coordinate system.
float m_axis_width
The width of the rectangle in which the drawing is made.
double moduloSubX(double x1, double x2) const
Modulo Subtraction along X axis.
double getPMag() const
Returns the magnitude of the power of ten for the tick labels.
double getX() const
A shortcut to get origin.X.
const Rect & getUserRect() const
Is called by the AxisRepBase object (or one of its derived objects), and returns the rectangle where ...
A transform that transforms coordinates from one 2D coordinate system to another. ...
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
FontBase * titleFont()
What font is being used to override the default while drawing title of plot.
const Rect & getMarginRect() const
Returns the rectangle area in which data points are drawn.
double low() const
Returns the minimum of the range object.
void setZFontSize(const AxisModelBase &axis_model, ViewBase &view)
Calculates the font size for the z axis, if any.
const std::string & content() const
Returns the content at the coordinate.
virtual int pointSize() const =0
Get the pointsize of the font.
Expresses a range of values.
virtual void drawPolyLine(const std::vector< double > &xpoints, const std::vector< double > &ypoints, Line::Style style, const Color &color, float size)=0
Draws a polyline.
FontBase * xLabelFont()
What font is being used to override the default while drawing X label.
float m_axis_height
The height of the rectangle in which the drawing is made.
bool isPeriodic() const
Sets whether this transform is periodic.
void drawYTickLabel(const std::string &label, float x, float y, ViewBase &view)
Draws the tick label for Y axis.
AxisRepBase()
The default constructor.
double getY() const
A shortcut to get origin.Y.
FontBase * m_titleFont
The font to be used to for the Z label overriding the default font.