14 #include "msdevstudio/MSconfig.h" 46 m_axis_z_origin( 0.0 ),
85 const std::string & z_label )
92 string tex_snippet = z_label.substr(4);
101 float mx = margin_rect.
getX ();
103 float my = margin_rect.
getY ();
106 float y_font_size = ( dh - mh ) / 2 * 0.20;
107 float x_font_size = ( mw * 2 ) / z_label.size() * 2 / 3;
111 float x = mx + 0.5 * mw;
120 view.
drawText ( z_label, x, y, 0.0, 0.0,
'c',
'b',
142 const vector< AxisTick > & ticks = axisModel.
getTicks ();
143 if ( ticks.empty() )
return;
148 unsigned int size = 2 * ticks.size ();
156 double tick_length = 5;
157 double y_base = view_rect.
getY() - 24;
159 for (
unsigned int i = 0; i < ticks.size(); i++ ) {
160 double user_z = ticks[i].value ();
167 xv.push_back ( view_x );
168 yv.push_back ( y_base );
169 xv.push_back ( view_x );
170 yv.push_back ( y_base + tick_length );
182 vector < double > xv;
183 vector < double > yv;
185 const vector< AxisTick > & ticks = axisModel.
getTicks ();
186 unsigned int size = ticks.size ();
187 if ( size == 0 )
return;
196 for ( ; i <
size; i++ ) {
197 double value = ticks[i].value ();
199 xv.push_back ( value );
200 yv.push_back ( 1.0 );
207 float y = margin.
getY() - 42;
210 for ( ; i <
size; i++ ) {
217 if ( !(axisModel.
isLog() ) ) {
219 float xx = margin_rect.
getX()
224 double mag = axisModel.
getPMag ();
225 int i = static_cast <
int > ( mag );
244 double y_base = margin.
getY() - 22;
247 double value = range.
low ();
252 for (
float i = 0; i <= margin.
getWidth() ; i++ ) {
254 const Color & rep_color = plotter->repColor();
256 Color color = rep_color;
261 margin.
getX() + i + 1.0,
double m_z_font_size
Font size for the Z axis label.
virtual Rect getDrawRect() const =0
Returns the drawing Rectangle in the devices coordinate system.
AxisTick class interface.
double m_y_font_size
Font size for the Y axis label.
void transformZ(double &z) const
Transforms the z coordinate.
double getHeight() const
A shortcut to get size.height.
A transform that transforms coordinates from one coordinate system to another.
float ZPADDING(ViewBase &view)
The base class for the value to the color transformation.
virtual void drawLatex(const std::string &eq, int position=0)
Draws a Latex equation.
string convert(int i)
Converts an integer to a string.
virtual float userToDrawColor(double c) const =0
Converts a coordinate in user space to drawing space along the color (X) axis.
virtual int pointSize() const =0
Get the pointsize of the font.
float m_axis_z_origin
The z coordinate of the origin of the coordinate system.
Range getRange() const
Get the Range of expected values.
The namespace for conversion to string.
virtual bool needPMag() const
The following functions are used by the AxisRepBase * object.
void drawZTickLines(const AxisModelBase &axisModel, const TransformBase &transform, ViewBase &view)
Draws the Z tick lines.
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.
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.
virtual void drawViewSquare(float x1, float y1, float x2, float y2, int red, int green, int blue)=0
Draws a colored square in view space.
The class for the 2D axes drawing with color.
float XPADDING(ViewBase &view)
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).
The base class for the PlotterBase hierarchy.
PlotterBase * getPlotter() const
Returns the plotter used by this view.
FontBase * m_zLabelFont
The font to be used to for the Z label overriding the default font.
float m_axis_depth
The depth of the rectangle in which the drawing is made.
size_t ci_find(const string &str1, const string &str2)
Case insensitive find.
The AxisModelBase class maintains the Range and scaling of an axis.
double length() const
Returns the length of the range object.
void drawXTickLabel(const std::string &label, float x, float y, ViewBase &view)
Draws a tick label for X axis.
Class representing a rectangle.
hippodraw::AxisRepColor class interface
The base class for the axis representation hierarchy.
double m_y_tick_font_size
Font size for the y tick labels.
hippodraw::AxisModelBase class interface
AxisLoc getLabelLocation() const
The abstract base class for views.
virtual void drawColorScale(const BinToColor &, ViewBase &)
Draws the color scale bar.
const std::vector< AxisTick > & getTicks() const
Returns a reference of generated ticks.
AxisRepBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
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.
hippodraw::PlotterBase class interface.
double getPMag() const
Returns the magnitude of the power of ten for the tick labels.
double getX() const
A shortcut to get origin.X.
A transform that transforms coordinates from one 2D coordinate system to another. ...
void drawZLabels(const AxisModelBase &axis_model, ViewBase &view, const std::string &z_label)
Draws the labels of the z axis.
const Rect & getMarginRect() const
Returns the rectangle area in which data points are drawn.
double low() const
Returns the minimum of the range object.
hippodraw::BinToColor class interface
AxisLoc
The base class for the binner hierarchy.
intp size(numeric::array arr)
void drawZTickLabels(const AxisModelBase &axisModel, const TransformBase &transform, ViewBase &view)
Draws the labels for the Z ticks.
Expresses a range of values.
hippodraw::DataView class interface
hippodraw::BinaryTransform class interface
AxisRepColor()
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.
virtual void doubleToColor(double value, Color &color) const =0
This function does the actual calculation that transforms the given value into a color using the curr...
float YPADDING(ViewBase &view)
virtual bool isLog() const =0
Returns a boolean describing the type of the scale of the axis.