Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QtViewImp Class Reference

#include <QtViewImp.h>

Inheritance diagram for QtViewImp:

Inheritance graph
[legend]
Collaboration diagram for QtViewImp:

Collaboration graph
[legend]
List of all members.

Detailed Description

The class of derived from ViewBase for drawing to the screen and PostScript generation using Qt toolkit.

This class is most of the implementation of a concrete view. A derived class is needed to handle size attributes.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Sanket Biren Malde <sanket@stanford.edu>

Definition at line 44 of file QtViewImp.h.

Public Member Functions

virtual const QFontdefaultFont ()
virtual void drawColorLines (const std::vector< double > &x, const std::vector< double > &y, hippodraw::Line::Style style, const std::vector< Color > &colors, float size)
 Draws multiple line segments, each with a different color - that is, a line between x0,y0 and x1,y1, with color[0] =color[1] another between x2,y2 and x3,y3 with color[2]=color[3] and so on.
virtual void drawLines (const std::vector< double > &x, const std::vector< double > &y, hippodraw::Line::Style style, const Color &color, float size)
 Draws multiple line segments - that is, a line between x0,y0 and x1,y2, another between x2,y2 and x3,y3 and so on.
virtual void drawMag (float x, float y, int mag, float fontsize, QFont &)
virtual void drawMag (float x, float y, int mag, float fontsize)
 Draws the exponent on the axis label.
virtual void drawPoints (const std::vector< double > &x, const std::vector< double > &y, const std::vector< Color > &colors, hippodraw::Symbol::Type type, float sym_size)
virtual void drawPoints (const std::vector< double > &x, const std::vector< double > &y, hippodraw::Symbol::Type type, float sym_size)
virtual void drawPolyLine (const std::vector< double > &xpoints, const std::vector< double > &ypoints, hippodraw::Line::Style style, const Color &color, float size)
 Draws a polyline.
virtual void drawSelf ()
 Draws itself.
virtual void drawSquare (double x1, double y1, double x2, double y2, int red, int green, int blue)
 Draws a colored square.
virtual void drawText (const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp, bool resize, const FontBase *font)
 Draws a text string at a point in the view's coordinate system.
virtual void drawText (const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp, bool resize)
virtual void drawUserText (const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp)
 Draws a text string at a point in the data coordinate system.
virtual void drawViewLines (const std::vector< double > &x, const std::vector< double > &y, hippodraw::Line::Style style, const Color &color, float size)
 Draws multiple line segments.
virtual void drawViewLines (const std::vector< double > &x, const std::vector< double > &y, hippodraw::Line::Style style, bool color, float size)
 Draws multiple line segments.
virtual void drawViewSquare (float x1, float y1, float x2, float y2, int red, int green, int blue)
 Draws a colored square in view space.
virtual void endPlot ()
 Finalizes the plot view by unlocking the QApplication.
virtual void fillPickedPoint (double x, double y, std::vector< double > &picked) const =0
 Fills the picked point vector.
virtual double getAspectRatio () const
 Get the aspect ratio.
virtual HippoRectangle getDrawRect () const =0
 Returns the drawing Rectangle in the devices coordinate system.
virtual HippoRectangle getMarginRect () const
 Returns the Rectangle within which points representations are draw.
PlotterBasegetPlotter ()
 Returns the plotter used by this view.
PlotterBasegetPlotter () const
 Returns the plotter used by this view.
const RangegetRange (hippodraw::Axes::Type axis) const
 Returns the range of the data space on specified axis.
const HippoRectanglegetUserRect () const
 Is called by the AxisRepBase object (or one of its derived objects), and returns the rectangle where the drawing is made.
virtual void initPlot (double aspect)=0
 Initializes a view before drawing.
 QtViewImp (const QtViewImp &)
 The copy constructor.
 QtViewImp (PlotterBase *plotter)
 The constructor.
void setCrossX (double val)
 Set the crossX value.
void setCrossY (double val)
 Set the crossY value.
virtual void setDefaultFont (const QFont &font)
virtual void setDrawRect (float x, float y, float w, float h)=0
 Sets the drawing Rectangle in the devices coordinate system.
void setInspector (QObject *)
 Sets the receiver of update messages.
virtual void setPlotter (PlotterBase *plotter)
 Sets the PlotterBase object to plotter.
int toView (double x) const
 Converts the view space coordinate x expressed as a double to one expressed as an int.
virtual int toViewX (double datX) const =0
 Converts the data space coordinate X to the view space coordinate X.
virtual int toViewY (double datY) const =0
 Converts the data space coordinate Y to the view space coordinate Y.
float userToDrawColor (double c) const
 Converts a coordinate in user space to drawing space along the color (X) axis.
float userToDrawX (double x) const
 Converts a coordinate in user space to drawing space along the X axis.
float userToDrawY (double x) const
 Converts a coordinate in user space to drawing space along the Y axis.
virtual void willDelete (const Observable *)
 Notifies this Observer object that one of its Observable objects is about to be deleted.

Protected Member Functions

virtual void draw_Text (const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp, bool resize, QFont &font)
virtual void update (const Observable *display)
 Responds to update message from Observable.

Protected Attributes

QFont m_font_default
QObjectm_inspector
 The receiver of update messages.
QPainterm_painter
 The current Qt QPainter object.
PlotterBasem_plotter
 The plotter object used by this view.

Private Member Functions

QPen createPen (const Color &color, float size, hippodraw::Line::Style style)
 Creates a QPen object from the arguments.
void drawMethod (const std::vector< double > &x, const std::vector< double > &y, int opt1, int opt2)
 Draws in the view using the specified method.
virtual void drawPoints (const std::vector< double > &x, const std::vector< double > &y, hippodraw::Symbol::Type type, float sym_size, const Color &color)
 Draws symbol points.
void drawViewMethod (const std::vector< double > &x, const std::vector< double > &y, int opt1, int opt2)
 Draws in the view using the specified method.
virtual int toCanvasX (double dx) const =0
 Converts coordinate from view space to canvas space.
virtual int toCanvasY (double dy) const =0
 Converts coordinate from view space to canvas space.
void transformAndFill (QPointArray &array, const std::vector< double > &x, const std::vector< double > &y, int(QtViewImp::*xfunc)(double) const, int(QtViewImp::*yfunc)(double) const )
 Fills the array with QPoint objects whose coordinates are in the QPaintDevice space from the vectors x and y whose coordinates are in the data space.

Static Private Attributes

static std::map< hippodraw::Line::Style,
Qt::PenStyle > 
s_line_style
 The mapping from hippodraw::Line::Style to QPen PenStyle.


Constructor & Destructor Documentation

QtViewImp::QtViewImp PlotterBase plotter  ) 
 

The constructor.

Parameters:
plotter The plotter of the class derived from PlotterBase to be used in a drawing.
Todo:
Lots more methods could be protected.

Definition at line 40 of file QtViewImp.cxx.

References hippodraw::Line::Dash, hippodraw::Line::DashDot, hippodraw::Line::DashDotDot, hippodraw::Line::Dot, hippodraw::FontWeight::Invisible, s_line_style, and hippodraw::Line::Solid.

QtViewImp::QtViewImp const QtViewImp  ) 
 

The copy constructor.


Member Function Documentation

QPen QtViewImp::createPen const Color color,
float  size,
hippodraw::Line::Style  style
[private]
 

Creates a QPen object from the arguments.

Definition at line 447 of file QtViewImp.cxx.

References Color::getBlue(), Color::getGreen(), Color::getRed(), and s_line_style.

Referenced by drawLines(), drawPolyLine(), and drawViewLines().

const QFont & QtViewImp::defaultFont  )  [virtual]
 

Definition at line 913 of file QtViewImp.cxx.

References m_font_default.

void QtViewImp::draw_Text const std::string s,
float  x,
float  y,
float  fontsize,
float  angle,
char  xp,
char  yp,
bool  resize,
QFont font
[protected, virtual]
 

Definition at line 593 of file QtViewImp.cxx.

References QPainter::boundingRect(), QFontMetrics::boundingRect(), QPainter::drawText(), ViewBase::getDrawRect(), HippoRectangle::getHeight(), HippoRectangle::getWidth(), HippoRectangle::getX(), HippoRectangle::getY(), QRect::height(), m_painter, QRect::moveBy(), QPainter::restore(), QPainter::rotate(), QPainter::save(), ViewBase::setDrawRect(), QPainter::setFont(), QRect::setHeight(), QFont::setPixelSize(), QFont::setPointSize(), QRect::setWidth(), QPainter::translate(), and QRect::width().

Referenced by drawText(), and drawUserText().

void QtViewImp::drawColorLines const std::vector< double > &  x,
const std::vector< double > &  y,
hippodraw::Line::Style  style,
const std::vector< Color > &  colors,
float  size
[virtual]
 

Draws multiple line segments, each with a different color - that is, a line between x0,y0 and x1,y1, with color[0] =color[1] another between x2,y2 and x3,y3 with color[2]=color[3] and so on.

x pairs of coordinates in user space on the X axis for the beginning and the end of the line segment.

y pairs of coordinates in user space on the Y axis for the beginning and the end of the line segment.

style the line style.

color The RGB values for the color of the line.

size The thickness of the line.

Bug:
Could call drawPolyLine for each contour with same color.

Implements ViewBase.

Definition at line 509 of file QtViewImp.cxx.

References QPainter::drawLine(), Color::getBlue(), Color::getGreen(), Color::getRed(), m_painter, QPainter::restore(), s_line_style, QPainter::save(), QPainter::setPen(), QPen::setStyle(), toViewX(), and toViewY().

void QtViewImp::drawLines const std::vector< double > &  x,
const std::vector< double > &  y,
hippodraw::Line::Style  style,
const Color color,
float  size
[virtual]
 

Draws multiple line segments - that is, a line between x0,y0 and x1,y2, another between x2,y2 and x3,y3 and so on.

x pairs of coordinates in user space on the X axis for the beginning and the end of the line segment. y pairs of coordinates in user space on the Y axis for the beginning and the end of the line segment. style the line style. color The color size The thickness of the line.

Implements ViewBase.

Definition at line 482 of file QtViewImp.cxx.

References createPen(), QPainter::drawLineSegments(), m_painter, QPainter::restore(), QPainter::save(), QPainter::setPen(), toViewX(), toViewY(), and transformAndFill().

void QtViewImp::drawMag float  x,
float  y,
int  mag,
float  fontsize,
QFont
[virtual]
 

Definition at line 840 of file QtViewImp.cxx.

References QString::arg(), QPainter::drawText(), QString::length(), m_painter, QPainter::restore(), QPainter::save(), QPainter::setFont(), QFont::setPointSize(), and QPainter::translate().

void QtViewImp::drawMag float  x,
float  y,
int  mag,
float  fontsize
[virtual]
 

Draws the exponent on the axis label.

The arguments stand for the starting position of the writing ( x, y ), for the value of the magnitude ( mag ), and for the font ( fontsize ).

Bug:
@@ This method should not exist.
The x, y coordinates of the position of the magnitude should be calculated in the AxisRepBase class and that class should use drawText.

Implements ViewBase.

Definition at line 833 of file QtViewImp.cxx.

References m_font_default.

void QtViewImp::drawMethod const std::vector< double > &  x,
const std::vector< double > &  y,
int  opt1,
int  opt2
[private]
 

Draws in the view using the specified method.

The coordinates are in the user space.

Reimplemented in QtView, and QtViewWidget.

Definition at line 146 of file QtViewImp.cxx.

References QPainter::drawPolyline(), m_painter, num_util::size(), toViewX(), toViewY(), and transformAndFill().

Referenced by drawPolyLine().

void QtViewImp::drawPoints const std::vector< double > &  x,
const std::vector< double > &  y,
const std::vector< Color > &  colors,
hippodraw::Symbol::Type  type,
float  sym_size
[virtual]
 

Todo:
This method has a lot of duplicated code from the one with the same name but only one color.
One should remove the duplication.

Todo:
The draw triangle methods have duplicated code which could be removed.

Implements ViewBase.

Definition at line 317 of file QtViewImp.cxx.

References hippodraw::Symbol::CIRCLE, QPainter::drawEllipse(), QPainter::drawPie(), QPainter::drawPolygon(), hippodraw::Symbol::FILLED_CIRCLE, hippodraw::Symbol::FILLED_TRIANGLE, QPainter::fillRect(), Color::getBlue(), Color::getGreen(), Color::getRed(), m_painter, hippodraw::Symbol::PLUS, QPainter::restore(), QPainter::save(), QPainter::setBrush(), QPainter::setPen(), QPointArray::setPoint(), hippodraw::Symbol::SOLIDSQUARE, hippodraw::Symbol::SQUARE, hippodraw::Symbol::TIMES, toViewX(), toViewY(), and hippodraw::Symbol::TRIANGLE.

void QtViewImp::drawPoints const std::vector< double > &  x,
const std::vector< double > &  y,
hippodraw::Symbol::Type  type,
float  sym_size
[virtual]
 

Todo:
Determine if this member function is no longer needed.

Definition at line 300 of file QtViewImp.cxx.

void QtViewImp::drawPoints const std::vector< double > &  x,
const std::vector< double > &  y,
hippodraw::Symbol::Type  type,
float  sym_size,
const Color color
[private, virtual]
 

Draws symbol points.

x and y are the coordinates, type is the type of symbol, and sym_size is the size. All symbols are draw in the same color.

Implements ViewBase.

Definition at line 166 of file QtViewImp.cxx.

References hippodraw::Symbol::CIRCLE, QPainter::drawEllipse(), QPainter::drawPie(), QPainter::drawPolygon(), hippodraw::Symbol::FILLED_CIRCLE, hippodraw::Symbol::FILLED_TRIANGLE, QPainter::fillRect(), Color::getBlue(), Color::getGreen(), Color::getRed(), m_painter, hippodraw::Symbol::PLUS, QPainter::restore(), QPainter::save(), QPainter::setBrush(), QPainter::setPen(), QPointArray::setPoint(), hippodraw::Symbol::SOLIDSQUARE, hippodraw::Symbol::SQUARE, hippodraw::Symbol::TIMES, toViewX(), toViewY(), and hippodraw::Symbol::TRIANGLE.

void QtViewImp::drawPolyLine const std::vector< double > &  xpoints,
const std::vector< double > &  ypoints,
hippodraw::Line::Style  style,
const Color color,
float  size
[virtual]
 

Draws a polyline.

xpoints points along the X axis. ypoints points along the Y axis. style the line style. color The color. size The thickness of the line.

Implements ViewBase.

Definition at line 463 of file QtViewImp.cxx.

References createPen(), drawMethod(), m_painter, QPainter::restore(), QPainter::save(), and QPainter::setPen().

void ViewBase::drawSelf  )  [virtual, inherited]
 

Draws itself.

Definition at line 60 of file ViewBase.cxx.

References PlotterBase::drawIn(), and ViewBase::m_plotter.

Referenced by QtViewWidget::draw(), QtView::draw(), QtView::drawWithPixmap(), OpenGLWindow::paint(), and QtViewWidget::paintEvent().

void QtViewImp::drawSquare double  x1,
double  y1,
double  x2,
double  y2,
int  red,
int  green,
int  blue
[virtual]
 

Draws a colored square.

Used for shading on the cuts and the gray plot.

Implements ViewBase.

Definition at line 865 of file QtViewImp.cxx.

References QPainter::fillRect(), m_painter, toViewX(), and toViewY().

void QtViewImp::drawText const std::string s,
float  x,
float  y,
float  fontsize,
float  angle,
char  xp,
char  yp,
bool  resize,
const FontBase font
[virtual]
 

Draws a text string at a point in the view's coordinate system.

Parameters:
s The string to be drawn.
x The x coordinate in the view's coordinate system.
y The y coordinate in the view's coordinate system.
fontsize The font size. If zero, then taken from the font object.
angle The angle to draw. 90 degrees is vertical with the beginning of the text towards the bottom.
xp The horizontal alignment with respect to the coordinate. 'r' means the coordinate is on the right side of the text, 'c' means centered, and 'l' for the left side.
yp The vertical alignment with respect to the coordinate. 't' means toward the top, 'c' means centered, and 'b' means bottom.
resize If true, the bounding rectangle of the view should be resized to fit the text string.
font If not a null pointer, then the font object to be used, otherwise the default font will be used.

Implements ViewBase.

Definition at line 791 of file QtViewImp.cxx.

References draw_Text(), ViewBase::getDrawRect(), HippoRectangle::getX(), HippoRectangle::getY(), and m_font_default.

void QtViewImp::drawText const std::string s,
float  xx,
float  yy,
float  fontsize,
float  angle,
char  xp,
char  yp,
bool  resize
[virtual]
 

Note:
This method is only here to avoid introducing FontBase to SIP based Python extension module.

Definition at line 781 of file QtViewImp.cxx.

void QtViewImp::drawUserText const std::string s,
float  x,
float  y,
float  fontsize,
float  angle,
char  xp,
char  yp
[virtual]
 

Draws a text string at a point in the data coordinate system.

See also:
drawText
Bug:
Is this function used somewhere?

Implements ViewBase.

Definition at line 819 of file QtViewImp.cxx.

References draw_Text(), ViewBase::getDrawRect(), HippoRectangle::getX(), HippoRectangle::getY(), m_font_default, userToDrawX(), and userToDrawY().

void QtViewImp::drawViewLines const std::vector< double > &  x,
const std::vector< double > &  y,
hippodraw::Line::Style  style,
const Color color,
float  size
[virtual]
 

Draws multiple line segments.

x pairs of coordinates in view space on the X axis for the beginning and the end of the line segment. y pairs of coordinates in view space on the Y axis for the beginning and the end of the line segment. style the line style. color The color size The thickness of the line.

Implements ViewBase.

Definition at line 566 of file QtViewImp.cxx.

References createPen(), QPainter::drawLineSegments(), m_painter, QPainter::restore(), QPainter::save(), QPainter::setPen(), toCanvasX(), toCanvasY(), and transformAndFill().

void QtViewImp::drawViewLines const std::vector< double > &  x,
const std::vector< double > &  y,
hippodraw::Line::Style  style,
bool  color,
float  size
[virtual]
 

Draws multiple line segments.

x pairs of coordinates in view space on the X axis for the beginning and the end of the line segment. y pairs of coordinates in view space on the Y axis for the beginning and the end of the line segment. style the line style. color if true, use the display's point color; otherwise, use the default color. size The thickness of the line.

Implements ViewBase.

Definition at line 544 of file QtViewImp.cxx.

References drawViewMethod(), m_painter, QPainter::pen(), QPainter::restore(), s_line_style, QPainter::save(), QPainter::setPen(), and QPen::setStyle().

void QtViewImp::drawViewMethod const std::vector< double > &  x,
const std::vector< double > &  y,
int  opt1,
int  opt2
[private]
 

Draws in the view using the specified method.

The coordinates are in the view space.

Todo:
We may have function like this that takes pointer to member function of QPainter as first argument.

Reimplemented in QtView, and QtViewWidget.

Definition at line 126 of file QtViewImp.cxx.

References QPainter::drawLineSegments(), m_painter, num_util::size(), toCanvasX(), toCanvasY(), and transformAndFill().

Referenced by drawViewLines().

void QtViewImp::drawViewSquare float  x1,
float  y1,
float  x2,
float  y2,
int  red,
int  green,
int  blue
[virtual]
 

Draws a colored square in view space.

Used for shading on the cuts and the gray plot.

Implements ViewBase.

Definition at line 880 of file QtViewImp.cxx.

References QPainter::fillRect(), m_painter, toCanvasX(), and toCanvasY().

void QtViewImp::endPlot  )  [virtual]
 

Finalizes the plot view by unlocking the QApplication.

Implements ViewBase.

Reimplemented in QtView, and QtViewWidget.

Definition at line 85 of file QtViewImp.cxx.

virtual void QtViewImp::fillPickedPoint double  x,
double  y,
std::vector< double > &  picked
const [pure virtual]
 

Fills the picked point vector.

Converts the view coordinates x and y to data coordinates. The results are put in the vector picked.

Implemented in QtView, and QtViewWidget.

double ViewBase::getAspectRatio  )  const [virtual, inherited]
 

Get the aspect ratio.

Definition at line 85 of file ViewBase.cxx.

References ViewBase::m_plotter.

Referenced by CanvasView::contentsMouseMoveEvent(), and QtView::drawWithPixmap().

virtual HippoRectangle ViewBase::getDrawRect  )  const [pure virtual, inherited]
 

Returns the drawing Rectangle in the devices coordinate system.

Must be implemented in derived class.

Implemented in EpsView, OpenGLView, QtView, and QtViewWidget.

Referenced by ViewBaseXML::createElement(), DrawBorder::draw(), draw_Text(), drawText(), AxisRepBase::drawTitle(), drawUserText(), AxisRepBase::drawXLabels(), AxisRepBase::drawXTickLabels(), AxisRepBase::drawYLabels(), AxisRepBase::drawYMag(), AxisRepColor::drawZLabels(), AxisRepColor::drawZTickLabels(), XyPlotter::prepareMarginRect(), AxisRepBase::setFontSize(), AxisRepBase::setXFontSize(), AxisRepBase::setYFontSize(), AxisRepBase::setZFontSize(), XPADDING(), YPADDING(), and ZPADDING().

HippoRectangle QtViewImp::getMarginRect  )  const [virtual]
 

Returns the Rectangle within which points representations are draw.

The coordinate is shifted by position of view on canvas.

Reimplemented from ViewBase.

Definition at line 80 of file QtViewImp.cxx.

References PlotterBase::getMarginRect(), and ViewBase::m_plotter.

PlotterBase * ViewBase::getPlotter  )  [inherited]
 

Returns the plotter used by this view.

Definition at line 55 of file ViewBase.cxx.

References ViewBase::m_plotter.

PlotterBase * ViewBase::getPlotter  )  const [inherited]
 

Returns the plotter used by this view.

Reimplemented in OpenGLView.

Definition at line 50 of file ViewBase.cxx.

References ViewBase::m_plotter.

Referenced by DisplayController::addTextViewToList(), ViewBaseXML::areDataSourcesSaved(), CutController::connectDataRep(), CanvasView::controlMousePressEvent(), ViewBaseXML::createChild(), CanvasView::fillPlotterList(), CutController::fillTupleCutList(), PyCanvas::findSelectedView(), PyCanvas::getDisplays(), OpenGLView::getPlotter(), CanvasView::getViewFor(), PlotTable::initialize(), DisplayController::removeTextObservers(), PyCanvas::saveAsImage(), CanvasView::saveSelectedAsEps(), CanvasView::setIntervalEnabled(), and CanvasView::viewShowPickTable().

const Range & ViewBase::getRange hippodraw::Axes::Type  axis  )  const [inherited]
 

Returns the range of the data space on specified axis.

Definition at line 68 of file ViewBase.cxx.

References ViewBase::m_plotter.

Referenced by ContourPointRep::drawContourTicks().

const HippoRectangle & ViewBase::getUserRect  )  const [inherited]
 

Is called by the AxisRepBase object (or one of its derived objects), and returns the rectangle where the drawing is made.

Definition at line 75 of file ViewBase.cxx.

References PlotterBase::getUserRect(), and ViewBase::m_plotter.

Referenced by ContourPointRep::endPlot(), and AxisRepBase::initAxisRect().

virtual void ViewBase::initPlot double  aspect  )  [pure virtual, inherited]
 

Initializes a view before drawing.

The view should check it size. The parameter aspect, if greater than 0.0, sets the aspect ratio of the view, i.e. the ratio of the width to the height.

Implemented in EpsView, OpenGLView, QtView, and QtViewWidget.

void QtViewImp::setCrossX double  val  ) 
 

Set the crossX value.

Definition at line 893 of file QtViewImp.cxx.

References ViewBase::m_plotter, and PlotterBase::setCrossX().

Referenced by FigureEditor::contentsMouseMoveEvent().

void QtViewImp::setCrossY double  val  ) 
 

Set the crossY value.

Definition at line 898 of file QtViewImp.cxx.

References ViewBase::m_plotter, and PlotterBase::setCrossY().

Referenced by FigureEditor::contentsMouseMoveEvent().

void QtViewImp::setDefaultFont const QFont font  )  [virtual]
 

Definition at line 906 of file QtViewImp.cxx.

References m_font_default.

virtual void ViewBase::setDrawRect float  x,
float  y,
float  w,
float  h
[pure virtual, inherited]
 

Sets the drawing Rectangle in the devices coordinate system.

Implemented in EpsView, OpenGLView, QtView, and QtViewWidget.

Referenced by draw_Text(), and ViewBaseXML::getObjects().

void QtViewImp::setInspector QObject  ) 
 

Sets the receiver of update messages.

When this object receives update() from one of it Observable objects, it emits a customEvent message to this object, if one exists.

Definition at line 58 of file QtViewImp.cxx.

References m_inspector.

void ViewBase::setPlotter PlotterBase plotter  )  [virtual, inherited]
 

Sets the PlotterBase object to plotter.

The ViewBase object does not own the plotter. If the plotter is being changed, it is up to client code to decide to destroy the previous plotter or not.

Reimplemented in OpenGLView, and QtViewWidget.

Definition at line 45 of file ViewBase.cxx.

References ViewBase::m_plotter.

Referenced by QtViewWidget::setPlotter(), and OpenGLView::setPlotter().

virtual int QtViewImp::toCanvasX double  dx  )  const [private, pure virtual]
 

Converts coordinate from view space to canvas space.

Implemented in QtView, and QtViewWidget.

Referenced by drawViewLines(), drawViewMethod(), and drawViewSquare().

virtual int QtViewImp::toCanvasY double  dy  )  const [private, pure virtual]
 

Converts coordinate from view space to canvas space.

Implemented in QtView, and QtViewWidget.

Referenced by drawViewLines(), drawViewMethod(), and drawViewSquare().

int QtViewImp::toView double  x  )  const [inline]
 

Converts the view space coordinate x expressed as a double to one expressed as an int.

Definition at line 251 of file QtViewImp.h.

virtual int QtViewImp::toViewX double  datX  )  const [pure virtual]
 

Converts the data space coordinate X to the view space coordinate X.

Implemented in QtView, and QtViewWidget.

Referenced by drawColorLines(), drawLines(), drawMethod(), drawPoints(), and drawSquare().

virtual int QtViewImp::toViewY double  datY  )  const [pure virtual]
 

Converts the data space coordinate Y to the view space coordinate Y.

Implemented in QtView, and QtViewWidget.

Referenced by drawColorLines(), drawLines(), drawMethod(), drawPoints(), and drawSquare().

void QtViewImp::transformAndFill QPointArray array,
const std::vector< double > &  x,
const std::vector< double > &  y,
int(QtViewImp::*)(double) const   xfunc,
int(QtViewImp::*)(double) const   yfunc
[private]
 

Fills the array with QPoint objects whose coordinates are in the QPaintDevice space from the vectors x and y whose coordinates are in the data space.

The member functions xfunc and yfunc of the QtViewImp class are used for the transformation.

Definition at line 106 of file QtViewImp.cxx.

References QPointArray::setPoint(), and num_util::size().

Referenced by drawLines(), drawMethod(), drawViewLines(), and drawViewMethod().

void QtViewImp::update const Observable display  )  [protected, virtual]
 

Responds to update message from Observable.

Implements ViewBase.

Reimplemented in QtView, and QtViewWidget.

Definition at line 65 of file QtViewImp.cxx.

References m_inspector, QApplication::postEvent(), and QApplication::removePostedEvents().

Referenced by QtViewWidget::update().

float QtViewImp::userToDrawColor double  c  )  const [virtual]
 

Converts a coordinate in user space to drawing space along the color (X) axis.

Implements ViewBase.

Definition at line 99 of file QtViewImp.cxx.

References ViewBase::m_plotter, and PlotterBase::userToMarginColor().

float QtViewImp::userToDrawX double  x  )  const [virtual]
 

Converts a coordinate in user space to drawing space along the X axis.

Implements ViewBase.

Definition at line 89 of file QtViewImp.cxx.

References ViewBase::m_plotter, and PlotterBase::userToMarginX().

Referenced by drawUserText().

float QtViewImp::userToDrawY double  x  )  const [virtual]
 

Converts a coordinate in user space to drawing space along the Y axis.

Implements ViewBase.

Definition at line 94 of file QtViewImp.cxx.

References ViewBase::m_plotter, and PlotterBase::userToInvertedMarginY().

Referenced by drawUserText().

void hippodraw::Observer::willDelete const Observable  )  [virtual, inherited]
 

Notifies this Observer object that one of its Observable objects is about to be deleted.

Since most Observable objects are owned by its Observer, it is the Observer that issued the delete. Thus the default implementation here does nothing. Derived classes that observe objects owned by another should implement this method to remove the Observable from the list they are observing.

Reimplemented in FunctionRep, DataSourceController, CutPlotter, TextPlotter, BinningProjector, DyHist1DProjector, DyHist2DProjector, NTupleProjector, Profile2DProjector, and ProfileProjector.

Definition at line 25 of file Observer.cxx.

Referenced by DataRep::~DataRep(), DataSource::~DataSource(), NTuple::~NTuple(), and RTuple::~RTuple().


Member Data Documentation

QFont QtViewImp::m_font_default [protected]
 

Definition at line 69 of file QtViewImp.h.

Referenced by defaultFont(), drawMag(), drawText(), drawUserText(), and setDefaultFont().

QObject* QtViewImp::m_inspector [protected]
 

The receiver of update messages.

Definition at line 62 of file QtViewImp.h.

Referenced by setInspector(), and update().

QPainter* QtViewImp::m_painter [protected]
 

The current Qt QPainter object.

Definition at line 65 of file QtViewImp.h.

Referenced by QtViewWidget::draw(), QtView::draw(), draw_Text(), drawColorLines(), drawLines(), drawMag(), QtViewWidget::drawMethod(), drawMethod(), QtView::drawMethod(), drawPoints(), drawPolyLine(), drawSquare(), drawViewLines(), QtViewWidget::drawViewMethod(), drawViewMethod(), QtView::drawViewMethod(), drawViewSquare(), QtView::drawWithPixmap(), and QtViewWidget::paintEvent().

PlotterBase* ViewBase::m_plotter [protected, inherited]
 

The plotter object used by this view.

Although the plotter object was created externally, the view owns the plotter object.

Definition at line 66 of file ViewBase.h.

Referenced by QtView::draw(), ViewBase::drawSelf(), QtViewWidget::fillPickedPoint(), QtView::fillPickedPoint(), ViewBase::getAspectRatio(), ViewBase::getMarginRect(), getMarginRect(), ViewBase::getPlotter(), ViewBase::getRange(), ViewBase::getUserRect(), QtViewWidget::mousePressEvent(), QtViewWidget::paintEvent(), QtView::QtView(), setCrossX(), setCrossY(), ViewBase::setPlotter(), QtViewWidget::toViewX(), QtView::toViewX(), OpenGLView::toViewX(), EpsView::toViewX(), QtViewWidget::toViewY(), QtView::toViewY(), OpenGLView::toViewY(), EpsView::toViewY(), userToDrawColor(), OpenGLView::userToDrawColor(), EpsView::userToDrawColor(), userToDrawX(), OpenGLView::userToDrawX(), EpsView::userToDrawX(), userToDrawY(), OpenGLView::userToDrawY(), EpsView::userToDrawY(), and QtView::~QtView().

std::map< hippodraw::Line::Style, Qt::PenStyle > QtViewImp::s_line_style [static, private]
 

The mapping from hippodraw::Line::Style to QPen PenStyle.

Definition at line 37 of file QtViewImp.cxx.

Referenced by createPen(), drawColorLines(), drawViewLines(), and QtViewImp().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3