#include <QtView.h>
Inheritance diagram for QtView:


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.
Sanket Biren Malde <sanket@stanford.edu>
Definition at line 41 of file QtView.h.
Public Member Functions | |
| chunks () const | |
| virtual const QFont & | defaultFont () |
| 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. | |
| PlotterBase * | getPlotter () |
| Returns the plotter used by this view. | |
| PlotterBase * | getPlotter () const |
| Returns the plotter used by this view. | |
| const Range & | getRange (hippodraw::Axes::Type axis) const |
| Returns the range of the data space on specified axis. | |
| const HippoRectangle & | getUserRect () 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 |
| QObject * | m_inspector |
| The receiver of update messages. | |
| QPainter * | m_painter |
| The current Qt QPainter object. | |
| PlotterBase * | m_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. | |
|
|
The constructor.
Definition at line 29 of file QtView.cxx. References ViewBase::m_plotter. |
|
|
The copy constructor.
|
|
|
The required virtual destructor.
Definition at line 46 of file QtView.cxx. References ViewBase::m_plotter. |
|
|
Definition at line 913 of file QtViewImp.cxx. References QtViewImp::m_font_default. |
|
|
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(). |
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
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.
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(). |
|
||||||||||||||||||||||||
|
Draws multiple line segments - that is, a line between x0,y0 and x1,y2, another between x2,y2 and x3,y3 and so on.
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(). |
|
||||||||||||||||||||||||
|
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(). |
|
||||||||||||||||||||
|
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 ).
Implements ViewBase. Definition at line 833 of file QtViewImp.cxx. References QtViewImp::m_font_default. |
|
||||||||||||||||||||
|
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(). |
|
||||||||||||||||||||||||
|
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. |
|
||||||||||||||||||||
|
Definition at line 300 of file QtViewImp.cxx. |
|
||||||||||||||||||||||||
|
Draws a polyline.
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(). |
|
|
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(). |
|
|
Overrides pure virtual function of QCanvasPolygonalItem.
Reimplemented from QCanvasRectangle. Definition at line 141 of file QtView.cxx. References draw(). |
|
||||||||||||||||||||||||||||||||
|
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(). |
|
||||||||||||||||||||||||||||||||||||||||
|
Draws a text string at a point in the view's coordinate system.
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. |
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 781 of file QtViewImp.cxx. |
|
||||||||||||||||||||||||||||||||
|
Draws a text string at a point in the data coordinate system.
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(). |
|
||||||||||||||||||||||||
|
Draws multiple line segments.
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(). |
|
||||||||||||||||||||||||
|
Draws multiple line segments.
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(). |
|
||||||||||||||||||||
|
Draws in the view using the specified method. The coordinates are in the view space.
Reimplemented from QtViewImp. Definition at line 250 of file QtView.cxx. References QPainter::drawLineSegments(), QtViewImp::m_painter, QCanvasRectangle::size(), toCanvasX(), toCanvasY(), and transformAndFill(). |
|
||||||||||||||||||||||||||||||||
|
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(). |
|
|
Does the drawing with QPixmap cache instead of directly to paint device.
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(). |
|
|
Finalizes the plot view by unlocking the QApplication.
Reimplemented from QtViewImp. Definition at line 198 of file QtView.cxx. |
|
||||||||||||
|
Used by the double buffering done in method draw.
Definition at line 284 of file QtView.cxx. References QPixmap::height(), m_pixmap, QPixmap::resize(), and QPixmap::width(). Referenced by drawWithPixmap(). |
|
||||||||||||||||
|
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. |
|
|
Get the aspect ratio.
Definition at line 85 of file ViewBase.cxx. References ViewBase::m_plotter. Referenced by CanvasView::contentsMouseMoveEvent(), and drawWithPixmap(). |
|
|
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(). |
|
|
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. |
|
|
Returns the plotter used by this view.
Definition at line 55 of file ViewBase.cxx. References ViewBase::m_plotter. |
|
|
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(). |
|
|
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(). |