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

QtView Class Reference

#include <QtView.h>

Inheritance diagram for QtView:

Inheritance graph
[legend]
Collaboration diagram for QtView:

Collaboration graph
[legend]
List of all members.

Detailed Description

The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas.

It is derived from QCanvasRectangle in order to get a position and size on the canvas. The view thus becomes a QCanvasItem. The inherited active state is used to lock the size and position on the canvas. The inherited selected state is used to highlight the selected item. It also derives from QtViewImp which contains most of the drawing code.

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

Sanket Biren Malde <sanket@stanford.edu>

Definition at line 41 of file QtView.h.

Public Member Functions

 chunks () const
virtual const QFontdefaultFont ()
virtual void draw (QPainter &)
 Re-Implements the inherited function from QCanvasPoygonalItem.
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 drawShape (QPainter &)
 Overrides pure virtual function of QCanvasPolygonalItem.
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
 Fills the picked point vector.
virtual double getAspectRatio () const
 Get the aspect ratio.
virtual HippoRectangle getDrawRect () const
 Overrides virtual function of ViewBase.
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.
 height () const
virtual void initPlot (double transform_aspect_ratio)
 Initializes a view before drawing.
 QtView (const QtView &)
 The copy constructor.
 QtView (PlotterBase *plotter)
 The constructor.
 rect () const
 rtti () const
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 width, float height)
 Sets the drawing rectangle in the paint device space.
void setDrawRect (const QRect &rect)
 Sets the drawing rectangle in the paint device space.
void setInspector (QObject *)
 Sets the receiver of update messages.
virtual void setPageWidth (int upage_w)
 Set the page width.
virtual void setPlotter (PlotterBase *plotter)
 Sets the PlotterBase object to plotter.
virtual void setShowCrossHairs (bool flag)
 Sets display status of cross-hairs.
 setSize (int width, int height)
 size () const
int toView (double x) const
 Converts the view space coordinate x expressed as a double to one expressed as an int.
int toViewX (double datX) const
 Converts the data space coordinate X to the view space coordinate X.
int toViewY (double datY) const
 Converts the data space coordinate Y to the view space coordinate Y.
virtual void update (const Observable *)
 Responds to Obvervable update message.
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.
 width () const
virtual void willDelete (const Observable *)
 Notifies this Observer object that one of its Observable objects is about to be deleted.
virtual ~QtView ()
 The required virtual destructor.

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)

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

void drawMethod (const std::vector< double > &x, const std::vector< double > &y, int opt1, int opt2)
 Draws in the view using the specified method.
void drawViewMethod (const std::vector< double > &x, const std::vector< double > &y, int opt1, int opt2)
 Draws in the view using the specified method.
void drawWithPixmap (QPainter &painter)
 Does the drawing with QPixmap cache instead of directly to paint device.
void ensureOffScrSize (int osw, int osh)
 Used by the double buffering done in method draw.
int toCanvasX (double dx) const
 Converts coordinate from view space to canvas space.
int toCanvasY (double dy) const
 Converts coordinate from view space to canvas space.
void transformAndFill (QPointArray &array, const std::vector< double > &x, const std::vector< double > &y, int(QtView::*xfunc)(double) const, int(QtView::*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.

Private Attributes

bool m_crosshairs
 A flag indicating if cross-hairs should be drawn.
bool m_filled
 A flag indicating if the buffer pixmap has been filled.
bool m_is_drawing
 A flag set true when drawing has stared.
QPixmap m_pixmap
 A QPixmap used for buffer the plot.
int m_upage_w
 Page width.


Constructor & Destructor Documentation

QtView::QtView PlotterBase plotter  ) 
 

The constructor.

Parameters:
plotter The plotter of the class derived from PlotterBase to be used in a drawing.

Definition at line 29 of file QtView.cxx.

References ViewBase::m_plotter.

QtView::QtView const QtView  ) 
 

The copy constructor.

QtView::~QtView  )  [virtual]
 

The required virtual destructor.

Definition at line 46 of file QtView.cxx.

References ViewBase::m_plotter.


Member Function Documentation

const QFont & QtViewImp::defaultFont  )  [virtual, inherited]
 

Definition at line 913 of file QtViewImp.cxx.

References QtViewImp::m_font_default.

void QtView::draw QPainter  )  [virtual]
 

Re-Implements the inherited function from QCanvasPoygonalItem.

First calls base class to draw the contents. If selected, then also draws the border and sends update message to m_inspector.

Definition at line 111 of file QtView.cxx.

References QPainter::device(), DrawBorder::draw(), ViewBase::drawSelf(), drawWithPixmap(), DrawBorder::instance(), m_crosshairs, m_is_drawing, QtViewImp::m_painter, ViewBase::m_plotter, QPainter::setPen(), and DrawBorder::setView().

Referenced by drawShape(), and initPlot().

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, inherited]
 

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(), QtViewImp::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 QtViewImp::drawText(), and QtViewImp::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, inherited]
 

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(), QtViewImp::m_painter, QPainter::restore(), QtViewImp::s_line_style, QPainter::save(), QPainter::setPen(), QPen::setStyle(), QtViewImp::toViewX(), and QtViewImp::toViewY().

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

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 QtViewImp::createPen(), QPainter::drawLineSegments(), QtViewImp::m_painter, QPainter::restore(), QPainter::save(), QPainter::setPen(), QtViewImp::toViewX(), QtViewImp::toViewY(), and QtViewImp::transformAndFill().

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

Definition at line 840 of file QtViewImp.cxx.

References QString::arg(), QPainter::drawText(), QString::length(), QtViewImp::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, inherited]
 

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 QtViewImp::m_font_default.

void QtView::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 from QtViewImp.

Definition at line 267 of file QtView.cxx.

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

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, inherited]
 

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(), QtViewImp::m_painter, hippodraw::Symbol::PLUS, QPainter::restore(), QPainter::save(), QPainter::setBrush(), QPainter::setPen(), QPointArray::setPoint(), hippodraw::Symbol::SOLIDSQUARE, hippodraw::Symbol::SQUARE, hippodraw::Symbol::TIMES, QtViewImp::toViewX(), QtViewImp::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, inherited]
 

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

Definition at line 300 of file QtViewImp.cxx.

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

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 QtViewImp::createPen(), QtViewImp::drawMethod(), QtViewImp::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(), draw(), drawWithPixmap(), OpenGLWindow::paint(), and QtViewWidget::paintEvent().

void QtView::drawShape QPainter painter  )  [virtual]
 

Overrides pure virtual function of QCanvasPolygonalItem.

Todo:
This method could be removed.

Reimplemented from QCanvasRectangle.

Definition at line 141 of file QtView.cxx.

References draw().

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

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(), QtViewImp::m_painter, QtViewImp::toViewX(), and QtViewImp::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, inherited]
 

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 QtViewImp::draw_Text(), ViewBase::getDrawRect(), HippoRectangle::getX(), HippoRectangle::getY(), and QtViewImp::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, inherited]
 

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, inherited]
 

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 QtViewImp::draw_Text(), ViewBase::getDrawRect(), HippoRectangle::getX(), HippoRectangle::getY(), QtViewImp::m_font_default, QtViewImp::userToDrawX(), and QtViewImp::userToDrawY().

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

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 QtViewImp::createPen(), QPainter::drawLineSegments(), QtViewImp::m_painter, QPainter::restore(), QPainter::save(), QPainter::setPen(), QtViewImp::toCanvasX(), QtViewImp::toCanvasY(), and QtViewImp::transformAndFill().

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

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 QtViewImp::drawViewMethod(), QtViewImp::m_painter, QPainter::pen(), QPainter::restore(), QtViewImp::s_line_style, QPainter::save(), QPainter::setPen(), and QPen::setStyle().

void QtView::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 from QtViewImp.

Definition at line 250 of file QtView.cxx.

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

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

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(), QtViewImp::m_painter, QtViewImp::toCanvasX(), and QtViewImp::toCanvasY().

void QtView::drawWithPixmap QPainter painter  )  [private]
 

Does the drawing with QPixmap cache instead of directly to paint device.

Attention:
This method should not be used when drawing to the printer.

Definition at line 55 of file QtView.cxx.

References QPainter::begin(), QPainter::drawPixmap(), ViewBase::drawSelf(), QPainter::end(), ensureOffScrSize(), QPixmap::fill(), ViewBase::getAspectRatio(), getDrawRect(), HippoRectangle::getHeight(), HippoRectangle::getWidth(), HippoRectangle::getX(), HippoRectangle::getY(), QCanvasRectangle::height(), m_filled, QtViewImp::m_painter, m_pixmap, QCanvasRectangle::rect(), setDrawRect(), QPainter::translate(), and QCanvasRectangle::width().

Referenced by draw().

void QtView::endPlot  )  [virtual]
 

Finalizes the plot view by unlocking the QApplication.

Reimplemented from QtViewImp.

Definition at line 198 of file QtView.cxx.

void QtView::ensureOffScrSize int  osw,
int  osh
[private]
 

Used by the double buffering done in method draw.

Todo:
It still does a fair amount of flickering, need to look at this further.

Definition at line 284 of file QtView.cxx.

References QPixmap::height(), m_pixmap, QPixmap::resize(), and QPixmap::width().

Referenced by drawWithPixmap().

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

Fills the picked point vector.

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

Implements QtViewImp.

Definition at line 215 of file QtView.cxx.

References ViewBase::m_plotter.

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 drawWithPixmap().

HippoRectangle QtView::getDrawRect  )  const [virtual]
 

Overrides virtual function of ViewBase.

Implements ViewBase.

Definition at line 146 of file QtView.cxx.

References QCanvasRectangle::height(), and QCanvasRectangle::width().

Referenced by drawWithPixmap(), and initPlot().

HippoRectangle QtViewImp::getMarginRect  )  const [virtual, inherited]
 

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().

void QtView::initPlot double  transform_aspect_ratio  )  [virtual]
 

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.

Implements ViewBase.

Definition at line 183 of file QtView.cxx.

References draw(), getDrawRect(), HippoRectangle::getHeight(), HippoRectangle::getWidth(), setDrawRect(), and QCanvasRectangle::width().

void QtViewImp::setCrossX double  val  )  [inherited]
 

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  )  [inherited]
 

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, inherited]
 

Definition at line 906 of file QtViewImp.cxx.

References QtViewImp::m_font_default.

void QtView::setDrawRect float  x,
float  y,
float  width,
float  height
[virtual]
 

Sets the drawing rectangle in the paint device space.

Implements ViewBase.

Definition at line 172 of file QtView.cxx.

References m_filled, and QCanvasRectangle::setSize().

void QtView::setDrawRect const QRect rect  ) 
 

Sets the drawing rectangle in the paint device space.

Definition at line 167 of file QtView.cxx.

References QCanvasRectangle::height(), QRect::width(), QRect::x(), and QRect::y().

Referenced by drawWithPixmap(), and initPlot().

void QtViewImp::setInspector QObject  )  [inherited]
 

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 QtViewImp::m_inspector.

void QtView::setPageWidth int  upage_w  )  [virtual]
 

Set the page width.

It is used for setting the dimensions of the draw rectangle

Definition at line 298 of file QtView.cxx.

References m_upage_w.

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().

void QtView::setShowCrossHairs bool  flag  )  [virtual]
 

Sets display status of cross-hairs.

Sets the display of cross-hairs at the previous defined position on if flag is true, otherwise does not display the cross-hairs.

See also:
setCrossX and setCrossY.

Definition at line 101 of file QtView.cxx.

References m_crosshairs.

Referenced by FigureEditor::contentsMouseMoveEvent(), and CanvasView::contentsMouseReleaseEvent().

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

Converts coordinate from view space to canvas space.

Implements QtViewImp.

Definition at line 221 of file QtView.cxx.

Referenced by drawViewMethod().

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

Converts coordinate from view space to canvas space.

Implements QtViewImp.

Definition at line 226 of file QtView.cxx.

Referenced by drawViewMethod().

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

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

Definition at line 251 of file QtViewImp.h.

int QtView::toViewX double  datX  )  const [virtual]
 

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

Implements QtViewImp.

Definition at line 202 of file QtView.cxx.

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

Referenced by drawMethod().

int QtView::toViewY double  datY  )  const [virtual]
 

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

Implements QtViewImp.

Definition at line 207 of file QtView.cxx.

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

Referenced by drawMethod().

void QtView::transformAndFill QPointArray array,
const std::vector< double > &  x,
const std::vector< double > &  y,
int(QtView::*)(double) const   xfunc,
int(QtView::*)(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 QtView class are used for the transformation.

Definition at line 233 of file QtView.cxx.

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

Referenced by drawMethod(), and drawViewMethod().

void QtView::update const Observable  )  [virtual]
 

Responds to Obvervable update message.

If display is not null, responds to Obvervable update message by informing the QCanvas that its rectangluar has changed.

Reimplemented from QtViewImp.

Definition at line 153 of file QtView.cxx.

References m_filled, m_is_drawing, and QCanvasItem::update().

Referenced by FigureEditor::contentsMouseMoveEvent(), and CanvasView::contentsMouseReleaseEvent().

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

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, inherited]
 

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 QtViewImp::drawUserText().

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

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 QtViewImp::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

bool QtView::m_crosshairs [private]
 

A flag indicating if cross-hairs should be drawn.

Definition at line 62 of file QtView.h.

Referenced by draw(), and setShowCrossHairs().

bool QtView::m_filled [private]
 

A flag indicating if the buffer pixmap has been filled.

Definition at line 58 of file QtView.h.

Referenced by drawWithPixmap(), setDrawRect(), and update().

QFont QtViewImp::m_font_default [protected, inherited]
 

Definition at line 69 of file QtViewImp.h.

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

QObject* QtViewImp::m_inspector [protected, inherited]
 

The receiver of update messages.

Definition at line 62 of file QtViewImp.h.

Referenced by QtViewImp::setInspector(), and QtViewImp::update().

bool QtView::m_is_drawing [private]
 

A flag set true when drawing has stared.

Definition at line 66 of file QtView.h.

Referenced by draw(), and update().

QPainter* QtViewImp::m_painter [protected, inherited]
 

The current Qt QPainter object.

Definition at line 65 of file QtViewImp.h.

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

QPixmap QtView::m_pixmap [private]
 

A QPixmap used for buffer the plot.

Definition at line 51 of file QtView.h.

Referenced by drawWithPixmap(), and ensureOffScrSize().

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 draw(), ViewBase::drawSelf(), QtViewWidget::fillPickedPoint(), fillPickedPoint(), ViewBase::getAspectRatio(), ViewBase::getMarginRect(), QtViewImp::getMarginRect(), ViewBase::getPlotter(), ViewBase::getRange(), ViewBase::getUserRect(), QtViewWidget::mousePressEvent(), QtViewWidget::paintEvent(), QtView(), QtViewImp::setCrossX(), QtViewImp::setCrossY(), ViewBase::setPlotter(), QtViewWidget::toViewX(), toViewX(), OpenGLView::toViewX(), EpsView::toViewX(), QtViewWidget::toViewY(), toViewY(), OpenGLView::toViewY(), EpsView::toViewY(), QtViewImp::userToDrawColor(), OpenGLView::userToDrawColor(), EpsView::userToDrawColor(), QtViewImp::userToDrawX(), OpenGLView::userToDrawX(), EpsView::userToDrawX(), QtViewImp::userToDrawY(), OpenGLView::userToDrawY(), EpsView::userToDrawY(), and ~QtView().

int QtView::m_upage_w [private]
 

Page width.

Definition at line 54 of file QtView.h.

Referenced by setPageWidth().


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