14 #include "msdevstudio/MSconfig.h"
23 using namespace hippodraw;
68 float marginXLeft = draw.
getHeight () * 0.20;
69 marginXLeft = std::min ( marginXLeft, 55.0f );
70 float marginXRight = 20.0 ;
76 float marginYTop = 30.0;
83 marginYTop = marginYTop+titlefont->
pointSize()-9.0;
87 marginYTop = marginYTop+zfont->
pointSize()-7.0;
91 float marginYBottom = 34.0 ;
94 marginYBottom = marginYBottom+labelfont->
pointSize()-11.0;
104 float marginWidth = width - marginXLeft - marginXRight;
105 float marginHeight =height - marginYTop - marginYBottom;
107 if ( aspect_ratio > 0.0 ) {
108 if ( marginWidth /aspect_ratio > marginHeight ){
109 marginWidth = aspect_ratio*marginHeight;
112 marginHeight = marginWidth/aspect_ratio;
117 marginWidth, marginHeight );
125 double diff = x - user_rect.
getX ();
136 double diff = x - user_rect.
getX ();
148 + ( y - user_rect.
getY () )
159 - ( y - user_rect.
getY () )
170 + ( c - user_rect.
getZ () )
180 return user_rect.
getX ()
191 return user_rect.
getX ()
202 return user_rect.
getY ()
213 return user_rect.
getY () +
virtual double marginToInvertedUserX(double x) const
Converts from view coordinate to data conordiate, take into account the inversion of x axes...
The abstract base class for views.
virtual float userToMarginX(double x) const
Converts the user X coordinate into the margin X coordinate.
double getHeight() const
A shortcut to get size.height.
virtual Rect getDrawRect() const =0
Returns the drawing Rectangle in the devices coordinate system.
FontBase class interface.
hippodraw::Range class interface
virtual double marginToUserX(double x) const
Converts from view coordinate to data coordinate, without taking into account transforms or scaling...
virtual double getLeftMargin()
hippodraw::PlotterBase class interface.
double getY() const
A shortcut to get origin.Y.
const Rect & getMarginRect() const
Returns the rectangle area in which data points are drawn.
virtual const FontBase * titleFont() const
What font is being used to override the default while drawing title of plot.
A abstract base class for font handling.
PlotterBase * getPlotter() const
Returns the plotter used by this view.
void prepareMarginRect()
Prepares the margin rectangle.
double getWidth() const
A shortcut to get size.width.
virtual float userToMarginColor(double c) const
Converts the user Z coordinate into the margin color (X) coordinate.
virtual FontBase * labelFont(Axes::Type axes) const
What font is being used to override the default while drawing axis label.
virtual double marginToUserY(double y) const
Converts from view coordinate to data coordinate, without taking into account transforms or scaling...
virtual float userToInvertedMarginX(double x) const
Converts the user X coordinate into the inverted X coordinate.
virtual double getAspectRatio() const
Get the aspect ratio.
double getDepth() const
A shortcut to get size.depth.
virtual double getTopMargin()
PlotterBase * m_plotter
The plotter object used by this view.
const Rect & getUserRect() const
Is called by the AxisRepBase object (or one of its derived objects), and returns the rectangle where ...
virtual ~DataView()
The virtual destructor.
The base class for the PlotterBase hierarchy.
virtual float userToInvertedMarginY(double y) const
Converts the user Y coordinate into the top-left based margin Y coordinate.
void setRect(double x, double y, double width, double height)
Set the parameters of 2D Rectangle.
virtual double getBottomMargin()
void setMarginRect(const Rect &)
Sets the margin rectangle.
double getZ() const
A shortcut to get origin.Z.
Rect m_margin_rect
The rectangle area in which the projected points are plotted.
virtual double marginToInvertedUserY(double y) const
Converts from inverted view coordinate to data coordinate, without taking into account transforms or ...
Class representing a rectangle.
hippodraw::DataView class interface
virtual int pointSize() const =0
Get the pointsize of the font.
virtual float userToMarginY(double y) const
Converts the user Y coordinate into the margin Y coordinate.
DataView()
The default constructor.
virtual double getZMargin()
double getX() const
A shortcut to get origin.X.