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

QtViewWidget Class Reference

#include <QtViewWidget.h>

Inheritance diagram for QtViewWidget:

Inheritance graph
[legend]
Collaboration diagram for QtViewWidget:

Collaboration graph
[legend]
List of all members.

Detailed Description

The class of derived from ViewBase for drawing as a Qt Widget.

It is derived from QWidget in order to get a position and size in its parent. It also derives from QtViewImp where most of the drawing code is implemented.

Bug:
@@@ Displaying an empty NTuple leads to Qfont error messages.
See jira bug report.

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

Sanket Biren Malde <sanket@stanford.edu>

Definition at line 36 of file QtViewWidget.h.

Public Member Functions

 acceptDrops () const
 adjustSize ()
 autoMask () const
 backgroundBrush () const
 backgroundMode () const
 backgroundOrigin () const
 baseSize () const
 caption () const
 childAt (const QPoint &p, bool includeThis=FALSE) const
 childAt (int x, int y, bool includeThis=FALSE) const
 childrenRect () const
 childrenRegion () const
 clearFocus ()
 clearMask ()
 clearWFlags (WFlags f)
 clipRegion () const
 close ()
 close (bool alsoDelete)
 closeEvent (QCloseEvent *e)
 colorGroup () const
 constPolish () const
 contextMenuEvent (QContextMenuEvent *e)
 create (WId window=0, bool initializeWindow=TRUE, bool destroyOldWindow=TRUE)
 cursor () const
 customWhatsThis () const
virtual const QFontdefaultFont ()
 destroy (bool destroyWindow=TRUE, bool destroySubWindows=TRUE)
 dragEnterEvent (QDragEnterEvent *)
 dragLeaveEvent (QDragLeaveEvent *)
 dragMoveEvent (QDragMoveEvent *)
virtual void draw (QPainter &)
 Reimplements the inherited function.
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.
 drawText (const QPoint &pos, const QString &str)
 drawText (int x, int y, const QString &str)
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.
 dropEvent (QDropEvent *)
 enabledChange (bool oldEnabled)
virtual void endPlot ()
 Finalizes the plot view by unlocking the QApplication.
 enterEvent (QEvent *)
 enum {WidgetOrigin, ParentOrigin, WindowOrigin, AncestorOrigin}
 enum {NoFocus=0, TabFocus=0x1, ClickFocus=0x2, StrongFocus=TabFocus|ClickFocus|0x8, WheelFocus=StrongFocus|0x4}
 erase (const QRegion &reg)
 erase (const QRect &r)
 erase (int x, int y, int w, int h)
 erase ()
 eraseColor () const
 erasePixmap () const
 event (QEvent *e)
virtual void fillPickedPoint (double x, double y, std::vector< double > &picked) const
 Fills the picked point vector.
 find (WId id)
 focusData ()
 focusInEvent (QFocusEvent *)
 focusNextPrevChild (bool next)
 focusOutEvent (QFocusEvent *)
 focusPolicy () const
 focusProxy () const
 focusWidget () const
 font () const
 fontChange (const QFont &oldFont)
 fontInfo () const
 fontMetrics () const
 foregroundColor () const
 frameGeometry () const
 frameSize () const
 geometry () const
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.
 getWFlags () const
 grabKeyboard ()
 grabMouse (const QCursor &cursor)
 grabMouse ()
 hasFocus () const
 hasMouse () const
 hasMouseTracking () const
 height () const
 heightForWidth (int w) const
 hide ()
 hideEvent (QHideEvent *)
 icon () const
 iconText () const
 imComposeEvent (QIMEvent *e)
 imEndEvent (QIMEvent *e)
 imStartEvent (QIMEvent *e)
virtual void initPlot (double aspect)
 Initializes the plot view by locking the QApplication.
 isActiveWindow () const
 isDesktop () const
 isDialog () const
 isEnabled () const
 isEnabledTo (QWidget *ancestor) const
 isFocusEnabled () const
 isFullScreen () const
 isHidden () const
 isInputMethodEnabled () const
 isMaximized () const
 isMinimized () const
 isModal () const
 isPopup () const
 isShown () const
 isTopLevel () const
 isUpdatesEnabled () const
 isVisible () const
 isVisibleTo (QWidget *ancestor) const
 keyboardGrabber ()
 keyPressEvent (QKeyEvent *e)
 keyReleaseEvent (QKeyEvent *e)
 layout () const
 leaveEvent (QEvent *)
 lower ()
 macEvent (MSG *)
 mapFrom (QWidget *parent, const QPoint &pos) const
 mapFromGlobal (const QPoint &pos) const
 mapFromParent (const QPoint &pos) const
 mapTo (QWidget *parent, const QPoint &pos) const
 mapToGlobal (const QPoint &pos) const
 mapToParent (const QPoint &pos) const
 maximumHeight () const
 maximumSize () const
 maximumWidth () const
 metric (int m) const
 microFocusHint () const
 minimumHeight () const
 minimumSize () const
 minimumSizeHint () const
 minimumWidth () const
 mouseDoubleClickEvent (QMouseEvent *e)
 mouseGrabber ()
 mouseMoveEvent (QMouseEvent *e)
virtual void mousePressEvent (QMouseEvent *e)
 overrides the inherited virtual function.
 mouseReleaseEvent (QMouseEvent *e)
 move (const QPoint &)
 move (int x, int y)
 moveEvent (QMoveEvent *)
 ownCursor () const
 ownFont () const
 ownPalette () const
virtual void paintEvent (QPaintEvent *)
 Overrides virtual function of QWidget to do drawing.
 palette () const
 paletteBackgroundColor () const
 paletteBackgroundPixmap () const
 paletteChange (const QPalette &oldPalette)
 paletteForegroundColor () const
 parentWidget (bool sameWindow=FALSE) const
 polish ()
 pos () const
 prop -the y coordinate of the widget relative to its parent and including any window frame
 prop -the x coordinate of the widget relative to its parent including any window frame
 prop -the level of opacity for the window
 prop -the width of the widget excluding any window frame
 prop -whether the widget is visible
 prop -whether updates are enabled
 prop -whether the widget is under the mouse cursor
 prop -the default layout behavior of the widget
 prop -the size increment of the widget
 prop -the recommended size for the widget
 prop -the size of the widget excluding any window frame
 prop -whether the widget is shown
 prop -the internal geometry of the widget excluding any window frame
 prop -the position of the widget within its parent widget
 prop -the foreground color of the widget
 prop -the background pixmap of the widget
 prop -the background color of the widget
 prop -the widget's palette
 prop -whether the widget uses its own palette
 prop -whether the widget uses its own font
 prop -whether the widget uses its own cursor
 prop -whether mouse tracking is enabled for the widget
 prop -the widget's minimum width
 prop -the recommended minimum size for the widget
 prop -the widget's minimum size
 prop -the widget's minimum height
 prop -whether this widget is minimized(iconified)
 prop -the currently set micro focus hint for this widget
 prop -the widget's maximum width
 prop -the widget's maximum size
 prop -the widget's maximum height
 prop -whether this widget is maximized
 prop -whether the widget is a top-level widget
 prop -whether the widget is a popup widget
 prop -whether the widget is a modal widget
 prop -whether the widget is a dialog widget
 prop -whether the widget is a desktop widget, i.e.represents the desktop
 prop -whether this widget is the active window
 prop -enables or disables the use of input methods for this widget
 prop -the widget's icon text
 prop -the widget's icon
 prop -whether the widget is explicitly hidden
 prop -the height of the widget excluding any window frame
 prop -the geometry of the widget relative to its parent and excluding the window frame
 prop -whether the widget is full screen
 prop -the size of the widget including any window frame
 prop -geometry of the widget relative to its parent including any window frame
 prop -the font currently set for the widget
 prop -the way the widget accepts keyboard focus
 prop -whether the widget accepts keyboard focus
 prop -whether this widget(or its focus proxy) has the keyboard input focus
 prop -whether the widget is enabled
 prop -whether the widget wants to handle What's This help manually
 prop -the cursor shape for this widget
 prop -the current color group of the widget palette
 prop -the combined region occupied by the widget's children
 prop -the bounding rectangle of the widget's children
 prop -the window caption(title)
 prop -the base size of the widget
 prop -the origin of the widget's background
 prop -the color role used for painting the background of the widget
 prop -the widget's background brush
 prop -whether the auto mask feature is enabled for the widget
 prop -whether drop events are enabled for this widget
 QtViewWidget (QWidget *parent=0, const char *name=0, Qt::WFlags wflags=0)
 The standard QWidget constructor.
 qwsEvent (QWSEvent *)
 raise ()
 rect () const
 releaseKeyboard ()
 releaseMouse ()
 repaint (const QRegion &reg, bool erase=TRUE)
 repaint (const QRect &r, bool erase=TRUE)
 repaint (int x, int y, int w, int h, bool erase=TRUE)
 repaint (bool erase)
 repaint ()
 reparent (QWidget *parent, const QPoint &p, bool showIt=FALSE)
 reparent (QWidget *parent, WFlags f, const QPoint &p, bool showIt=FALSE)
 resetInputContext ()
 resize (const QSize &)
 resize (int w, int h)
 resizeEvent (QResizeEvent *)
 scroll (int dx, int dy, const QRect &r)
 scroll (int dx, int dy)
 setAcceptDrops (bool on)
 setActiveWindow ()
 setAutoMask (bool)
 setBackgroundMode (BackgroundMode m, BackgroundMode visual)
 setBackgroundMode (BackgroundMode)
 setBackgroundOrigin (BackgroundOrigin)
 setBaseSize (int basew, int baseh)
 setBaseSize (const QSize &)
 setCaption (const QString &)
void setCrossX (double val)
 Set the crossX value.
void setCrossY (double val)
 Set the crossY value.
 setCursor (const QCursor &)
virtual void setDefaultFont (const QFont &font)
 setDisabled (bool disable)
virtual void setDoubleBuffering (unsigned dblbuf)
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.
 setEnabled (bool)
 setEraseColor (const QColor &color)
 setErasePixmap (const QPixmap &pixmap)
 setFixedHeight (int h)
 setFixedSize (int w, int h)
 setFixedSize (const QSize &s)
 setFixedWidth (int w)
 setFocus ()
 setFocusPolicy (FocusPolicy)
 setFocusProxy (QWidget *w)
 setFont (const QFont &)
 setGeometry (const QRect &)
 setGeometry (int x, int y, int w, int h)
 setHidden (bool hide)
 setIcon (const QPixmap &)
 setIconText (const QString &)
 setInputMethodEnabled (bool b)
void setInspector (QObject *)
 Sets the receiver of update messages.
 setKeyCompression (bool compress)
 setMask (const QRegion &region)
 setMask (const QBitmap &bitmap)
 setMaximumHeight (int maxh)
 setMaximumSize (int maxw, int maxh)
 setMaximumSize (const QSize &)
 setMaximumWidth (int maxw)
 setMicroFocusHint (int x, int y, int width, int height, bool text=TRUE, QFont *f=0)
 setMinimumHeight (int minh)
 setMinimumSize (int minw, int minh)
 setMinimumSize (const QSize &)
 setMinimumWidth (int minw)
 setMouseTracking (bool enable)
 setPalette (const QPalette &)
 setPaletteBackgroundColor (const QColor &)
 setPaletteBackgroundPixmap (const QPixmap &)
 setPaletteForegroundColor (const QColor &)
void setPlotter (PlotterBase *)
 Re-implements inherited member to test something for SIP.
 setShown (bool show)
 setSizeIncrement (int w, int h)
 setSizeIncrement (const QSize &)
 setSizePolicy (QSizePolicy::SizeType hor, QSizePolicy::SizeType ver, bool hfw=FALSE)
 setSizePolicy (QSizePolicy)
 setStyle (const QString &style)
 setStyle (QStyle *style)
 setTabOrder (QWidget *first, QWidget *second)
 setUpdatesEnabled (bool enable)
 setWFlags (WFlags f)
 setWindowOpacity (double level)
 setWindowState (uint windowState)
 show ()
 showEvent (QShowEvent *)
 showFullScreen ()
 showMaximized ()
 showMinimized ()
 showNormal ()
 size () const
virtual QSize sizeHint () const
 Re-implements inherited member to return a reasonable size.
 sizeIncrement () const
 sizePolicy () const
 stackUnder (QWidget *w)
 style () const
 styleChange (QStyle &oldStyle)
 tabletEvent (QTabletEvent *e)
 testWFlags (WFlags f) const
 topLevelWidget () 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.
 unsetCursor ()
 unsetFont ()
 unsetPalette ()
 update (const QRect &r)
 update (int x, int y, int w, int h)
 update ()
virtual void update (const Observable *)
 Responds to update message from Observable.
 updateGeometry ()
 updateMask ()
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.
 wheelEvent (QWheelEvent *e)
 width () const
virtual void willDelete (const Observable *)
 Notifies this Observer object that one of its Observable objects is about to be deleted.
 windowActivationChange (bool oldActive)
 windowOpacity () const
 windowState () const
 winEvent (MSG *)
 winId () const
 x () const
 x11Event (XEvent *)
 y () const
virtual ~QtViewWidget ()
 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.
 QtViewWidget (const QtViewWidget &)
 The copy constructor.
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(QtViewWidget::*xfunc)(double) const, int(QtViewWidget::*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

int double_buffer
QPixmap offscr


Constructor & Destructor Documentation

QtViewWidget::QtViewWidget const QtViewWidget  )  [private]
 

The copy constructor.

QtViewWidget::QtViewWidget QWidget parent = 0,
const char *  name = 0,
Qt::WFlags  wflags = 0
 

The standard QWidget constructor.

See Qt documentation for details.

Definition at line 38 of file QtViewWidget.cxx.

References setDoubleBuffering(), QWidget::setGeometry(), and QWidget::setPaletteBackgroundColor().

QtViewWidget::~QtViewWidget  )  [virtual]
 

The required virtual destructor.

Definition at line 48 of file QtViewWidget.cxx.


Member Function Documentation

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

Definition at line 913 of file QtViewImp.cxx.

References QtViewImp::m_font_default.

void QtViewWidget::draw QPainter  )  [virtual]
 

Reimplements the inherited function.

First calls base class to draw the contents and then draws the border if selected.

Definition at line 68 of file QtViewWidget.cxx.

References ViewBase::drawSelf(), and QtViewImp::m_painter.

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 QtViewWidget::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 216 of file QtViewWidget.cxx.

References QPainter::drawPolyline(), QtViewImp::m_painter, QWidget::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 draw(), QtView::draw(), QtView::drawWithPixmap(), OpenGLWindow::paint(), and paintEvent().

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 QtViewWidget::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 199 of file QtViewWidget.cxx.

References QPainter::drawLineSegments(), QtViewImp::m_painter, QWidget::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 QtViewWidget::endPlot  )  [virtual]
 

Finalizes the plot view by unlocking the QApplication.

Reimplemented from QtViewImp.

Definition at line 145 of file QtViewWidget.cxx.

void QtViewWidget::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 161 of file QtViewWidget.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 QtView::drawWithPixmap().

HippoRectangle QtViewWidget::getDrawRect  )  const [virtual]
 

Overrides virtual function of ViewBase.

Implements ViewBase.

Definition at line 100 of file QtViewWidget.cxx.

References QWidget::geometry(), QRect::height(), QWidget::rect(), and QRect::width().

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 QtViewWidget::initPlot double  aspect  )  [virtual]
 

Initializes the plot view by locking the QApplication.

Implements ViewBase.

Definition at line 131 of file QtViewWidget.cxx.

References setDrawRect(), QWidget::width(), QWidget::x(), and QWidget::y().

void QtViewWidget::mousePressEvent QMouseEvent e  )  [virtual]
 

overrides the inherited virtual function.

If the event is a mouse event with control key down, then toggles the active DataRep. Otherwise, passes passes the event to QObject.

Reimplemented from QWidget.

Definition at line 241 of file QtViewWidget.cxx.

References ViewBase::m_plotter.

void QtViewWidget::paintEvent QPaintEvent  )  [virtual]
 

Overrides virtual function of QWidget to do drawing.

Reimplemented from QWidget.

Definition at line 76 of file QtViewWidget.cxx.

References double_buffer, ViewBase::drawSelf(), QRect::isValid(), QtViewImp::m_painter, ViewBase::m_plotter, QwtPaintBuffer::painter(), and QPaintEvent::rect().

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 QtViewWidget::setDoubleBuffering unsigned  dblbuf  )  [virtual]
 

Definition at line 234 of file QtViewWidget.cxx.

References double_buffer.

Referenced by QtViewWidget().

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

Sets the drawing rectangle in the paint device space.

Implements ViewBase.

Definition at line 121 of file QtViewWidget.cxx.

References QWidget::setGeometry().

void QtViewWidget::setDrawRect const QRect rect  ) 
 

Sets the drawing rectangle in the paint device space.

Definition at line 116 of file QtViewWidget.cxx.

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

Referenced by 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 QtViewWidget::setPlotter PlotterBase  )  [virtual]
 

Re-implements inherited member to test something for SIP.

Attention:
Shouldn't really need to do this. But if it isn't here, then we have to get SIP to accept the ViewBase class. The problem with that is getting SIP to accept all the argument type of all the pure virtual functions. Until that is done, this implementation gives a way out.

Reimplemented from ViewBase.

Definition at line 62 of file QtViewWidget.cxx.

References ViewBase::setPlotter().

QSize QtViewWidget::sizeHint  )  const [virtual]
 

Re-implements inherited member to return a reasonable size.

Reimplemented from QWidget.

Definition at line 55 of file QtViewWidget.cxx.

References QWidget::size().

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

Converts coordinate from view space to canvas space.

Implements QtViewImp.

Definition at line 167 of file QtViewWidget.cxx.

Referenced by drawViewMethod().

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

Converts coordinate from view space to canvas space.

Implements QtViewImp.

Definition at line 172 of file QtViewWidget.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 QtViewWidget::toViewX double  datX  )  const [virtual]
 

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

Implements QtViewImp.

Definition at line 149 of file QtViewWidget.cxx.

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

Referenced by drawMethod().

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

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

Implements QtViewImp.

Definition at line 154 of file QtViewWidget.cxx.

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

Referenced by drawMethod().

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

Definition at line 179 of file QtViewWidget.cxx.

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

Referenced by drawMethod(), and drawViewMethod().

void QtViewWidget::update const Observable  )  [virtual]
 

Responds to update message from Observable.

Reimplemented from QtViewImp.

Definition at line 107 of file QtViewWidget.cxx.

References QWidget::update(), and QtViewImp::update().

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

int QtViewWidget::double_buffer [private]
 

Definition at line 77 of file QtViewWidget.h.

Referenced by paintEvent(), and setDoubleBuffering().

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

QPainter* QtViewImp::m_painter [protected, inherited]
 

The current Qt QPainter object.

Definition at line 65 of file QtViewImp.h.

Referenced by draw(), QtView::draw(), QtViewImp::draw_Text(), QtViewImp::drawColorLines(), QtViewImp::drawLines(), QtViewImp::drawMag(), drawMethod(), QtViewImp::drawMethod(), QtView::drawMethod(), QtViewImp::drawPoints(), QtViewImp::drawPolyLine(), QtViewImp::drawSquare(), QtViewImp::drawViewLines(), drawViewMethod(), QtViewImp::drawViewMethod(), QtView::drawViewMethod(), QtViewImp::drawViewSquare(), QtView::drawWithPixmap(), and 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(), fillPickedPoint(), QtView::fillPickedPoint(), ViewBase::getAspectRatio(), ViewBase::getMarginRect(), QtViewImp::getMarginRect(), ViewBase::getPlotter(), ViewBase::getRange(), ViewBase::getUserRect(), mousePressEvent(), paintEvent(), QtView::QtView(), QtViewImp::setCrossX(), QtViewImp::setCrossY(), ViewBase::setPlotter(), toViewX(), QtView::toViewX(), OpenGLView::toViewX(), EpsView::toViewX(), toViewY(), QtView::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::~QtView().

QPixmap QtViewWidget::offscr [private]
 

Definition at line 76 of file QtViewWidget.h.


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