Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
AxisRepColor Class Reference

The class for the 2D axes drawing with color. More...

#include <AxisRepColor.h>

Inheritance diagram for AxisRepColor:
Inheritance graph
[legend]
Collaboration diagram for AxisRepColor:
Collaboration graph
[legend]

Public Member Functions

 AxisRepColor ()
 The default constructor.
 AxisRepColor (const AxisRepColor &axis_rep)
 The copy constructor.
void beginPlot (ViewBase &view)
 Every class which draws has its beginPlot function.
AxisRepBaseclone ()
 The clone function returns an object of its own kind which is a copy of this object at this moment.
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 X axis by calling the required functions.
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 Y axis by calling the required functions.
void drawAllZTicks (const AxisModelBase &axis_model, const TransformBase &transform, ViewBase &view)
 Takes care of the z ticks drawing (that is, the ticks on the top of the plot).
virtual void drawAxesLines (TransformBase &transform, ViewBase &view, const Range &x_range, const Range &y_range)
 Draws the axes lines after transformation.
virtual void drawCrossHairs (double x, double y, TransformBase &transform, ViewBase &view)
 Draws the cross hairs after transformation.
virtual void drawGridLines (const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, TransformBase &transform, ViewBase &view)
 Draws the grid lines after transformation.
void drawReferencePoint (const AxisModelBase &axisModel, ViewBase &base, const std::string &ref)
 Draw the reference point for X or Y axis.
virtual void drawTitle (ViewBase &view, const std::string &title)
 Draws the title.
void drawXLabels (const AxisModelBase &axis_model, ViewBase &view, const std::string &x_label)
 Draws the labels of the x axis.
void drawXMag (const AxisModelBase &axisModel, ViewBase &view, const std::string &mag="")
 Draws the X magnitude label.
void drawYLabels (const AxisModelBase &axis_model, ViewBase &view, const std::string &y_label)
 Draws the labels of the y axis.
void drawYMag (const AxisModelBase &axisModel, ViewBase &view, const std::string &mag="")
 Draws the Y magnitude label.
void drawZLabels (const AxisModelBase &axis_model, ViewBase &view, const std::string &z_label)
 Draws the labels of the z axis.
void setDrawTitles (bool set)
 Sets the m_draw_titles flag to the set value.
virtual void setFontSize (const AxisModelBase *x_axis, const AxisModelBase *y_axis, const AxisModelBase *z_axis, ViewBase &view)
 Adjusts the font sizes.
void setTitleFont (FontBase *font)
 Set the font to be used to override the default while drawing title.
void setXFontSize (const AxisModelBase &axis_model, ViewBase &view)
 Calculates the font size for the x axis.
void setXLabelFont (FontBase *font)
 Set the font to be used to override the default while drawing X label.
void setYFontSize (const AxisModelBase &axis_model, ViewBase &view)
 Calculates the font size for the y axis.
void setYLabelFont (FontBase *font)
 Set the font to be used to override the default while drawing Y label.
void setZFontSize (const AxisModelBase &axis_model, ViewBase &view)
 Calculates the font size for the z axis, if any.
void setZLabelFont (FontBase *font)
 Set the font to be used to override the default while drawing Z label.
FontBasetitleFont ()
 What font is being used to override the default while drawing title of plot.
FontBasexLabelFont ()
 What font is being used to override the default while drawing X label.
FontBaseyLabelFont ()
 What font is being used to override the default while drawing Y label.
FontBasezLabelFont ()
 What font is being used to override the default while drawing Z label.

Protected Member Functions

void drawXTickLabel (const std::string &label, float x, float y, ViewBase &view)
 Draws a tick label for X axis.
void drawXTickLabels (const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
 Draws the labels for the X ticks.
void drawXTickLines (const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
 Draws the X tick lines.
void drawYTickLabel (const std::string &label, float x, float y, ViewBase &view)
 Draws the tick label for Y axis.
void drawYTickLabels (const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
 Draws the labels for the Y ticks.
void drawYTickLabels (const std::vector< AxisTick > &ticks, const std::vector< float > &xv, const std::vector< float > &yv, ViewBase &view)
 Draws the tick labels for Y axis.
void drawYTickLines (const AxisModelBase &axisModelX, const AxisModelBase &axisModelY, const TransformBase &transform, ViewBase &view)
 Draws the Y tick lines.
void initAxisRect (ViewBase &view)
 Gets the sizes of the two rectangles (the rectangles of the drawing on the screen) memorized by the ViewBase object, and initializes the m_axis_x_origin, m_axis_y_origin, m_axis_width, and m_axis_height fields.

Protected Attributes

float m_axis_depth
 The depth of the rectangle in which the drawing is made.
float m_axis_height
 The height of the rectangle in which the drawing is made.
float m_axis_width
 The width of the rectangle in which the drawing is made.
float m_axis_x_origin
 The x coordinate of the origin of the coordinate system.
float m_axis_y_origin
 The y coordinate of the origin of the coordinate system.
float m_axis_z_origin
 The z coordinate of the origin of the coordinate system.
bool m_draw_titles
 The following flag indicates whether the titles have to be drawn or not.
double m_font_size
 Font size for the tick labels.
bool m_sci_note_x
bool m_sci_note_y
FontBasem_titleFont
 The font to be used to for the Z label overriding the default font.
double m_x_font_size
 Font size for X axis label.
double m_x_tick_font_size
 Font size for the x tick labels.
FontBasem_xLabelFont
 The font to be used to for the X label overriding the default font.
double m_y_font_size
 Font size for the Y axis label.
double m_y_tick_font_size
 Font size for the y tick labels.
FontBasem_yLabelFont
 The font to be used to for the Y label overriding the default font.
double m_z_font_size
 Font size for the Z axis label.
FontBasem_zLabelFont
 The font to be used to for the Z label overriding the default font.

Private Member Functions

virtual void drawColorScale (const BinToColor &, ViewBase &)
 Draws the color scale bar.
void drawZTickLabels (const AxisModelBase &axisModel, const TransformBase &transform, ViewBase &view)
 Draws the labels for the Z ticks.
void drawZTickLines (const AxisModelBase &axisModel, const TransformBase &transform, ViewBase &view)
 Draws the Z tick lines.

Detailed Description

The class for the 2D axes drawing with color.

This class uses the information kept by the AxisModelBase hierarchy objects. It communicates with the ViewBase hierarchy objects in order to get the information of the actual display. It is, therefore, carrying out adequate calculations of fonts and positions for drawing in good proportions to the axes, their labels, and the main title.

Author
Kaustuv kaust.nosp@m.uv@s.nosp@m.tanfo.nosp@m.rd.e.nosp@m.du
Sanket B. Malde sanke.nosp@m.t@st.nosp@m.anfor.nosp@m.d.ed.nosp@m.u
Oded Wurman owurm.nosp@m.an@s.nosp@m.tanfo.nosp@m.rd.e.nosp@m.du
Tao Xu taox@.nosp@m.stan.nosp@m.ford..nosp@m.edu
Todo:
Implement minor ticks.

Definition at line 38 of file AxisRepColor.h.

Constructor & Destructor Documentation

The default constructor.

Definition at line 44 of file AxisRepColor.cxx.

Referenced by AxisRepColor::clone().

AxisRepColor ( const AxisRepColor axis_rep)

The copy constructor.

Definition at line 51 of file AxisRepColor.cxx.

Member Function Documentation

void beginPlot ( ViewBase view)
inherited

Every class which draws has its beginPlot function.

It initializes the data that it requires. (For example, it might get the size of the actual drawing on the screen in order to set the good font size of the writing, etc...).

Definition at line 106 of file AxisRepBase.cxx.

References AxisRepBase::initAxisRect().

Referenced by XyPlotter::drawIn().

AxisRepBase * clone ( )
virtual

The clone function returns an object of its own kind which is a copy of this object at this moment.

Implements AxisRepBase.

Definition at line 58 of file AxisRepColor.cxx.

References AxisRepColor::AxisRepColor().

void drawAllXTicks ( const AxisModelBase axisModelX,
const AxisModelBase axisModelY,
const TransformBase transform,
ViewBase view 
)
virtualinherited

This function is the principal function of the ticks drawing family because it draws the ticks on the X axis by calling the required functions.

Todo:
Draw lines connecting ticks top and bottom. Line should under go transform which might be curved, thus should use something like the function projector.

Definition at line 1352 of file AxisRepBase.cxx.

References AxisRepBase::drawXTickLabels(), and AxisRepBase::drawXTickLines().

Referenced by CompositePlotter::drawAxisRep().

void drawAllYTicks ( const AxisModelBase axisModelX,
const AxisModelBase axisModelY,
const TransformBase transform,
ViewBase view 
)
virtualinherited

This function is the principal function of the ticks drawing family because it draws the ticks on the Y axis by calling the required functions.

Definition at line 1363 of file AxisRepBase.cxx.

References AxisRepBase::drawYTickLabels(), and AxisRepBase::drawYTickLines().

Referenced by CompositePlotter::drawAxisRep().

void drawAllZTicks ( const AxisModelBase axis_model,
const TransformBase transform,
ViewBase view 
)
virtual

Takes care of the z ticks drawing (that is, the ticks on the top of the plot).

It also draws the labels of the ticks which are on the top of the plot.

Implements AxisRepBase.

Definition at line 127 of file AxisRepColor.cxx.

References AxisRepColor::drawZTickLabels(), and AxisRepColor::drawZTickLines().

void drawAxesLines ( TransformBase transform,
ViewBase view,
const Range x_range,
const Range y_range 
)
virtualinherited

Draws the axes lines after transformation.

This forms the rectangle in which the plot is drawn.

Definition at line 600 of file AxisRepBase.cxx.

References ViewBase::drawPolyLine(), Range::high(), Range::low(), hippodraw::Line::Solid, and BinaryTransform::transform().

Referenced by CompositePlotter::drawAxisRep().

void drawColorScale ( const BinToColor bin_to_color,
ViewBase base 
)
privatevirtual
void drawCrossHairs ( double  x,
double  y,
TransformBase transform,
ViewBase view 
)
virtualinherited
void drawGridLines ( const AxisModelBase axisModelX,
const AxisModelBase axisModelY,
TransformBase transform,
ViewBase view 
)
virtualinherited

Draws the grid lines after transformation.

This grids the enclosed region ( rectangle or ellipse ) in which the plot is drawn.

Definition at line 661 of file AxisRepBase.cxx.

References hippodraw::Line::Dot, ViewBase::drawPolyLine(), AxisModelBase::getRange(), AxisModelBase::getTicks(), Range::high(), Range::low(), BinaryTransform::transform(), and BinaryTransform::validate().

Referenced by CompositePlotter::drawAxisRep().

void drawReferencePoint ( const AxisModelBase axisModel,
ViewBase base,
const std::string &  ref 
)
inherited

Draw the reference point for X or Y axis.

This make sense when the range is small compared to the value. In this mode, we display the refenced point and the tick shows the difference from this point. TODO: Old interface. Already handled in drawXYLabels(). To be removed.

Definition at line 500 of file AxisRepBase.cxx.

References ViewBase::drawText(), ViewBase::getDrawRect(), Rect::getHeight(), DataView::getMarginRect(), AxisModelBase::getScaleLocation(), Rect::getX(), Rect::getY(), AxisRepBase::m_x_tick_font_size, AxisRepBase::m_y_tick_font_size, PLOTBOTTOM, and PLOTLEFT.

void drawTitle ( ViewBase view,
const std::string &  title 
)
virtualinherited
void drawXLabels ( const AxisModelBase axis_model,
ViewBase view,
const std::string &  x_label 
)
inherited
void drawXMag ( const AxisModelBase axisModel,
ViewBase view,
const std::string &  mag = "" 
)
inherited
void drawXTickLabel ( const std::string &  label,
float  x,
float  y,
ViewBase view 
)
protectedinherited

Draws a tick label for X axis.

Definition at line 1147 of file AxisRepBase.cxx.

References ViewBase::drawText(), and AxisRepBase::m_x_tick_font_size.

Referenced by AxisRepBase::drawXTickLabels(), and AxisRepColor::drawZTickLabels().

void drawXTickLabels ( const AxisModelBase axisModelX,
const AxisModelBase axisModelY,
const TransformBase transform,
ViewBase view 
)
protectedinherited
void drawXTickLines ( const AxisModelBase axisModelX,
const AxisModelBase axisModelY,
const TransformBase transform,
ViewBase view 
)
protectedinherited
void drawYLabels ( const AxisModelBase axis_model,
ViewBase view,
const std::string &  y_label 
)
inherited
void drawYMag ( const AxisModelBase axisModel,
ViewBase view,
const std::string &  mag = "" 
)
inherited
void drawYTickLabel ( const std::string &  label,
float  x,
float  y,
ViewBase view 
)
protectedinherited

Draws the tick label for Y axis.

Definition at line 1192 of file AxisRepBase.cxx.

References ViewBase::drawText(), and AxisRepBase::m_y_tick_font_size.

Referenced by AxisRepBase::drawYTickLabels().

void drawYTickLabels ( const AxisModelBase axisModelX,
const AxisModelBase axisModelY,
const TransformBase transform,
ViewBase view 
)
protectedinherited
void drawYTickLabels ( const std::vector< AxisTick > &  ticks,
const std::vector< float > &  xv,
const std::vector< float > &  yv,
ViewBase view 
)
protectedinherited

Draws the tick labels for Y axis.

TODO: Old interface, remove it.

Definition at line 1238 of file AxisRepBase.cxx.

References ViewBase::drawText(), and AxisRepBase::m_y_tick_font_size.

void drawYTickLines ( const AxisModelBase axisModelX,
const AxisModelBase axisModelY,
const TransformBase transform,
ViewBase view 
)
protectedinherited
void drawZLabels ( const AxisModelBase axis_model,
ViewBase base,
const std::string &  z_label 
)
virtual
void drawZTickLabels ( const AxisModelBase axisModel,
const TransformBase transform,
ViewBase view 
)
private
void drawZTickLines ( const AxisModelBase axisModel,
const TransformBase transform,
ViewBase view 
)
private
void initAxisRect ( ViewBase view)
protectedinherited

Gets the sizes of the two rectangles (the rectangles of the drawing on the screen) memorized by the ViewBase object, and initializes the m_axis_x_origin, m_axis_y_origin, m_axis_width, and m_axis_height fields.

Having the dimensions of the place where they will be drawn, the AxisRepBase object will then be able to calculate the adequate values of the different components of the drawing.

Definition at line 94 of file AxisRepBase.cxx.

References Rect::getHeight(), ViewBase::getUserRect(), Rect::getWidth(), Rect::getX(), Rect::getY(), AxisRepBase::m_axis_height, AxisRepBase::m_axis_width, AxisRepBase::m_axis_x_origin, and AxisRepBase::m_axis_y_origin.

Referenced by AxisRepBase::beginPlot().

void setDrawTitles ( bool  set)
inherited

Sets the m_draw_titles flag to the set value.

Definition at line 111 of file AxisRepBase.cxx.

References AxisRepBase::m_draw_titles.

void setFontSize ( const AxisModelBase x_axis,
const AxisModelBase y_axis,
const AxisModelBase z_axis,
ViewBase view 
)
virtualinherited

Adjusts the font sizes.

The font sizes are adjusted according to the size of the view on a canvas.

Definition at line 899 of file AxisRepBase.cxx.

References ViewBase::getDrawRect(), Rect::getWidth(), AxisRepBase::m_font_size, AxisRepBase::setXFontSize(), AxisRepBase::setYFontSize(), and AxisRepBase::setZFontSize().

Referenced by CompositePlotter::drawAxisRep().

void setTitleFont ( FontBase font)
inherited

Set the font to be used to override the default while drawing title.

Definition at line 1426 of file AxisRepBase.cxx.

References AxisRepBase::m_titleFont.

void setXFontSize ( const AxisModelBase axis_model,
ViewBase view 
)
inherited
void setXLabelFont ( FontBase font)
inherited

Set the font to be used to override the default while drawing X label.

Definition at line 1373 of file AxisRepBase.cxx.

References AxisRepBase::m_xLabelFont.

void setYFontSize ( const AxisModelBase axis_model,
ViewBase view 
)
inherited
void setYLabelFont ( FontBase font)
inherited

Set the font to be used to override the default while drawing Y label.

Definition at line 1391 of file AxisRepBase.cxx.

References AxisRepBase::m_yLabelFont.

void setZFontSize ( const AxisModelBase axis_model,
ViewBase view 
)
inherited
void setZLabelFont ( FontBase font)
inherited

Set the font to be used to override the default while drawing Z label.

Definition at line 1409 of file AxisRepBase.cxx.

References AxisRepBase::m_zLabelFont.

FontBase * titleFont ( )
inherited

What font is being used to override the default while drawing title of plot.

Definition at line 1438 of file AxisRepBase.cxx.

References AxisRepBase::m_titleFont.

FontBase * xLabelFont ( )
inherited

What font is being used to override the default while drawing X label.

Definition at line 1385 of file AxisRepBase.cxx.

References AxisRepBase::m_xLabelFont.

FontBase * yLabelFont ( )
inherited

What font is being used to override the default while drawing Y label.

Definition at line 1403 of file AxisRepBase.cxx.

References AxisRepBase::m_yLabelFont.

FontBase * zLabelFont ( )
inherited

What font is being used to override the default while drawing Z label.

Definition at line 1421 of file AxisRepBase.cxx.

References AxisRepBase::m_zLabelFont.

Member Data Documentation

float m_axis_depth
protected

The depth of the rectangle in which the drawing is made.

Definition at line 47 of file AxisRepColor.h.

float m_axis_height
protectedinherited

The height of the rectangle in which the drawing is made.

Definition at line 71 of file AxisRepBase.h.

Referenced by AxisRepBase::drawCrossHairs(), AxisRepBase::initAxisRect(), AxisRepBase::setXFontSize(), and AxisRepBase::setZFontSize().

float m_axis_width
protectedinherited

The width of the rectangle in which the drawing is made.

Definition at line 68 of file AxisRepBase.h.

Referenced by AxisRepBase::drawCrossHairs(), AxisRepBase::initAxisRect(), and AxisRepBase::setYFontSize().

float m_axis_x_origin
protectedinherited

The x coordinate of the origin of the coordinate system.

It is in fact the x coordinate of the lower left corner of the rectangle in which the drawing is made.

Definition at line 60 of file AxisRepBase.h.

Referenced by AxisRepBase::drawCrossHairs(), AxisRepBase::initAxisRect(), and AxisRepBase::setYFontSize().

float m_axis_y_origin
protectedinherited

The y coordinate of the origin of the coordinate system.

It is in fact the y coordinate of the lower left corner of the rectangle in which the drawing is made.

Definition at line 65 of file AxisRepBase.h.

Referenced by AxisRepBase::drawCrossHairs(), AxisRepBase::initAxisRect(), AxisRepBase::setXFontSize(), and AxisRepBase::setZFontSize().

float m_axis_z_origin
protected

The z coordinate of the origin of the coordinate system.

Definition at line 44 of file AxisRepColor.h.

bool m_draw_titles
protectedinherited

The following flag indicates whether the titles have to be drawn or not.

Definition at line 111 of file AxisRepBase.h.

Referenced by AxisRepBase::setDrawTitles(), and AxisRepBase::setYFontSize().

double m_font_size
protectedinherited

Font size for the tick labels.

Definition at line 75 of file AxisRepBase.h.

Referenced by AxisRepBase::drawTitle(), AxisRepBase::setFontSize(), and AxisRepBase::setZFontSize().

bool m_sci_note_x
protectedinherited
bool m_sci_note_y
protectedinherited
FontBase* m_titleFont
protectedinherited

The font to be used to for the Z label overriding the default font.

Definition at line 107 of file AxisRepBase.h.

Referenced by AxisRepBase::drawTitle(), AxisRepColor::drawZLabels(), AxisRepBase::setTitleFont(), AxisRepBase::titleFont(), and AxisRepBase::~AxisRepBase().

double m_x_font_size
protectedinherited

Font size for X axis label.

Definition at line 87 of file AxisRepBase.h.

Referenced by AxisRepBase::drawXLabels(), and AxisRepBase::setXFontSize().

double m_x_tick_font_size
protectedinherited

Font size for the x tick labels.

Definition at line 79 of file AxisRepBase.h.

Referenced by AxisRepBase::drawReferencePoint(), AxisRepBase::drawXMag(), AxisRepBase::drawXTickLabel(), and AxisRepBase::setXFontSize().

FontBase* m_xLabelFont
protectedinherited

The font to be used to for the X label overriding the default font.

Definition at line 98 of file AxisRepBase.h.

Referenced by AxisRepBase::drawXLabels(), AxisRepBase::setXLabelFont(), AxisRepBase::xLabelFont(), and AxisRepBase::~AxisRepBase().

double m_y_font_size
protectedinherited

Font size for the Y axis label.

Definition at line 91 of file AxisRepBase.h.

Referenced by AxisRepBase::drawYLabels(), AxisRepColor::drawZTickLabels(), and AxisRepBase::setYFontSize().

double m_y_tick_font_size
protectedinherited
FontBase* m_yLabelFont
protectedinherited

The font to be used to for the Y label overriding the default font.

Definition at line 101 of file AxisRepBase.h.

Referenced by AxisRepBase::drawYLabels(), AxisRepBase::setYLabelFont(), AxisRepBase::yLabelFont(), and AxisRepBase::~AxisRepBase().

double m_z_font_size
protectedinherited

Font size for the Z axis label.

Definition at line 95 of file AxisRepBase.h.

Referenced by AxisRepColor::drawZLabels(), and AxisRepBase::setZFontSize().

FontBase* m_zLabelFont
protectedinherited

The font to be used to for the Z label overriding the default font.

Definition at line 104 of file AxisRepBase.h.

Referenced by AxisRepColor::drawZLabels(), AxisRepBase::setZLabelFont(), AxisRepBase::zLabelFont(), and AxisRepBase::~AxisRepBase().


The documentation for this class was generated from the following files:

Generated for HippoDraw Class Library by doxygen