EpsView Class Reference

#include <EpsView.h>

Inheritance diagram for EpsView:

Inheritance graph
DataViewViewBaseObserver
[legend]
Collaboration diagram for EpsView:

Collaboration graph
DataViewViewBaseObserverPlotterBaseObservableSizePointRect
[legend]

List of all members.


Detailed Description

The class of views for Encapsulated Postscript generation.

Author:
Sanket Biren Malde <sanket@stanford.edu>

Definition at line 27 of file EpsView.h.


Public Member Functions

virtual void closeFile ()
 Terminate the PostScript file.
virtual void drawColorLines (const std::vector< double > &x, const std::vector< double > &y, hippodraw::Line::Style style, const std::vector< Color > &color, 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 drawImage (const std::string &filename, int position=0)
 Draws a image.
virtual void drawLatex (const std::string &eq, int position=0)
 Draws a Latex equation.
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 drawPoints (const std::vector< double > &x, const std::vector< double > &y, const std::vector< Color > &colors, hippodraw::Symbol::Type type, float sym_size)
 Draws symbol points.
virtual void drawPoints (const std::vector< double > &x, const std::vector< double > &y, hippodraw::Symbol::Type type, float sym_size, const Color &color)
 Draws symbol points.
virtual void drawPolygon (const std::vector< double > &xpoints, const std::vector< double > &ypoints, const Color &color, const Color &edge)
 Draws a polygon.
virtual void drawPolyLine (const std::vector< double > &xpoints, const std::vector< double > &ypoints, hippodraw::Line::Style style, const Color &color, float size)
 Draws a polyline.
virtual void drawSelf ()
 Draws itself.
virtual void drawSquare (double x1, double y1, double x2, double y2, int red, int green, int blue)
 Draws a colored square.
virtual void drawText (const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp, bool resize, const FontBase *font, const Color *color)
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)
virtual void drawViewSquare (float x1, float y1, float x2, float y2, int red, int green, int blue)
 Draws a colored square in view space.
 EpsView (const std::string file, double x, double y, double w, double h)
 Creates an EpsView attached to file with a bounding rectangle.
virtual double getAspectRatio () const
 Get the aspect ratio.
virtual Rect getDrawRect () const
 Returns the drawing Rectangle in the devices coordinate system.
const RectgetMarginRect () const
 Returns the rectangle area in which data points are drawn.
PlotterBasegetPlotter ()
 Returns the plotter used by this view.
PlotterBasegetPlotter () const
 Returns the plotter used by this view.
const RangegetRange (Axes::Type axis) const
 Returns the range of the data space on specified axis.
const RectgetRawRect () const
 Returns the rectangle before transform.
const RectgetUserRect () const
 Is called by the AxisRepBase object (or one of its derived objects), and returns the rectangle where the drawing is made.
virtual void setDrawRect (float x, float y, float w, float h)
 Sets the drawing Rectangle in the devices coordinate system.
void setMarginRect (const Rect &)
 Sets the margin rectangle.
virtual void setPlotter (PlotterBase *plotter)
 Sets the PlotterBase object to plotter.
float toViewX (double datX) const
float toViewY (double datY) const
float toX (double x) const
float toY (double y) const
virtual void update (const Observable *)
 Implements the update method of the Observer pattern.
virtual void updateDrawRect ()
 Update the drawing Rectangle in the devices coordinate system.
float userToDrawColor (double c) const
float userToDrawX (double x) const
float userToDrawXAutoInv (double x) const
float userToDrawY (double x) const
virtual void willDelete (const Observable *plotter)
 Responds to notification that the PlotterBase object is being deleted.
virtual ~EpsView ()

Protected Member Functions

virtual double marginToInvertedUserX (double x) const
 Converts from view coordinate to data conordiate, take into account the inversion of x axes.
virtual double marginToInvertedUserY (double y) const
 Converts from inverted view coordinate to data coordinate, without taking into account transforms or scaling.
virtual double marginToUserX (double x) const
 Converts from view coordinate to data coordinate, without taking into account transforms or scaling.
virtual double marginToUserY (double y) const
 Converts from view coordinate to data coordinate, without taking into account transforms or scaling.
void prepareMarginRect ()
 Prepares the margin rectangle.
virtual float userToInvertedMarginX (double x) const
 Converts the user X coordinate into the inverted X coordinate.
virtual float userToInvertedMarginY (double y) const
 Converts the user Y coordinate into the top-left based margin Y coordinate.
virtual float userToMarginColor (double c) const
 Converts the user Z coordinate into the margin color (X) coordinate.
virtual float userToMarginX (double x) const
 Converts the user X coordinate into the margin X coordinate.
virtual float userToMarginY (double y) const
 Converts the user Y coordinate into the margin Y coordinate.

Protected Attributes

Rect m_margin_rect
 The rectangle area in which the projected points are plotted.
PlotterBasem_plotter
 The plotter object used by this view.

Private Member Functions

virtual void draw_Text (const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp, const FontBase *)
void drawSymbol (hippodraw::Symbol::Type type, double x, double y, float size)
 Draws a symbol.
 EpsView (const EpsView &)
void initPlot (const std::string &filename, double x, double y, double w, double h)
 Initializes data for the EPSF file generation.
void lineTo (double x, double y)
 Does a PostScript lineto.
void moveTo (double x, double y)
 Does a PostScript moveto.
void setDash (hippodraw::Line::Style style)
 Uses PostScript setdash to set the line style.
void setLineWidth (double size)
 Sets the line width with PostScript setlinewidth.
void setRgbColor (int red, int green, int blue)
 Does a PostScript setrgbcolor.
void setRgbColor (const Color &color)
 Does a PostScript setrgbcolor.

Private Attributes

Rect m_boundingRect
Rect m_draw_rect
std::ofstream m_outfile

Constructor & Destructor Documentation

EpsView ( const EpsView  )  [private]

EpsView ( const std::string  file,
double  x,
double  y,
double  w,
double  h 
)

Creates an EpsView attached to file with a bounding rectangle.

Definition at line 35 of file EpsView.cxx.

References EpsView::initPlot().

~EpsView (  )  [virtual]

Definition at line 43 of file EpsView.cxx.


Member Function Documentation

void closeFile (  )  [virtual]

Terminate the PostScript file.

Definition at line 149 of file EpsView.cxx.

References EpsView::m_outfile.

void draw_Text ( const std::string &  s,
float  x,
float  y,
float  fontsize,
float  angle,
char  xp,
char  yp,
const FontBase font 
) [private, virtual]

Bug:
Text size doesn't come out the same as on screen.

Definition at line 497 of file EpsView.cxx.

References EpsView::m_outfile, and num_util::size().

Referenced by EpsView::drawText().

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

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

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

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

style the line style.

color The RGB values for the color of the line.

size The thickness of the line.

Implements ViewBase.

Definition at line 187 of file EpsView.cxx.

References hippodraw::Line::Invisible, EpsView::lineTo(), EpsView::m_outfile, EpsView::moveTo(), EpsView::setDash(), EpsView::setLineWidth(), EpsView::setRgbColor(), EpsView::toViewX(), and EpsView::toViewY().

void drawImage ( const std::string &  filename,
int  position = 0 
) [virtual, inherited]

Draws a image.

This is called by drawLatex. Meaning of position: 0.Full 1.Top 2.Bottom 3.Left TODO: use enum for position.

Reimplemented in QtViewImp.

Definition at line 112 of file ViewBase.cxx.

void drawLatex ( const std::string &  eq,
int  position = 0 
) [virtual, inherited]

Draws a Latex equation.

This function will call drawImage. Meaning of position: 0.Full 1.Top 2.Bottom 3.Left

Reimplemented in QtViewImp.

Definition at line 119 of file ViewBase.cxx.

Referenced by BoxTextRep::drawProjectedValues(), AxisRepBase::drawTitle(), AxisRepBase::drawXLabels(), AxisRepBase::drawYLabels(), and AxisRepColor::drawZLabels().

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

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

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

Implements ViewBase.

Definition at line 155 of file EpsView.cxx.

References hippodraw::Line::Invisible, EpsView::lineTo(), EpsView::m_outfile, EpsView::moveTo(), EpsView::setDash(), EpsView::setLineWidth(), EpsView::setRgbColor(), EpsView::toViewX(), and EpsView::toViewY().

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]

Draws symbol points.

x and y are the coordinates, type is the type of symbol, and sym_size is the size. hue is the hue parameters for each point. The saturation and brightness are set to 1.0.

Implements ViewBase.

Definition at line 455 of file EpsView.cxx.

References EpsView::drawSymbol(), hippodraw::Symbol::FILLED_CIRCLE, hippodraw::Symbol::FILLED_TRIANGLE, EpsView::m_outfile, EpsView::setRgbColor(), and hippodraw::Symbol::SOLIDSQUARE.

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

Draws symbol points.

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

Implements ViewBase.

Definition at line 413 of file EpsView.cxx.

References EpsView::drawSymbol(), hippodraw::Symbol::FILLED_CIRCLE, hippodraw::Symbol::FILLED_TRIANGLE, EpsView::m_outfile, EpsView::setRgbColor(), and hippodraw::Symbol::SOLIDSQUARE.

void drawPolygon ( const std::vector< double > &  xpoints,
const std::vector< double > &  ypoints,
const Color color,
const Color edge 
) [virtual, inherited]

Draws a polygon.

xpoints points along the X axis. ypoints points along the Y axis. color The color.

Reimplemented in QtViewImp.

Definition at line 126 of file ViewBase.cxx.

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

Draws a polyline.

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

Implements ViewBase.

Definition at line 280 of file EpsView.cxx.

References hippodraw::Line::Invisible, EpsView::lineTo(), EpsView::m_outfile, EpsView::moveTo(), EpsView::setDash(), EpsView::setLineWidth(), EpsView::setRgbColor(), EpsView::toViewX(), and EpsView::toViewY().

void drawSelf (  )  [virtual, inherited]

Draws itself.

Definition at line 60 of file ViewBase.cxx.

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

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

void drawSquare ( double  x1,
double  y1,
double  x2,
double  y2,
int  red,
int  green,
int  blue 
) [virtual]

Draws a colored square.

Used for shading on the cuts and the gray plot.

Implements ViewBase.

Definition at line 316 of file EpsView.cxx.

References EpsView::lineTo(), EpsView::m_outfile, EpsView::moveTo(), EpsView::setRgbColor(), EpsView::toViewX(), and EpsView::toViewY().

void drawSymbol ( hippodraw::Symbol::Type  type,
double  x,
double  y,
float  size 
) [private]

Draws a symbol.

Draws the symbol at x and y of type type and size size.

Definition at line 360 of file EpsView.cxx.

References hippodraw::Symbol::CIRCLE, hippodraw::Symbol::FILLED_CIRCLE, hippodraw::Symbol::FILLED_TRIANGLE, EpsView::lineTo(), EpsView::m_outfile, EpsView::moveTo(), hippodraw::Symbol::PLUS, hippodraw::Symbol::SOLIDSQUARE, hippodraw::Symbol::SQUARE, hippodraw::Symbol::TIMES, EpsView::toViewX(), EpsView::toViewY(), and hippodraw::Symbol::TRIANGLE.

Referenced by EpsView::drawPoints().

void drawText ( const std::string &  s,
float  x,
float  y,
float  fontsize,
float  angle,
char  xp,
char  yp,
bool  resize,
const FontBase font,
const Color color 
) [virtual]

Bug:
@@@ Does not use color value.

Does not use the resize parameter.

Implements ViewBase.

Definition at line 558 of file EpsView.cxx.

References EpsView::draw_Text(), EpsView::m_outfile, EpsView::toX(), and EpsView::toY().

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

Draws multiple line segments.

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

Implements ViewBase.

Definition at line 249 of file EpsView.cxx.

References hippodraw::Line::Invisible, EpsView::lineTo(), EpsView::m_outfile, EpsView::moveTo(), EpsView::setDash(), EpsView::setLineWidth(), EpsView::setRgbColor(), EpsView::toX(), and EpsView::toY().

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

Bug:
Does not use the color parameter

Implements ViewBase.

Definition at line 219 of file EpsView.cxx.

References hippodraw::Line::Invisible, EpsView::lineTo(), EpsView::m_outfile, EpsView::moveTo(), EpsView::setDash(), EpsView::setLineWidth(), EpsView::toX(), and EpsView::toY().

void drawViewSquare ( float  x1,
float  y1,
float  x2,
float  y2,
int  red,
int  green,
int  blue 
) [virtual]

Draws a colored square in view space.

Used for shading on the cuts and the gray plot.

Implements ViewBase.

Definition at line 337 of file EpsView.cxx.

References EpsView::lineTo(), EpsView::m_outfile, EpsView::moveTo(), EpsView::setRgbColor(), EpsView::toX(), and EpsView::toY().

double getAspectRatio (  )  const [virtual, inherited]

Get the aspect ratio.

Definition at line 88 of file ViewBase.cxx.

References ViewBase::m_plotter.

Referenced by CanvasView::contentsMouseMoveEvent(), DataView::prepareMarginRect(), QtViewWidget::update(), and QtView::updateDrawRect().

Rect getDrawRect (  )  const [virtual]

Returns the drawing Rectangle in the devices coordinate system.

Must be implemented in derived class.

Implements ViewBase.

Definition at line 603 of file EpsView.cxx.

References EpsView::m_draw_rect.

const Rect & getMarginRect (  )  const [inherited]

Returns the rectangle area in which data points are drawn.

Definition at line 45 of file DataView.cxx.

References DataView::m_margin_rect.

Referenced by AxisRepColor::drawColorScale(), ContourPointRep::drawContourTicks(), QtViewImp::drawImage(), AxisRepBase::drawReferencePoint(), AxisRepBase::drawTitle(), AxisRepBase::drawXLabels(), AxisRepBase::drawXMag(), AxisRepBase::drawXTickLabels(), AxisRepBase::drawXTickLines(), AxisRepBase::drawYLabels(), AxisRepBase::drawYMag(), AxisRepBase::drawYTickLines(), AxisRepColor::drawZLabels(), AxisRepColor::drawZTickLabels(), AxisRepColor::drawZTickLines(), OpenGLView::toViewY(), and EpsView::toViewY().

PlotterBase * getPlotter (  )  [inherited]

Returns the plotter used by this view.

Definition at line 55 of file ViewBase.cxx.

References ViewBase::m_plotter.

PlotterBase * 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::contentsMouseMoveEvent(), CanvasView::controlMousePressEvent(), ViewBaseXML::createChild(), DisplayController::createTextView(), AxisRepColor::drawColorScale(), CanvasView::fillPlotterList(), CutController::fillTupleCutList(), PyCanvas::getDisplays(), GroupViewBase::getPlotters(), CanvasView::getViewFor(), PlotTable::initialize(), FigureEditor::movePlotterWithText(), CanvasView::placeItems(), DataView::prepareMarginRect(), DisplayController::removeTextObservers(), PyCanvas::saveAsImage(), CanvasView::saveSelectedAsEps(), CanvasView::setIntervalEnabled(), and CanvasView::viewShowPickTable().

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

Returns the range of the data space on specified axis.

Definition at line 69 of file ViewBase.cxx.

References ViewBase::m_plotter.

Referenced by ContourPointRep::drawContourTicks().

const Rect & getRawRect (  )  const [inherited]

Returns the rectangle before transform.

Definition at line 83 of file ViewBase.cxx.

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

const Rect & 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 76 of file ViewBase.cxx.

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

Referenced by ContourPointRep::drawValues(), ContourPointRep::drawValuesWithStyle(), AxisRepBase::initAxisRect(), DataView::marginToInvertedUserX(), DataView::marginToInvertedUserY(), DataView::marginToUserX(), DataView::marginToUserY(), DataView::userToInvertedMarginX(), DataView::userToInvertedMarginY(), DataView::userToMarginColor(), DataView::userToMarginX(), and DataView::userToMarginY().

void initPlot ( const std::string &  fname,
double  x,
double  y,
double  w,
double  h 
) [private]

Initializes data for the EPSF file generation.

filename is the name of the file. The x, y, w, and h are the x, y, width and height of the bounding rectangle.

Todo:
Using std::endl; add '
' and flushes the buffer. We don't need to flush the buffer so often, so maybe just '
' should be used.

Definition at line 111 of file EpsView.cxx.

References EpsView::m_outfile.

Referenced by EpsView::EpsView().

void lineTo ( double  x,
double  y 
) [private]

Does a PostScript lineto.

Definition at line 49 of file EpsView.cxx.

References EpsView::m_outfile.

Referenced by EpsView::drawColorLines(), EpsView::drawLines(), EpsView::drawPolyLine(), EpsView::drawSquare(), EpsView::drawSymbol(), EpsView::drawViewLines(), and EpsView::drawViewSquare().

double marginToInvertedUserX ( double  x  )  const [protected, virtual, inherited]

Converts from view coordinate to data conordiate, take into account the inversion of x axes.

Definition at line 187 of file DataView.cxx.

References ViewBase::getUserRect(), Rect::getWidth(), Rect::getX(), DataView::m_margin_rect, and ViewBase::m_plotter.

Referenced by QtView::fillPickedPoint().

double marginToInvertedUserY ( double  y  )  const [protected, virtual, inherited]

Converts from inverted view coordinate to data coordinate, without taking into account transforms or scaling.

Definition at line 209 of file DataView.cxx.

References Rect::getHeight(), ViewBase::getUserRect(), Rect::getY(), DataView::m_margin_rect, and ViewBase::m_plotter.

Referenced by QtViewWidget::fillPickedPoint(), and QtView::fillPickedPoint().

double marginToUserX ( double  x  )  const [protected, virtual, inherited]

Converts from view coordinate to data coordinate, without taking into account transforms or scaling.

Definition at line 176 of file DataView.cxx.

References ViewBase::getUserRect(), Rect::getWidth(), Rect::getX(), DataView::m_margin_rect, and ViewBase::m_plotter.

Referenced by QtViewWidget::fillPickedPoint(), and QtView::fillPickedPoint().

double marginToUserY ( double  y  )  const [protected, virtual, inherited]

Converts from view coordinate to data coordinate, without taking into account transforms or scaling.

Definition at line 198 of file DataView.cxx.

References Rect::getHeight(), ViewBase::getUserRect(), Rect::getY(), DataView::m_margin_rect, and ViewBase::m_plotter.

void moveTo ( double  x,
double  y 
) [private]

Does a PostScript moveto.

Definition at line 56 of file EpsView.cxx.

References EpsView::m_outfile.

Referenced by EpsView::drawColorLines(), EpsView::drawLines(), EpsView::drawPolyLine(), EpsView::drawSquare(), EpsView::drawSymbol(), EpsView::drawViewLines(), and EpsView::drawViewSquare().

void prepareMarginRect (  )  [protected, inherited]

Prepares the margin rectangle.

Attention:
In the implementation, make sure the left margin stops growing at same time maximum Y tick labels stop growing.

Definition at line 62 of file DataView.cxx.

References ViewBase::getAspectRatio(), PlotterBase::getBottomMargin(), ViewBase::getDrawRect(), Rect::getHeight(), PlotterBase::getLeftMargin(), ViewBase::getPlotter(), PlotterBase::getTopMargin(), Rect::getWidth(), PlotterBase::getZMargin(), PlotterBase::labelFont(), DataView::m_margin_rect, ViewBase::m_plotter, FontBase::pointSize(), Rect::setRect(), PlotterBase::titleFont(), hippodraw::Axes::X, and hippodraw::Axes::Z.

Referenced by QtViewWidget::paintEvent(), QtViewWidget::resizeEvent(), QtView::setDrawRect(), QtViewWidget::setGeometry(), and QtViewWidget::update().

void setDash ( hippodraw::Line::Style  style  )  [private]

Uses PostScript setdash to set the line style.

Definition at line 63 of file EpsView.cxx.

References hippodraw::Line::Dash, hippodraw::Line::DashDot, hippodraw::Line::Dot, EpsView::m_outfile, and hippodraw::Line::Solid.

Referenced by EpsView::drawColorLines(), EpsView::drawLines(), EpsView::drawPolyLine(), and EpsView::drawViewLines().

void setDrawRect ( float  x,
float  y,
float  w,
float  h 
) [virtual]

Sets the drawing Rectangle in the devices coordinate system.

Implements ViewBase.

Definition at line 608 of file EpsView.cxx.

References EpsView::m_draw_rect, and Rect::setRect().

void setLineWidth ( double  size  )  [private]

Sets the line width with PostScript setlinewidth.

Definition at line 86 of file EpsView.cxx.

References EpsView::m_outfile.

Referenced by EpsView::drawColorLines(), EpsView::drawLines(), EpsView::drawPolyLine(), and EpsView::drawViewLines().

void setMarginRect ( const Rect rect  )  [inherited]

Sets the margin rectangle.

Sets the rectangular are in which the data points are drawn. The coordinate system is that of the view.

Definition at line 52 of file DataView.cxx.

References DataView::m_margin_rect.

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

void setRgbColor ( int  red,
int  green,
int  blue 
) [private]

Does a PostScript setrgbcolor.

Converts integer 0 to 255 scale to PostScript float 0. to 1. scale and sets the RGB color.

Definition at line 93 of file EpsView.cxx.

References EpsView::m_outfile.

void setRgbColor ( const Color color  )  [private]

Does a PostScript setrgbcolor.

Converts integer 0 to 255 scale of the Color object to PostScript float 0. to 1. scale and sets the RGB color.

Definition at line 103 of file EpsView.cxx.

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

Referenced by EpsView::drawColorLines(), EpsView::drawLines(), EpsView::drawPoints(), EpsView::drawPolyLine(), EpsView::drawSquare(), EpsView::drawViewLines(), and EpsView::drawViewSquare().

float toViewX ( double  datX  )  const

Definition at line 613 of file EpsView.cxx.

References Rect::getX(), EpsView::m_boundingRect, EpsView::m_draw_rect, and DataView::userToMarginX().

Referenced by EpsView::drawColorLines(), EpsView::drawLines(), EpsView::drawPolyLine(), EpsView::drawSquare(), and EpsView::drawSymbol().

float toViewY ( double  datY  )  const

Definition at line 622 of file EpsView.cxx.

References Rect::getHeight(), DataView::getMarginRect(), Rect::getY(), EpsView::m_boundingRect, EpsView::m_draw_rect, and DataView::userToMarginY().

Referenced by EpsView::drawColorLines(), EpsView::drawLines(), EpsView::drawPolyLine(), EpsView::drawSquare(), and EpsView::drawSymbol().

float toX ( double  x  )  const

Definition at line 646 of file EpsView.cxx.

References Rect::getX(), EpsView::m_boundingRect, and EpsView::m_draw_rect.

Referenced by EpsView::drawText(), EpsView::drawViewLines(), and EpsView::drawViewSquare().

float toY ( double  y  )  const

Definition at line 653 of file EpsView.cxx.

References Rect::getHeight(), Rect::getY(), EpsView::m_boundingRect, and EpsView::m_draw_rect.

Referenced by EpsView::drawText(), EpsView::drawViewLines(), and EpsView::drawViewSquare().

void update ( const Observable  )  [virtual]

Implements the update method of the Observer pattern.

Derived classes should send a message to what ever object is the parent of this ViewBase object.

Implements ViewBase.

Definition at line 570 of file EpsView.cxx.

void updateDrawRect (  )  [virtual, inherited]

Update the drawing Rectangle in the devices coordinate system.

Reimplemented in QtView.

Definition at line 105 of file ViewBase.cxx.

Referenced by XyPlotter::drawIn().

float userToDrawColor ( double  c  )  const [virtual]

Todo:
Could eliminate userToMargincolor.

Implements ViewBase.

Definition at line 598 of file EpsView.cxx.

References DataView::userToMarginColor().

float userToDrawX ( double  x  )  const [virtual]

Todo:
Could eliminated userToMarginX.

Implements ViewBase.

Definition at line 576 of file EpsView.cxx.

References DataView::userToMarginX().

float userToDrawXAutoInv ( double  x  )  const [virtual]

Implements ViewBase.

Definition at line 581 of file EpsView.cxx.

References ViewBase::m_plotter, DataView::userToInvertedMarginX(), and DataView::userToMarginX().

float userToDrawY ( double  y  )  const [virtual]

Todo:
Could eliminate userToInvertedMarginY.

Implements ViewBase.

Definition at line 591 of file EpsView.cxx.

References DataView::userToInvertedMarginY().

float userToInvertedMarginX ( double  x  )  const [protected, virtual, inherited]

Converts the user X coordinate into the inverted X coordinate.

Definition at line 133 of file DataView.cxx.

References ViewBase::getUserRect(), Rect::getWidth(), Rect::getX(), DataView::m_margin_rect, and ViewBase::m_plotter.

Referenced by QtView::toViewX(), QtViewImp::userToDrawXAutoInv(), and EpsView::userToDrawXAutoInv().

float userToInvertedMarginY ( double  y  )  const [protected, virtual, inherited]

Converts the user Y coordinate into the top-left based margin Y coordinate.

Definition at line 154 of file DataView.cxx.

References Rect::getHeight(), ViewBase::getUserRect(), Rect::getY(), DataView::m_margin_rect, and ViewBase::m_plotter.

Referenced by QtViewWidget::toViewY(), QtView::toViewY(), QtViewImp::userToDrawY(), OpenGLView::userToDrawY(), and EpsView::userToDrawY().

float userToMarginColor ( double  c  )  const [protected, virtual, inherited]

Converts the user Z coordinate into the margin color (X) coordinate.

Definition at line 165 of file DataView.cxx.

References Rect::getDepth(), ViewBase::getUserRect(), Rect::getWidth(), Rect::getX(), Rect::getZ(), DataView::m_margin_rect, and ViewBase::m_plotter.

Referenced by QtViewImp::userToDrawColor(), OpenGLView::userToDrawColor(), and EpsView::userToDrawColor().

float userToMarginX ( double  x  )  const [protected, virtual, inherited]

Converts the user X coordinate into the margin X coordinate.

Definition at line 122 of file DataView.cxx.

References ViewBase::getUserRect(), Rect::getWidth(), Rect::getX(), DataView::m_margin_rect, and ViewBase::m_plotter.

Referenced by QtViewWidget::toViewX(), QtView::toViewX(), OpenGLView::toViewX(), EpsView::toViewX(), QtViewImp::userToDrawX(), OpenGLView::userToDrawX(), EpsView::userToDrawX(), QtViewImp::userToDrawXAutoInv(), and EpsView::userToDrawXAutoInv().

float userToMarginY ( double  y  )  const [protected, virtual, inherited]

Converts the user Y coordinate into the margin Y coordinate.

Definition at line 144 of file DataView.cxx.

References Rect::getHeight(), ViewBase::getUserRect(), Rect::getY(), DataView::m_margin_rect, and ViewBase::m_plotter.

Referenced by OpenGLView::toViewY(), and EpsView::toViewY().

void willDelete ( const Observable plotter  )  [virtual, inherited]

Responds to notification that the PlotterBase object is being deleted.

Reimplemented from Observer.

Definition at line 96 of file ViewBase.cxx.

References ViewBase::m_plotter.


Member Data Documentation

Rect m_boundingRect [private]

Definition at line 34 of file EpsView.h.

Referenced by EpsView::toViewX(), EpsView::toViewY(), EpsView::toX(), and EpsView::toY().

Rect m_draw_rect [private]

Definition at line 36 of file EpsView.h.

Referenced by EpsView::getDrawRect(), EpsView::setDrawRect(), EpsView::toViewX(), EpsView::toViewY(), EpsView::toX(), and EpsView::toY().

Rect m_margin_rect [protected, inherited]

The rectangle area in which the projected points are plotted.

The coordinate system is that of the view device. X increase to the right and Y increases downward. Outside of this area are the axis labels, title, etc.

Definition at line 48 of file DataView.h.

Referenced by DataView::getMarginRect(), DataView::marginToInvertedUserX(), DataView::marginToInvertedUserY(), DataView::marginToUserX(), DataView::marginToUserY(), DataView::prepareMarginRect(), QtView::setDrawRect(), DataView::setMarginRect(), DataView::userToInvertedMarginX(), DataView::userToInvertedMarginY(), DataView::userToMarginColor(), DataView::userToMarginX(), and DataView::userToMarginY().

std::ofstream m_outfile [private]

Definition at line 32 of file EpsView.h.

Referenced by EpsView::closeFile(), EpsView::draw_Text(), EpsView::drawColorLines(), EpsView::drawLines(), EpsView::drawPoints(), EpsView::drawPolyLine(), EpsView::drawSquare(), EpsView::drawSymbol(), EpsView::drawText(), EpsView::drawViewLines(), EpsView::drawViewSquare(), EpsView::initPlot(), EpsView::lineTo(), EpsView::moveTo(), EpsView::setDash(), EpsView::setLineWidth(), and EpsView::setRgbColor().

PlotterBase* 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 69 of file ViewBase.h.

Referenced by DataView::DataView(), QtView::draw(), ViewBase::drawSelf(), QtViewImp::drawSquare(), QtViewWidget::fillPickedPoint(), QtView::fillPickedPoint(), ViewBase::getAspectRatio(), ViewBase::getPlotter(), ViewBase::getRange(), ViewBase::getRawRect(), ViewBase::getUserRect(), QtView::isTextView(), DataView::marginToInvertedUserX(), DataView::marginToInvertedUserY(), DataView::marginToUserX(), DataView::marginToUserY(), QtViewWidget::mousePressEvent(), QtViewWidget::paintEvent(), DataView::prepareMarginRect(), QtView::QtView(), QtViewWidget::resizeEvent(), QtViewImp::setCrossX(), QtViewImp::setCrossY(), QtViewWidget::setGeometry(), ViewBase::setPlotter(), QtView::toViewX(), QtViewWidget::update(), QtViewImp::userToDrawXAutoInv(), EpsView::userToDrawXAutoInv(), DataView::userToInvertedMarginX(), DataView::userToInvertedMarginY(), DataView::userToMarginColor(), DataView::userToMarginX(), DataView::userToMarginY(), ViewBase::willDelete(), and QtView::~QtView().


The documentation for this class was generated from the following files:
Generated for HippoDraw Class Library by doxygen